diff --git a/docs/_src/api/api/document_store.md b/docs/_src/api/api/document_store.md index f150ec43d..908c05208 100644 --- a/docs/_src/api/api/document_store.md +++ b/docs/_src/api/api/document_store.md @@ -1150,6 +1150,36 @@ def get_documents_by_id(ids: List[str], index: Optional[str] = None) -> List[Doc Fetch documents by specifying a list of text id strings. + + +#### get\_scores\_torch + +```python +def get_scores_torch(query_emb: np.ndarray, document_to_search: List[Document]) -> List[float] +``` + +Calculate similarity scores between query embedding and a list of documents using torch. + +**Arguments**: + +- `query_emb`: Embedding of the query (e.g. gathered from DPR) +- `document_to_search`: List of documents to compare `query_emb` against. + + + +#### get\_scores\_numpy + +```python +def get_scores_numpy(query_emb: np.ndarray, document_to_search: List[Document]) -> List[float] +``` + +Calculate similarity scores between query embedding and a list of documents using numpy. + +**Arguments**: + +- `query_emb`: Embedding of the query (e.g. gathered from DPR) +- `document_to_search`: List of documents to compare `query_emb` against. + #### query\_by\_embedding diff --git a/pyproject.toml b/pyproject.toml index fa1004295..887862266 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,9 +22,23 @@ disable = [ "too-few-public-methods", "raise-missing-from" ] - [tool.pylint.'DESIGN'] max-args=7 - [tool.pylint.'SIMILARITIES'] -min-similarity-lines=6 \ No newline at end of file +min-similarity-lines=6 + + +[tool.pytest.ini_options] +minversion = "6.0" +addopts = "--strict-markers" +markers = [ + "slow: marks tests as slow (deselect with '-m \"not slow\"')", + "tika: marks tests which require tika container (deselect with '-m \"not tika\"')", + "elasticsearch: marks tests which require elasticsearch container (deselect with '-m \"not elasticsearch\"')", + "graphdb: marks tests which require graphdb container (deselect with '-m \"not graphdb\"')", + "generator: marks generator tests (deselect with '-m \"not generator\"')", + "pipeline: marks tests with pipeline", + "summarizer: marks summarizer tests", + "weaviate: marks tests that require weaviate container", + "embedding_dim: marks usage of document store with non-default embedding dimension (e.g @pytest.mark.embedding_dim(128))", +] \ No newline at end of file diff --git a/test/pytest.ini b/test/pytest.ini deleted file mode 100644 index fd613440e..000000000 --- a/test/pytest.ini +++ /dev/null @@ -1,12 +0,0 @@ -[pytest] -addopts = --strict-markers -markers = - slow: marks tests as slow (deselect with '-m "not slow"') - tika: marks tests which require tika container (deselect with '-m "not tika"') - elasticsearch: marks tests which require elasticsearch container (deselect with '-m "not elasticsearch"') - graphdb: marks tests which require graphdb container (deselect with '-m "not graphdb"') - generator: marks generator tests (deselect with '-m "not generator"') - pipeline: marks tests with pipeline - summarizer: marks summarizer tests - weaviate: marks tests that require weaviate container - embedding_dim: marks usage of document store with non-default embedding dimension (e.g @pytest.mark.embedding_dim(128)) \ No newline at end of file