Greg Thompson commited on
Commit
4e0ade3
1 Parent(s): cfc86b2

Update nlu to fix integer issue

Browse files
Files changed (1) hide show
  1. mathtext_fastapi/nlu.py +4 -1
mathtext_fastapi/nlu.py CHANGED
@@ -110,7 +110,10 @@ def run_intent_classification(message_text):
110
  ]
111
 
112
  for command in commands:
113
- ratio = fuzz.ratio(command, message_text.lower())
 
 
 
114
  if ratio > 80:
115
  nlu_response['data'] = command
116
  nlu_response['confidence'] = ratio / 100
 
110
  ]
111
 
112
  for command in commands:
113
+ try:
114
+ ratio = fuzz.ratio(command, message_text.lower())
115
+ except:
116
+ ratio = 0
117
  if ratio > 80:
118
  nlu_response['data'] = command
119
  nlu_response['confidence'] = ratio / 100