From 091382e66670ce083b8a6ab1520bd1b28ee88db3 Mon Sep 17 00:00:00 2001 From: Vegar Andreas Bergum Date: Mon, 25 Nov 2019 20:32:46 +0000 Subject: [PATCH 1/2] fix #49: merged answers now adheres to CHAR_LIMIT. limit also decreased --- chatbot/nlp/query.py | 2 +- chatbot/settings.json | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/chatbot/nlp/query.py b/chatbot/nlp/query.py index 33a23fb..238b3f8 100644 --- a/chatbot/nlp/query.py +++ b/chatbot/nlp/query.py @@ -222,7 +222,7 @@ def _perform_search(query_text, url_style): # Append answers until we reach the CHAR_LIMIT i, n_chars = 0, 0 while n_chars < CHAR_LIMIT and i < len(answers): - n_chars += len(answers[i]) + n_chars += len(answers[i][0]) i += 1 # If we only have 1 answer after threshold we don't want to add the diff --git a/chatbot/settings.json b/chatbot/settings.json index c036f9d..7a15055 100644 --- a/chatbot/settings.json +++ b/chatbot/settings.json @@ -94,9 +94,9 @@ "multiple_answers": "Jeg har flere mulige svar til deg.", "url_from_text": "Kilde", "custom_synset_file": "chatbot/nlp/statics/synset.json", - "character_limit": 400, - "max_answers": 4, - "answer_threshold": 0.05, + "character_limit": 300, + "max_answers": 3, + "answer_threshold": 0.065, "similarity_threshold": 0.1 } } From 4d63c7f0e85071874586a95e8e4f5d0412fdd9be Mon Sep 17 00:00:00 2001 From: Vegar Andreas Bergum Date: Mon, 25 Nov 2019 20:34:09 +0000 Subject: [PATCH 2/2] Version 1.5.1 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 96bc2d9..3b84b77 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup -setup(name='chatbot', version='1.5.0', packages=['chatbot/nlp', +setup(name='chatbot', version='1.5.1', packages=['chatbot/nlp', 'chatbot/model', 'chatbot/api', 'chatbot/util',