Skip to content

Commit

Permalink
ruff linting
Browse files Browse the repository at this point in the history
  • Loading branch information
isaac-chung committed Jul 1, 2024
1 parent 4655fe1 commit ca3c9b0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def __init__(
top_k: int = 10,
scale_score: bool = True,
return_embedding: bool = False,
score_threshold : float = None,
score_threshold : Optional[float] = None,
):
"""
Create a QdrantEmbeddingRetriever component.
Expand All @@ -49,7 +49,7 @@ def __init__(
:param top_k: The maximum number of documents to retrieve.
:param scale_score: Whether to scale the scores of the retrieved documents or not.
:param return_embedding: Whether to return the embedding of the retrieved Documents.
:param score_threshold: Define a minimal score threshold for the result. If defined, less similar results will not be returned.
:param score_threshold: A minimal score threshold for the result.
:raises ValueError: If `document_store` is not an instance of `QdrantDocumentStore`.
"""
Expand Down Expand Up @@ -117,7 +117,7 @@ def run(
:param top_k: The maximum number of documents to return.
:param scale_score: Whether to scale the scores of the retrieved documents or not.
:param return_embedding: Whether to return the embedding of the retrieved Documents.
:param score_threshold: Define a minimal score threshold for the result. If defined, less similar results will not be returned.
:param score_threshold: A minimal score threshold for the result.
:returns:
The retrieved documents.
Expand Down Expand Up @@ -168,7 +168,7 @@ def __init__(
top_k: int = 10,
scale_score: bool = True,
return_embedding: bool = False,
score_threshold : float = None,
score_threshold : Optional[float] = None,
):
"""
Create a QdrantSparseEmbeddingRetriever component.
Expand All @@ -178,7 +178,7 @@ def __init__(
:param top_k: The maximum number of documents to retrieve.
:param scale_score: Whether to scale the scores of the retrieved documents or not.
:param return_embedding: Whether to return the sparse embedding of the retrieved Documents.
:param score_threshold: Define a minimal score threshold for the result. If defined, less similar results will not be returned.
:param score_threshold: A minimal score threshold for the result.
:raises ValueError: If `document_store` is not an instance of `QdrantDocumentStore`.
"""
Expand Down Expand Up @@ -246,7 +246,7 @@ def run(
:param top_k: The maximum number of documents to return.
:param scale_score: Whether to scale the scores of the retrieved documents or not.
:param return_embedding: Whether to return the embedding of the retrieved Documents.
:param score_threshold: Define a minimal score threshold for the result. If defined, less similar results will not be returned.
:param score_threshold: A minimal score threshold for the result.
:returns:
The retrieved documents.
Expand Down Expand Up @@ -302,7 +302,7 @@ def __init__(
filters: Optional[Union[Dict[str, Any], models.Filter]] = None,
top_k: int = 10,
return_embedding: bool = False,
score_threshold : float = None,
score_threshold : Optional[float] = None,
):
"""
Create a QdrantHybridRetriever component.
Expand All @@ -311,7 +311,7 @@ def __init__(
:param filters: A dictionary with filters to narrow down the search space.
:param top_k: The maximum number of documents to retrieve.
:param return_embedding: Whether to return the embeddings of the retrieved Documents.
:param score_threshold: Define a minimal score threshold for the result. If defined, less similar results will not be returned.
:param score_threshold: A minimal score threshold for the result.
:raises ValueError: If 'document_store' is not an instance of QdrantDocumentStore.
"""
Expand Down Expand Up @@ -374,7 +374,7 @@ def run(
:param filters: A dictionary with filters to narrow down the search space.
:param top_k: The maximum number of documents to return.
:param return_embedding: Whether to return the embedding of the retrieved Documents.
:param score_threshold: Define a minimal score threshold for the result. If defined, less similar results will not be returned.
:param score_threshold: A minimal score threshold for the result.
:returns:
The retrieved documents.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ def _query_by_sparse(
top_k: int = 10,
scale_score: bool = True,
return_embedding: bool = False,
score_threshold: float = None,
score_threshold: Optional[float] = None,
) -> List[Document]:
"""
Queries Qdrant using a sparse embedding and returns the most relevant documents.
Expand All @@ -525,7 +525,7 @@ def _query_by_sparse(
:param top_k: Maximum number of documents to return.
:param scale_score: Whether to scale the scores of the retrieved documents.
:param return_embedding: Whether to return the embeddings of the retrieved documents.
:param score_threshold: Define a minimal score threshold for the result. If defined, less similar results will not be returned.
:param score_threshold: A minimal score threshold for the result.
:returns: List of documents that are most similar to `query_sparse_embedding`.
Expand Down Expand Up @@ -575,7 +575,7 @@ def _query_by_embedding(
top_k: int = 10,
scale_score: bool = True,
return_embedding: bool = False,
score_threshold: float = None,
score_threshold: Optional[float] = None,
) -> List[Document]:
"""
Queries Qdrant using a dense embedding and returns the most relevant documents.
Expand All @@ -585,7 +585,7 @@ def _query_by_embedding(
:param top_k: Maximum number of documents to return.
:param scale_score: Whether to scale the scores of the retrieved documents.
:param return_embedding: Whether to return the embeddings of the retrieved documents.
:param score_threshold: Define a minimal score threshold for the result. If defined, less similar results will not be returned.
:param score_threshold: A minimal score threshold for the result.
:returns: List of documents that are most similar to `query_embedding`.
"""
Expand Down Expand Up @@ -623,7 +623,7 @@ def _query_hybrid(
filters: Optional[Union[Dict[str, Any], rest.Filter]] = None,
top_k: int = 10,
return_embedding: bool = False,
score_threshold: float = None,
score_threshold: Optional[float] = None,
) -> List[Document]:
"""
Retrieves documents based on dense and sparse embeddings and fuses the results using Reciprocal Rank Fusion.
Expand All @@ -636,7 +636,7 @@ def _query_hybrid(
:param filters: Filters applied to the retrieved documents.
:param top_k: Maximum number of documents to return.
:param return_embedding: Whether to return the embeddings of the retrieved documents.
:param score_threshold: Define a minimal score threshold for the result. If defined, less similar results will not be returned.
:param score_threshold: A minimal score threshold for the result.
:returns: List of Document that are most similar to `query_embedding` and `query_sparse_embedding`.
Expand Down

0 comments on commit ca3c9b0

Please sign in to comment.