I work on AI chat bot. I need sql query to select a single row from database where user input and text in database best matches. (also match percentage > %80)
For Example: "Hello" and "Hello!" , "Hi how are you" and "how are you?", "What is your name?" and "Wat is your name?"
My purpose is to get answer in case of clerical errors. Thanks in advance and sorry for my english
Bot LINK: http://developersland.net/chatbot/jessica.html
Search a levenstein distance algoritm implementation on google (like this) and then
select text
from mytable
where levenshtein_ratio(text, 'text_to_compare') > 80
limit 1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With