Spaces:
Runtime error
Runtime error
Greg Thompson commited on
Commit ·
cfc86b2
1
Parent(s): 2783ab2
Update nlu endpoint logic
Browse files154 unmodified lines155156157158159160161162163164165166158159160161162163164165166167168154 unmodified lines predicted_label = predict_message_intent(message_text) if predicted_label['confidence'] > 0.05: nlu_response = predicted_label return nlu_response
# Run sentiment analysis sentiment_api_resp = sentiment(message_text) nlu_response = build_nlu_response_object( 'sentiment', sentiment_api_resp[0]['label'], sentiment_api_resp[0]['score'] ) else: # Run sentiment analysis sentiment_api_resp = sentiment(message_text) nlu_response = build_nlu_response_object( 'sentiment', sentiment_api_resp[0]['label'], sentiment_api_resp[0]['score'] ) else: nlu_response = build_nlu_response_object( 'integer',mathtext_fastapi/nlu.py+8-9