Neleac's picture
Update README.md
9595ca7 verified
metadata
library_name: transformers
datasets:
  - Yelp/yelp_review_full
language:
  - en
metrics:
  - accuracy
base_model:
  - tabularisai/multilingual-sentiment-analysis
model-index:
  - name: Caelen
    results:
      - task:
          type: text-classification
        dataset:
          type: text-classification
          name: Yelp/yelp_review_full
        metrics:
          - name: accuracy
            type: text-classification
            value: 0.6772
            verified: false

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:

  • "Very Negative" = 1 star
  • "Negative" = 2 stars
  • "Neutral" = 3 stars
  • "Positive" = 4 stars
  • "Very Positive" = 5 stars

Example Inference Code:

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}]

Author Information:

👾 Discord
🐙 GitHub
🤝 LinkedIn