Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com>
@@ -12,5 +12,6 @@
</component>
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
+ <mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</project>
@@ -65,7 +65,7 @@ COPY --from=packages ${VIRTUAL_ENV} ${VIRTUAL_ENV}
ENV PATH="${VIRTUAL_ENV}/bin:${PATH}"
# Download nltk data
-RUN python -c "import nltk; nltk.download('punkt')"
+RUN python -c "import nltk; nltk.download('punkt'); nltk.download('averaged_perceptron_tagger')"
# Copy source code
COPY . /app/api/
@@ -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)