indexers.dataclasses.VectorStoreReverseSearchOutput
indexers.dataclasses.VectorStoreReverseSearchOutput(data)DataFrame-like object for storing reverse search results.
This class represents the output of vector store reverse search operations, containing knowledgebase examples with the same label as in the query.
Attributes
| Name | Type | Description |
|---|---|---|
| id | pd.Series | Identifier for the input label for lookup in the knowledgebase. |
| searched_doc_label | pd.Series | Identifier for the knowledgebase label being looked up. |
| doc_label | pd.Series | Identifier for the retrieved document with the same label. |
| doc_text | pd.Series | The text content of the retrieved example. |
Methods
| Name | Description |
|---|---|
| from_data | Create a validated VectorStoreReverseSearchOutput from a dictionary or DataFrame. |
| validate | Validate an existing DataFrame and return a VectorStoreReverseSearchOutput. |
from_data
indexers.dataclasses.VectorStoreReverseSearchOutput.from_data(data)Create a validated VectorStoreReverseSearchOutput from a dictionary or DataFrame.
Creates a new instance of VectorStoreReverseSearchOutput by validating the input data against the defined schema. If the output is empty, it creates a DataFrame with the correct schema.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| data | dict | pd.DataFrame | A dictionary or pandas DataFrame containing the input data. Must include ‘id’, ‘searched_doc_label’, ‘doc_label’, and ‘doc_text’ columns/keys. | required |
Returns
| Name | Type | Description |
|---|---|---|
| VectorStoreReverseSearchOutput | VectorStoreReverseSearchOutput | A validated instance of the class. |
validate
indexers.dataclasses.VectorStoreReverseSearchOutput.validate(df)Validate an existing DataFrame and return a VectorStoreReverseSearchOutput.
Validates the provided pandas DataFrame against the defined schema and returns a new instance of VectorStoreReverseSearchOutput if validation is successful.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| df | pd.DataFrame | A pandas DataFrame to validate. Must include ‘id’, ‘searched_doc_label’, ‘doc_label’, and ‘doc_text’ columns. | required |
Returns
| Name | Type | Description |
|---|---|---|
| VectorStoreReverseSearchOutput | VectorStoreReverseSearchOutput | A validated instance of the class. |