💡 All-in-one AI framework for semantic search, LLM orchestration and language model workflows
Python agentsaiai-agentsembeddingsinformation-retrievallanguage-modellarge-language-modelsllmnlppythonragretrieval-augmented-generationsearchsearch-enginesemantic-searchsentence-embeddingstransformerstxtaivector-databasevector-search
Add documentation for #372
davidmezzetti41bb1b89db5c
diff --git a/docs/pipeline/text/similarity.md b/docs/pipeline/text/similarity.mdindex e63e2ad5..63bc2014 100644--- a/docs/pipeline/text/similarity.md+++ b/docs/pipeline/text/similarity.md@@ -7,6 +7,8 @@ The Similarity pipeline computes similarity between queries and list of text usiThis pipeline supports both standard text classification models and zero-shot classification models. The pipeline uses the queries as labels for the input text. The results are transposed to get scores per query/label vs scores per input text.+Cross-encoder models are supported via the `crossencode=True` constructor parameter. These models are loaded with a CrossEncoder pipeline that can also be instantiated directly. The CrossEncoder pipeline has the same methods and functionality as described below.+## ExampleThe following shows a simple example using this pipeline.diff --git a/src/python/txtai/pipeline/text/similarity.py b/src/python/txtai/pipeline/text/similarity.pyindex b862b463..b358e39e 100644--- a/src/python/txtai/pipeline/text/similarity.py+++ b/src/python/txtai/pipeline/text/similarity.py@@ -14,6 +14,7 @@ class Similarity(Labels):"""def __init__(self, path=None, quantize=False, gpu=True, model=None, dynamic=True, crossencode=False):+ # Use zero-shot classification if dynamic is True and crossencode is False, otherwise use standard text classificationsuper().__init__(path, quantize, gpu, model, False if crossencode else dynamic)# Load as a cross-encoder if crossencode set to True