--- tags: - sentence-transformers - cross-encoder - reranker pipeline_tag: text-classification library_name: sentence-transformers --- # CrossEncoder This is a [Cross Encoder](https://www.sbert.net/docs/cross_encoder/usage/usage.html) model trained using the [sentence-transformers](https://www.SBERT.net) library. It computes scores for pairs of texts, which can be used for text pair classification. ## Model Details ### Model Description - **Model Type:** Cross Encoder - **Maximum Sequence Length:** 512 tokens - **Number of Output Labels:** 3 labels ### Model Sources - **Documentation:** [Sentence Transformers Documentation](https://sbert.net) - **Documentation:** [Cross Encoder Documentation](https://www.sbert.net/docs/cross_encoder/usage/usage.html) - **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers) - **Hugging Face:** [Cross Encoders on Hugging Face](https://huggingface.co/models?library=sentence-transformers&other=cross-encoder) ## Usage ### Direct Usage (Sentence Transformers) First install the Sentence Transformers library: ```bash pip install -U sentence-transformers ``` Then you can load this model and run inference. ```python from sentence_transformers import CrossEncoder # Download from the 🤗 Hub model = CrossEncoder("software-si/kitchen-it-nli-deberta") # Get scores for pairs of texts pairs = [ ['How many calories in an egg', 'There are on average between 55 and 80 calories in an egg depending on its size.'], ['How many calories in an egg', 'Egg whites are very low in calories, have no fat, no cholesterol, and are loaded with protein.'], ['How many calories in an egg', 'Most of the calories in an egg come from the yellow yolk in the center.'], ] scores = model.predict(pairs) print(scores.shape) # (3, 3) ``` ## Training Details ### Framework Versions - Python: 3.12.3 - Sentence Transformers: 5.1.1 - Transformers: 4.56.2 - PyTorch: 2.8.0+cu128 - Accelerate: 1.10.1 - Datasets: 4.1.1 - Tokenizers: 0.22.1 ## Citation ### BibTeX