# How to handle proper names or variable names in word2vec?

The input in word2vec is known word (spellings), each tagged by its ID.

• But if you process real text, there can be not only dictionary words but also proper nouns like human names, trade marks, file names , etc, how to make an input for that?
• Is you consider some input where items are variables, like the meaning of input would be x = something, and after some time you acces to x value and define some other stuff with it. That would be format for this input, and will this approach work at all?
• I wasn't able to understand the second part completely, can you please explain with some sample code? Jun 18 '19 at 13:34

Word2vec works on the concept of typical word co-occurrences. This means that it will work well only for words that occur frequently in the dataset. So proper nouns will not play any role in training the model. You can keep the proper nouns as they are or use only the words the occur more frequently than some threshold value based on the size of your dataset.

Once you use the value stored in variable x for something, and then change the stored value, it will not reflect anywhere unless you us use the variable x again somewhere in the program.

# Example
x = "something something"
print(x + "...")

# Result
something something ...

# Changing x
x = "new value"

# This new value of x will not reflect anywhere in the program
# Unless you use the variable x again.

• i am thinking about interpreting knoledge from the text. For example, let me quote some article : "We propose a new network architecture for learning on graphs Unlike the traditional multi-head attention mechanism" Interpreting its information is sort of structure (in pseudo-code) : x = Subject (first_person_plural); main = Fact(propose_info_action, x, y) ; y = info_method(of : neural_network, creation_time : new, tool_function = z) , z = Learning(info, learning_source : graph_information(plural)), Jun 18 '19 at 16:12
• so items have kind of relation among each object and the link between sentences where an object occures. Word2vec seems completely not capable to do that since the info it extracts is more primitive? Jun 18 '19 at 16:13