# Word Embedding for Item Names(integer, one-hot encoding)

I am looking for the way to get the similarity between two item names using integer encoding or one-hot encoding.

For example, "lane connector" vs. "a truck crane".
I have 100,000 item names consisting of 2~3 words as above.
also, items have its size(36mm, 12M, 2400*1200...) and unit(ea, m2, m3, hr...)

I wanna make (item name, size, unit) as a vector. To do this, I need to change texts to numbers using some way. All I found is only word2vec things, but my case has no context corpus. So I don't think it is possible to learn some context from my data.

• Will be good if you provide few samples with complete feature list, possibly will help me in my better understanding. – vipin bansal Jun 20 '19 at 5:11
• Why word2vec or Glove wouldn't be useful for your item names? Also before that you could think of using TF-IDF to construct your vectors, it is very simple and I think it will be better than integer or one-hot encoding. – TwinPenguins Jun 20 '19 at 5:17
• @vipinbansal added the image :) – Ken Kim Jun 20 '19 at 5:36
• @TwinPenguins I don't think that I can use those method because of the data – Ken Kim Jun 20 '19 at 5:38

I'm not sure, if it's possible with this data set. Word2Vec is used to generate word embedding, which works on the principle of "words association" in a sentence.

So I dont think you can apply Word2Vec on this dataset which looks like doesn't have any association, except on some places where you can match(perform clustering) some parameters like:

1. Units
2. Size/dimension of the item-name

Interested to know some solution for such types of problems.

Okay, so what I understand is you just have a list of words and want to get word vectors for those. You are correct that you cannot train a word2vec model as it requires a corpus. But what you can do is use a pre-trained model (word2vec or glove). I suggest you use word2vec as gensim has a pretty simple implementation. You can download Google’s pre-trained model here. And then you can use the following code to get word_embed for a given word_list.

import gensim