Hey i need little help for my chatbot:
Similarity analysis: The bot can use similarity analysis techniques to find similarities between different questions asked by the user. For example, using text similarity measures like the Levenshtein distance or the TF-IDF algorithm, the bot can identify terms or phrases. The idea is to use the context (the question asked by the user) and the patterns of the json file to allow the bot not to repeat the same error for example: if a user says to him “what is an insulator the bot gives the answer and then the user asks “how to replace it” he bot must understand that it is about insulators. , or the user comes asks “type of insulator” and comes back to ask “what is its page number” if you look in my code I added “page” when I ask ‘chain equipment type’ and then I ask ‘how to replace them’ he can’t understand that it is ‘chain equipment type’ yet in my json file I have a pattern “” replaced a chain gear,” or even Dialog state modeling: The bot can use a dialog state modeling approach to keep track of the current state of the conversation. It can store the important information exchanged so far and use this state to understand the user’s intentions and generate appropriate responses.
I would like to use the TF-IDF for example: if a user says to him “what is an insulator the bot gives the answer and then the user asks “how to replace it” he bot must understand that these are the isolator., it extracts the key terms from the two questions and checks if a pattern from the json file matches and then uses the levenshtein distance to calculate the similarity.
But I don’t know if it’s the bot approach I used a conversational memory before but it didn’t work or maybe I did it wrong, I implemented it directly in my model.py file (neuron class) self.conversation_memory = [ ] and then I imported it into my train.py file and trained it with my json data here is the code for my chat.py file where I want to implement this functionality and also I I use a perceptron with 3 hidden linear layers, I used an LSTM and the BART Model but the percetron was faster, and gave better results
submitted by /u/Pkfr29
[link] [comments]