fix nltk averaged_perceptron_tagger download and fix score limit is none (#7582)

Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com>
This commit is contained in:
Jyong 2024-08-26 15:14:05 +08:00 • committed by GitHub
commit 7ae728a9a3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 1 deletions

View file

@ -616,6 +616,7 @@ class DatasetRetrieval:
for document in all_documents:
if score_threshold is None or document.metadata['score'] >= score_threshold:
filter_documents.append(document)
if not filter_documents:
return []
filter_documents = sorted(filter_documents, key=lambda x: x.metadata['score'], reverse=True)