Downloads · 30 days
19
17% of all-time downloads
Neleac/yelp-review-classifier
yelp-review-classifier is a text classification model from Neleac. Use it when you need a label for a piece of text. It is set up for transformers.
<div align="center" <a href="https://github.com/Neleac/yelp-review-classifier" <img src="https://img.shields.io/badge/GitHub-Neleac/yelp--review--classifier-purple.svg" </a </div
Downloads · 30 days
19
17% of all-time downloads
All-time downloads
115
Public
Parameters
135M
541 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors541 MB · 100%
From the Hugging Face model README
This model takes the text from a Yelp review and predicts a label corresponding to the number of stars for the review. The labels are:
from transformers import AutoTokenizer, pipeline
# Load the base model tokenizer
tokenizer = AutoTokenizer.from_pretrained('tabularisai/multilingual-sentiment-analysis')
# Load the classification pipeline with the specified model
pipe = pipeline("text-classification", model="Neleac/yelp-review-classifier", tokenizer=tokenizer)
# Classify a new Yelp review
review = "This is by far my favorite Panera location in the Pittsburgh area. \
Friendly, plenty of room to sit, and good quality food & coffee. \
Panera is a great place to hang out and read the news - they even have free WiFi! \
Try their toasted sandwiches, especially the chicken bacon dijon."
result = pipe(review)
# Print the result
print(result) # [{'label': 'Very Positive', 'score': 0.7158929109573364}]