Instructions to use LiYuan/Amazon-Cross-Encoder-Classification with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LiYuan/Amazon-Cross-Encoder-Classification with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="LiYuan/Amazon-Cross-Encoder-Classification")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("LiYuan/Amazon-Cross-Encoder-Classification") model = AutoModelForSequenceClassification.from_pretrained("LiYuan/Amazon-Cross-Encoder-Classification") - Notebooks
- Google Colab
- Kaggle
File size: 1,008 Bytes
f999714 da03f59 f999714 37a4eb5 e7706e8 37a4eb5 e7706e8 37a4eb5 e7706e8 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | ---
license: afl-3.0
pipeline_tag: text-ranking
library_name: sentence-transformers
---
There are two types of Cross-Encoder models. One is the Cross-Encoder Regression model that we fine-tuned and mentioned in the previous section. Next, we have the Cross-Encoder Classification model. These two models are introduced in the same paper https://doi.org/10.48550/arxiv.1908.10084
Both models resolve the issue that the BERT model is too time-consuming and resource-consuming to train in pairwised sentences. These two model weights are initialized as the BERT and RoBERTa networks. We only need to fine-tune them, spending much less time to yield a comparable or even better sentence embedding. The below figure \ref{figure:5} shows the architecture of Cross-Encoder Classification.

Then we evaluated the model performance on the 2,000 held-out test set. We also got a test accuracy **46.05%** that is almost identical to the best validation accuracy, suggesting a good generalization model. |