I have this simple intent.json file
{
"intents": [
{
"tag": "greeting",
"patterns": [
"Hi",
"How are you",
"Is anyone there?",
"Hello",
"Good day"
],
"responses": [
"Hello"
],
"context_set": ""
},
{
"tag": "goodbye",
"patterns": [
"Bye",
"not interested",
"Goodbye"
],
"responses": [
"ok bye"
]
},
{
"tag": "thanks",
"patterns": [
"Thanks",
"Thank you"
],
"responses": [
"My pleasure"
]
},
{
"tag": "greetiing_exchange",
"patterns": [
"What about you",
"you",
"how about your self"
],
"responses": [
"i am perfect, thanks for asking"
],
"context_set": ""
}
]
}
from fuzzywuzzy import process
for intent in intents['intents']:
Ratios = process.extract(message,intent['patterns'])
for ratio in Ratios:
highest_value = max(Ratios, key = lambda i : i[1])
print(highest_value)
Now i want input from user identify the pattern and output response.
The problem is it is not iterating through every pattern when i input "hi". Its output is ('Hi', 100) ('not interested', 45) ('Thanks', 45) ('What about you', 45)
I want the pattern which is higher in range of 80 to 100, and print response from that pattern
Another thing there is a library Rhasspy which can be used for intent recognition how can i use that library for this file