scalability4all / voice-enabled-chatbot

Implementing a voice enabled chatbot which converses with a user via their voice in natural language. Website: https://scalability4all.github.io/
MIT License
38 stars 54 forks source link

Semantic similarity between two sentences #50

Open gautamig54 opened 4 years ago

gautamig54 commented 4 years ago

Hello,

As per the requirement of a chatbot, I feel it is important to have an algorithm which calculates the semantic similarity between the two sentences. For example, In the existing code, similar sentences like, "how are you?" and "how are you doing" have been quoted separately, while the reply will be the same in both cases. Also, these sentences can be framed in many different ways which depends on the user and will not be possible to quote individually. Therefore, we can implement a system which can calculate the semantic similarity between the two sentences. Thus, the code will be more efficient and open to varied queries.

gautamig54 commented 4 years ago

One solution I would like to suggest is using Word2vec for vectorising the words in both the sentences and then calculating the score, for example cosine score. The output will be in between 0 and 1. Higher the value, more similar the sentences are.