Function reference

Vectorisers

Utilities to project text into numerical representation in a semantic vector space

vectorisers This module provides classes for creating and utilising embedding models from different services.
vectorisers.base This module provides classes for creating and utilising embedding models from different services.
vectorisers.base.VectoriserBase Abstract base class for all vectorisers.
vectorisers.base.VectoriserBase.transform Transforms input text(s) into embeddings.
vectorisers.huggingface.HuggingFaceVectoriser A general wrapper class for Huggingface Transformers models to generate text embeddings.
vectorisers.ollama.OllamaVectoriser A wrapper class allowing a locally-running Ollama server to generate text embeddings.
vectorisers.gcp.GcpVectoriser A class for embedding text using Google Cloud Platform’s GenAI API.

Indexers

Creation of Vector Stores for efficient similarity search and retrieval

indexers This module provides functionality for creating a VectorStore from a CSV (text) file.
indexers.main Provides functionality for creating a VectorStore from a CSV file.
indexers.VectorStore Models and creates vector databases from CSV text files.
indexers.dataclasses Dataclasses for structuring and validating VectorStore input and output data.
indexers.dataclasses.VectorStoreSearchInput DataFrame-like object for forming and validating search query input data.
indexers.dataclasses.VectorStoreSearchOutput DataFrame-like object for storing and validating search results.
indexers.dataclasses.VectorStoreReverseSearchInput DataFrame-like object for forming and validating reverse search query input data.
indexers.dataclasses.VectorStoreReverseSearchOutput DataFrame-like object for storing reverse search results.
indexers.dataclasses.VectorStoreEmbedInput DataFrame-like object for forming and validating text data to be embedded.
indexers.dataclasses.VectorStoreEmbedOutput DataFrame-like object for storing and validating embedded vectors.
indexers.VectorStore.embed Generates vector embeddings from a VectorStoreEmbedInput object.
indexers.VectorStore.search Queries the vectors attribute for the most similar documents.
indexers.VectorStore.reverse_search Looks up documents in vectors by label.
indexers.VectorStore.from_filespace Creates a VectorStore instance from a saved filespace folder.

Hooks

Creation of Pre and post Processing hooks for improved search and RAG

indexers.hooks This module contains a factory for, and example pre-built hooks. Allowing users to manipulate the content of ClassifAI dataclass objects as they enter or leave the VectorStore.
indexers.hooks.hook_factory
indexers.hooks.default_hooks Submodule containing the prebuilt hooks for the service.
indexers.hooks.default_hooks.preprocessing
indexers.hooks.default_hooks.postprocessing
indexers.hooks.hook_factory.HookBase Abstract base class for all hooks requiring customisation.
indexers.hooks.default_hooks.preprocessing.CapitalisationStandardisingHook A pre-processing hook to handle upper-/lower-/sentence-/title-casing.
indexers.hooks.default_hooks.postprocessing.DeduplicationHook A post-processing hook to remove duplicate knowledgebase entries.
indexers.hooks.default_hooks.postprocessing.RagHook A post-processing hook to perform Retrieval Augmented Generation.

Servers

Expose ClassifAI functionality via Fast-API endpoints

servers REST API integration for ClassifAI vector stores.
servers.main Utilities for building and running the ClassifAI REST API.
servers.get_router Create and return a FastAPI APIRouter with search endpoints.
servers.get_server Create and return a FastAPI server with search endpoints.
servers.run_server Create and run a FastAPI server with search endpoints.
servers.make_endpoints Create and register the different endpoints to your app.

Evaluation

Utilities for evaluating the performance of VectorStores

evaluation Evaluation utilities for ClassifAI.
evaluation.main This module evaluates one or more classifai.indexers.VectorStore instances on a ground-truth labelled dataset.
evaluation.main.Evaluation Evaluation class for assessing the performance of vectorstores against ground truth data.
evaluation.metrics Metrics.py provides a set of evaluation metrics for multiclass, single-label classification tasks.
evaluation.metrics.Metric Base class for all classification metrics.
evaluation.metrics.MetricResult Represents the result of a metric evaluation.