List[Dict[str, str]]
get_number_of_documents() → int[source]¶
Helper to see the number of documents in the index
Returns
The number of documents
Return type
int
marqo_bulk_similarity_search(queries: Iterable[Union[str, Dict[str, float]]], k: int = 4) → Dict[str, List[Dict[str, List[Dict[str, str]]]]][source]¶
Return documents from Marqo using a bulk search, exposes Marqo’s
output directly
Parameters
queries (Iterable[Union[str, Dict[str, float]]]) – A list of queries.
k (int, optional) – The number of documents to return for each query.
4. (Defaults to) – 
Returns
A bulk search results
object
Return type
Dict[str, Dict[List[Dict[str, Dict[str, Any]]]]]
marqo_similarity_search(query: Union[str, Dict[str, float]], k: int = 4) → Dict[str, List[Dict[str, str]]][source]¶
Return documents from Marqo exposing Marqo’s output directly
Parameters
query (str) – The query to search with.
k (int, optional) – The number of documents to return. Defaults to 4.
Returns
This hits from marqo.
Return type
List[Dict[str, Any]]
max_marginal_relevance_search(query: str, k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶
Return docs selected using the maximal marginal relevance.
Maximal marginal relevance optimizes for similarity to query AND diversity
among selected documents.
Parameters
query – Text to look up documents similar to.
k – Number of Documents to return. Defaults to 4.