Views
No views yet
distilbert-base-uncased model1from transformers import (
2 AutoTokenizer,
3 AutoModelForSequenceClassification,
4 TextClassificationPipeline,
5)
6
7tokenizer = AutoTokenizer.from_pretrained("banjtheman/distilbert-base-uncased-helpful-amazon")
8
9model = AutoModelForSequenceClassification.from_pretrained(
10 "banjtheman/distilbert-base-uncased-helpful-amazon"
11)
12
13pipe = TextClassificationPipeline(model=model, tokenizer=tokenizer)
14
15result = pipe("This was a Christmas gift for my grandson.")
16
17print(result)
18
19#[{'label': 'LABEL_0', 'score': 0.998775064945221}]
20# This is NOT A HELPFUL comment
21