Skip to content

Commit 091382e

Browse files
committed
fix #49: merged answers now adheres to CHAR_LIMIT. limit also decreased
1 parent 74bcb07 commit 091382e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

chatbot/nlp/query.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ def _perform_search(query_text, url_style):
222222
# Append answers until we reach the CHAR_LIMIT
223223
i, n_chars = 0, 0
224224
while n_chars < CHAR_LIMIT and i < len(answers):
225-
n_chars += len(answers[i])
225+
n_chars += len(answers[i][0])
226226
i += 1
227227

228228
# If we only have 1 answer after threshold we don't want to add the

chatbot/settings.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@
9494
"multiple_answers": "Jeg har flere mulige svar til deg.",
9595
"url_from_text": "Kilde",
9696
"custom_synset_file": "chatbot/nlp/statics/synset.json",
97-
"character_limit": 400,
98-
"max_answers": 4,
99-
"answer_threshold": 0.05,
97+
"character_limit": 300,
98+
"max_answers": 3,
99+
"answer_threshold": 0.065,
100100
"similarity_threshold": 0.1
101101
}
102102
}

0 commit comments

Comments
 (0)