Greg Thompson commited on
Commit
16d53be
1 Parent(s): 605f02f

Reorder the execution of nlu analysis

Browse files
Files changed (1) hide show
  1. mathtext_fastapi/nlu.py +4 -4
mathtext_fastapi/nlu.py CHANGED
@@ -142,13 +142,13 @@ def evaluate_message_with_nlu(message_data):
142
  }
143
  message_text = message_data['message_body']
144
 
 
 
 
 
145
  number_api_resp = text2int(message_text.lower())
146
 
147
  if number_api_resp == 32202:
148
- intent_api_response = run_intent_classification(message_text)
149
- if intent_api_response['data']:
150
- return intent_api_response
151
-
152
  sentiment_api_resp = sentiment(message_text)
153
  nlu_response = build_nlu_response_object(
154
  'sentiment',
 
142
  }
143
  message_text = message_data['message_body']
144
 
145
+ intent_api_response = run_intent_classification(message_text)
146
+ if intent_api_response['data']:
147
+ return intent_api_response
148
+
149
  number_api_resp = text2int(message_text.lower())
150
 
151
  if number_api_resp == 32202:
 
 
 
 
152
  sentiment_api_resp = sentiment(message_text)
153
  nlu_response = build_nlu_response_object(
154
  'sentiment',