Downloads · 30 days
34
4% of all-time downloads
sllawlis/all-distilroberta-ce-esci
all-distilroberta-ce-esci is a text classification model from sllawlis. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
This is a cross-encoder model optimized for e-commerce text classification tasks.
Downloads · 30 days
34
4% of all-time downloads
All-time downloads
935
Public
Parameters
82.1M
657 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors328 MB · 99%
From the Hugging Face model README
This is a cross-encoder model optimized for e-commerce text classification tasks.
This is a fine-tuned cross-encoder model based on all-distilroberta-v1, trained on an e-commerce dataset of query-product pairs. The model predicts relevance classes in the ESCI (Exact, Substitute, Complementary, Irrelevant) framework by capturing the relationship of the input text and class labels, which can be used for multi-class classification tasks or more complex downstream tasks.
This model is designed for multi-class product classification within the ESCI framework. The model directly predicts one of the ESCI labels for a given query-product pair. This task is the foundation for downstream use cases.
The model's multi-class predictions can be used in the following downstream tasks:
Ranking Systems:
Product Substitute Identification:
Use the code below to get started with the model.
from transformers import AutoTokenizer, AutoModelForSequenceClassification
# Load the tokenizer and model
model_name = "sllawlis/distilroberta-ce-esci"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
Below is a quick usage example of this model.
# Example query-product pair
query = "wireless headphones"
product = "Noise-cancelling wireless headphones with long battery life"
# Tokenize inputs
inputs = tokenizer(
query,
product,
truncation=True,
padding=True,
return_tensors="pt"
)
# Predict relevance
outputs = model(**inputs)
predicted_class = outputs.logits.argmax(dim=1).item()
print(f"Predicted Class: {predicted_class}")
The model uses the pretrained all-distilroberta-v1.
The model is fine-tuned for multi-class relevance classification based on the ESCI framework. The fine-tuning process involves an input of query-product pairs, and an objective of classification using cross entropy loss to align predicted class probabilities with true labels.
Training was performed on a Tesla V100-PCIE-32GB GPU with a batch size of 32 over 3 epochs. The learning rate was set to 5e-5 and optimized using the AdamW optimizer, with 10% of the total training steps allocated for warm-up. Input sequences were padded to a max length of 512 tokens. Validation was conducted every ~10% of an epoch, and micro F1 score and accuracy were used to evaluate performance.
| Dataset | Paper | Number of training tuples |
|---|---|---|
| Amazon Shopping Queries Dataset | paper | 1,253,756 |