parulnith / Building-a-Simple-Chatbot-in-Python-using-NLTK

Building a Simple Chatbot from Scratch in Python (using NLTK)
https://medium.com/analytics-vidhya/building-a-simple-chatbot-in-python-using-nltk-7c8c8215ac6e
572 stars 573 forks source link

Nltk Similar word matching #2

Open ShrikrishnaPatil opened 5 years ago

ShrikrishnaPatil commented 5 years ago

How to impliment same word meaning chatbot like

if user ask about discription and in raw data "a spoken or written account of a person, object, or event."4 this text is present so how to impliment...using nltk

KalyanPattem commented 4 years ago

Hello Krishna,

In the nltk we will use one textfile,like we used in the example chat text file.There we can add the respective test based on the keywords.So when you are searching for it ,that will return the result which you mentioned the file. Hope this helps!

Thanks, Kalyan

mumtazmalik commented 4 years ago

Hello Krishna, Another idea is to group synonyms as a sentence in your corpus. For example, the first sentence in your corpus should be a set of synonyms of a certain word and the word itself. You can find this data easily and using the same code, you will tokenized the response generated using this code, tokenize it and return either of the token.

For example, there is a sentence "happy cheerful contented delighted ecstatic elated joyous overjoyed pleased." in your corpuse. Now your input 'happy', this bot will return "happy cheerful contented delighted ecstatic elated joyous overjoyed pleased.". The idea is you will tokenize this sentence, removed happy from the tokens and return any word, that would be the meaning of happy. If you have a large data set, this could be a great idea for meanings bot.

The idea way is to use neural word embedding that works fairly good.