Word analysis in Python I have a list of documents which look like this:
[&quot;Display is flickering&quot;]
[&quot;Battery charger is broken&quot;]
[&quot;Hard disk is making noises&quot;]

These text documents are just free text.
I have processed with tokenization, lemmatization, stop words removal, and now I want to assign tags based on a list of words. Example:
{&quot;#display&quot;:[&quot;display&quot;,&quot;screen&quot;,&quot;lcd&quot;,&quot;led&quot;]}
{&quot;#battery&quot;:[&quot;battery&quot;,&quot;power cord&quot;,&quot;charger&quot;,&quot;drains&quot;]}
{&quot;#hard disk&quot;:[&quot;hard disk&quot;,&quot;performance&quot;,&quot;slow&quot;]}

After text normalization I have:
[&quot;Display is flickering&quot;] -&gt; [&quot;display&quot;,&quot;flicker&quot;]

What technique is recommended to compare document: [&quot;display&quot;,&quot;flicker&quot;]
with my dictionary of words and return which value matches the best?
In this case I would like:
[&quot;display&quot;,&quot;flicker&quot;] = &quot;#display&quot;:&quot;display&quot;
[&quot;battery&quot;,&quot;charger&quot;,&quot;broke&quot;] = &quot;#battery&quot;:&quot;charger&quot;

Basically it compares Document A in tokens with a list B of other documents and return which document in list B with more common matches.
I'm using TF, but want to know if there are other techniques, code samples to use.
You can use word embedding in order to compare whole phrases. I am aware about two models: Google's word2vec and Stanford's GloVe. Now, word embedding works best with, well - words. However, you could concatenate every word in your phrase and re-train the models. Afterwards, you could calculate their similarity (say, with cosine similarity) and see how similar your whole phrases are semantically. 

Hope this helps.