stanfordnlp/imdb
Viewer โข Updated โข 100k โข 177k โข 472
How to use Rugs25/simple-sentiment-analyzer with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="Rugs25/simple-sentiment-analyzer") # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("Rugs25/simple-sentiment-analyzer")
model = AutoModelForSequenceClassification.from_pretrained("Rugs25/simple-sentiment-analyzer", device_map="auto")# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("Rugs25/simple-sentiment-analyzer")
model = AutoModelForSequenceClassification.from_pretrained("Rugs25/simple-sentiment-analyzer", device_map="auto")๐ This is a sentiment analysis model trained to classify text as Positive or Negative.
config.jsonmodel.safetensorstokenizer.jsontokenizer_config.jsonspecial_tokens_map.jsonvocab.txtfrom transformers import pipeline
classifier = pipeline("sentiment-analysis", model="Rugs25/simple-sentiment-analyzer")
print(classifier("I love Hugging Face!")) # โ POSITIVE
print(classifier("This is terrible.")) # โ NEGATIVE
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="Rugs25/simple-sentiment-analyzer")