3
$\begingroup$

I have the following problem: I have created a customized Dictionary for getting used in some NLP tasks. I want to enhance my dictionary by finding phrases similar to the phrases I have in my dictionary. For example:

Lets say I have a phrase:
- take responsibility 
then, I should be able to find phrases like:
- hold accountable for 
-responsible for

I have just started learning NLP and I tried Word2Vec model over my dictionary but it only gives similar words that are already present in the dictionary. Is there any other algorithm that helps me find similar phrases using multiple sources.

$\endgroup$

2 Answers 2

2
$\begingroup$

One option is Word Mover’s Distance (WMD). WMD is an algorithm for finding the distance between phrases. WMD is based on word embeddings (e.g., word2vec) which encode the semantic meaning of words into dense vectors.

The WMD distance measures the dissimilarity between two text documents as the minimum amount of distance that the embedded words of one document need to "travel" to reach the embedded words of another document.

For example:

enter image description here Source: "From Word Embeddings To Document Distances" Paper

For your problem, you would have to generate candidates then use WMD to find the best matches for a given phrase.

$\endgroup$
1
$\begingroup$

Word2Vec model is used for vectorizing words. For vectorizing sentences ( phrases ) of varied length, we can use Google's Universal Sentence Encoder. Follow this blog and see the paper.

Basically, we will encode each phrase into a vector of say, 512, dimensions. This vector will have similarity with vectors of other similar phrases. We can use Cosine Similarity for determining the most similar phrases.

$\endgroup$
2
  • $\begingroup$ so will this help me to generate new sentences or pick up similar sentences from the data that I have passed ? $\endgroup$
    – user83229
    Commented Oct 4, 2019 at 4:56
  • 1
    $\begingroup$ You can pick up similar sentences. To generate new ones you need to use LSTM based generative networks. $\endgroup$ Commented Oct 4, 2019 at 6:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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