indexers.dataclasses.VectorStoreReverseSearchInput

indexers.dataclasses.VectorStoreReverseSearchInput(data)

DataFrame-like object for forming and validating reverse search query input data.

This class validates and represents input for reverse searches, which find similar documents to a given document in the vector store.

Attributes

Name Type Description
id pd.Series Unique identifier for the reverse search query.
doc_label pd.Series The document ID to find similar documents for.

Methods

Name Description
from_data Create a validated VectorStoreReverseSearchInput from a dictionary or DataFrame.
validate Validate an existing DataFrame and return a VectorStoreReverseSearchInput.

from_data

indexers.dataclasses.VectorStoreReverseSearchInput.from_data(data)

Create a validated VectorStoreReverseSearchInput from a dictionary or DataFrame.

Creates a new instance of VectorStoreReverseSearchInput by validating the input data against the defined schema.

Parameters

Name Type Description Default
data dict | pd.DataFrame A dictionary or pandas DataFrame containing the input data. Must include ‘id’ and ‘doc_label’ columns/keys. required

Returns

Name Type Description
VectorStoreReverseSearchInput VectorStoreReverseSearchInput A validated instance of the class.

validate

indexers.dataclasses.VectorStoreReverseSearchInput.validate(df)

Validate an existing DataFrame and return a VectorStoreReverseSearchInput.

Validates the provided pandas DataFrame against the defined schema and returns a new instance of VectorStoreReverseSearchInput if validation is successful.

Parameters

Name Type Description Default
df pd.DataFrame A pandas DataFrame to validate. Must include ‘id’ and ‘doc_label’ columns. required

Returns

Name Type Description
VectorStoreReverseSearchInput VectorStoreReverseSearchInput A validated instance of the class.