Skip to content

Commit 9499df1

Browse files
committed
bugfix: return intentId for fallback intent
1 parent 1186d59 commit 9499df1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: app/endpoint/controllers.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def api():
7373
return build_response.build_json(result_json)
7474

7575
intent_id, confidence,suggetions = predict(request_json.get("input"))
76-
app.logger.info("Suggetions => %s"%suggetions)
76+
app.logger.info("intent_id => %s"%intent_id)
7777
intent = Intent.objects.get(intentId=intent_id)
7878

7979
if intent.parameters:
@@ -229,6 +229,6 @@ def predict(sentence):
229229
predicted,intents = sentence_classifier.process(sentence)
230230
app.logger.info("predicted intent %s", predicted)
231231
if predicted["confidence"] < bot.config.get("confidence_threshold", .90):
232-
return Intent.objects(intentId=app.config["DEFAULT_FALLBACK_INTENT_NAME"]).first().id, 1.0,[]
232+
return Intent.objects(intentId=app.config["DEFAULT_FALLBACK_INTENT_NAME"]).first().intentId, 1.0,[]
233233
else:
234234
return predicted["intent"], predicted["confidence"],intents[1:]

0 commit comments

Comments
 (0)