3
$\begingroup$

I have a task to work on models for finding synonyms and contextually related words. For example, if I enter:

  • 'car' it should generate -> 'vehicle'

  • 'sun' and 'sea' could generate 'beach', or some other related word to the first two.

So I used so far word2vec and nltk to generate examples. But since I am not an expert on NLP I really find it difficult to use other algorithms or to build my neural network architecture. I would appreciate it if someone can give me other suggestions and some explanations, that could be useful.

$\endgroup$
1
$\begingroup$

For synonyms I would directly use WordNet.

[added] For contextually similar words the traditional approach is to extract a context vector for every target word:

  1. for every occurrence of a target word extract the words within a -/+ N window (e.g. N=5).
  2. for every target word aggregate all its context words in a single context vector over the whole vocabulary.

Finally once a context vector has been calculated for every target word a similarity measure can be used, for example cosine. That means for every target word, compare its vector against any other candidate.

The same approach can be used with word embeddings instead of context vectors.

$\endgroup$
2
  • $\begingroup$ This is fine but when it comes to proposing contextually similar words, WordNet will not be useful. Can you suggest anything about it? $\endgroup$ – Yana Mar 20 '20 at 7:14
  • $\begingroup$ @Yana added the traditional approach for getting semantically similar words, hope it helps. $\endgroup$ – Erwan Mar 20 '20 at 12:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.