Skip to content

Commit

Permalink
Added extractor with 0 keywords
Browse files Browse the repository at this point in the history
  • Loading branch information
KonainQureshi committed Nov 7, 2023
1 parent 7269a7b commit 6c1ca95
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ACMAS/app/ACMAS_Web/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 6c1ca95

Please sign in to comment.