diff --git a/ACMAS/app/ACMAS_Web/search.py b/ACMAS/app/ACMAS_Web/search.py index 77555f0..5c4b9a8 100644 --- a/ACMAS/app/ACMAS_Web/search.py +++ b/ACMAS/app/ACMAS_Web/search.py @@ -97,7 +97,10 @@ def searchQuestion(self, question): numOfKeywords = (question.count(" ")+1) custom_kw_extractor = yake.KeywordExtractor(lan=language, n=max_ngram_size, dedupLim=deduplication_threshold, top=numOfKeywords, features=None) - keywords = custom_kw_extractor.extract_keywords(question) + [['what ',0.0]] + keywords = custom_kw_extractor.extract_keywords(question) + + if (len(keywords) == 0): + keywords = [[i,0.0] for i in question.split(" ")] ret = Question.objects.none() for kw in keywords: