Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com>tags/0.7.2
| </component> | </component> | ||||
| <component name="VcsDirectoryMappings"> | <component name="VcsDirectoryMappings"> | ||||
| <mapping directory="" vcs="Git" /> | <mapping directory="" vcs="Git" /> | ||||
| <mapping directory="$PROJECT_DIR$/.." vcs="Git" /> | |||||
| </component> | </component> | ||||
| </project> | </project> |
| ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" | ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" | ||||
| # Download nltk data | # 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 source code | ||||
| COPY . /app/api/ | COPY . /app/api/ |
| for document in all_documents: | for document in all_documents: | ||||
| if score_threshold is None or document.metadata['score'] >= score_threshold: | if score_threshold is None or document.metadata['score'] >= score_threshold: | ||||
| filter_documents.append(document) | filter_documents.append(document) | ||||
| if not filter_documents: | if not filter_documents: | ||||
| return [] | return [] | ||||
| filter_documents = sorted(filter_documents, key=lambda x: x.metadata['score'], reverse=True) | filter_documents = sorted(filter_documents, key=lambda x: x.metadata['score'], reverse=True) |