Instructions to use banjtheman/distilbert-base-uncased-helpful-amazon with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use banjtheman/distilbert-base-uncased-helpful-amazon with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="banjtheman/distilbert-base-uncased-helpful-amazon")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("banjtheman/distilbert-base-uncased-helpful-amazon") model = AutoModelForSequenceClassification.from_pretrained("banjtheman/distilbert-base-uncased-helpful-amazon") - Notebooks
- Google Colab
- Kaggle
Overview
This model was trained with data from https://registry.opendata.aws/helpful-sentences-from-reviews/ to predict how "helpful" a review is.
The model was fine-tuned from the distilbert-base-uncased model
Labels
LABEL_0 - Not helpful
LABEL_1 - Helpful
How to use
The following code shows how to make a prediction with this model
from transformers import (
AutoTokenizer,
AutoModelForSequenceClassification,
TextClassificationPipeline,
)
tokenizer = AutoTokenizer.from_pretrained("banjtheman/distilbert-base-uncased-helpful-amazon")
model = AutoModelForSequenceClassification.from_pretrained(
"banjtheman/distilbert-base-uncased-helpful-amazon"
)
pipe = TextClassificationPipeline(model=model, tokenizer=tokenizer)
result = pipe("This was a Christmas gift for my grandson.")
print(result)
#[{'label': 'LABEL_0', 'score': 0.998775064945221}]
# This is NOT A HELPFUL comment
- Downloads last month
- 7