Add fuzzy and text-classification light model #1
2 changed files with 4 additions and 3 deletions
3
main.py
3
main.py
|
@ -79,7 +79,8 @@ def run_prompt():
|
|||
question = "empty"
|
||||
while question != "stop":
|
||||
question = input("?")
|
||||
print(answer(question))
|
||||
if question != "stop":
|
||||
print(answer(question))
|
||||
|
||||
|
||||
logging.info("Ratatouille is ready !")
|
||||
|
|
|
@ -60,7 +60,7 @@ class BertIntent():
|
|||
classification = self.classifier(sentence)
|
||||
|
||||
if classification[0]["score"] < 0.7: # score too low
|
||||
return
|
||||
return {'intentName': ''}
|
||||
|
||||
label = classification[0]["label"]
|
||||
|
||||
|
@ -69,7 +69,7 @@ class BertIntent():
|
|||
elif label == "DATE":
|
||||
return {'intentName': 'GetDate'}
|
||||
elif label == "ETEINDRE_CUISINE":
|
||||
return {'intentName': 'GetTime', 'intentArg': ['cuisine']}
|
||||
return {'intentName': 'LightOff', 'intentArg': ['cuisine']}
|
||||
elif label == "ETEINDRE_BUREAU":
|
||||
return {'intentName': 'LightOff', 'intentArg': ['bureau']}
|
||||
elif label == "ETEINDRE_SALON":
|
||||
|
|
Loading…
Add table
Reference in a new issue