botdevringring's picture
Update README.md
29a2719
metadata
language: en
datasets:
  - botdevringring/EN_Sentiment_3label_Dataset
widget:
  - text: The delivery man was late and my package was badly damaged
  - text: obviously, to sign the contract
  - text: Good service for a fair price. Friendly and attentive staff.
  - text: Call directly to make an appointment during the week
pipeline_tag: text-classification
tags:
  - DistilBert
  - Sentiment
  - Pytorch
metrics:
  - Accuracy, F1 Score
model-index:
  - name: botdevringring/en-naxai-ai-sentiment-classification-154012122023
    results:
      - task:
          type: text-classification
          name: Text Classification
        dataset:
          name: sentiment
          type: sentiment
          config: default
          split: test
        metrics:
          - type: accuracy
            value: 0.886
            name: Accuracy
            verified: true
          - type: loss
            value: 0.337
            name: loss
            verified: true
          - type: precision
            value: 0.827
            name: Precision Macro
            verified: true
          - type: precision
            value: 0.886
            name: Precision Micro
            verified: true
          - type: precision
            value: 0.88
            name: Precision Weighted
            verified: true
          - type: recall
            value: 0.777
            name: Recall Macro
            verified: true
          - type: recall
            value: 0.886
            name: Recall Micro
            verified: true
          - type: recall
            value: 0.886
            name: Recall Weighted
            verified: true
          - type: f1
            value: 0.794
            name: F1 Macro
            verified: true
          - type: f1
            value: 0.886
            name: F1 Micro
            verified: true
          - type: f1
            value: 0.881
            name: F1 Weighted
            verified: true
          - type: samples per second
            value: 179.335
            name: samples p/second
            verified: true
          - type: steps per second
            value: 22.432
            name: steps p/second
            verified: true
          - type: epochs
            value: 7
            name: epochs
            verified: true

en-naxai-ai-sentiment-classification-154012122023(latest)

The model is trained on the sentiment classification task in English. It uses 3 labels: -1, 0 and 1. These labels represent negative, neutral and positive sentiments.

This model is finetuned from DistilBERT base model (uncased). This model is a distilled version of the BERT base model. This model is uncased: it does not make a difference between english and English.

Model Details

  • Language: en
  • Problem type: Multi-class Classification
  • Model Architecture: Distilbert base uncased
  • Model Name: en-naxai-ai-sentiment-classification-154012122023
  • Creation date: 15:40h 12/12/2023
  • CO2 Emissions (in grams): 0.06

Classification Report:

Label Precision Recall f1-Score Support
-1 0.94 0.94 0.94 4870
0 0.58 0.59 0.59 867
1 0.91 0.90 0.91 2856

How to use this model

You can use Python to access this model:

from transformers import pipeline

analyzer = pipeline(
    task='text-classification',
    model=“botdevringring/en-naxai-ai-sentiment-classification-154012122023”,
    tokenizer="botdevringring/en-naxai-ai-sentiment-classification-154012122023"
)
result = analyzer(
    "Good service for a fair price. Friendly and attentive staff."
)

result

[{'label': '2', 'score': 0.515792965888977}]

Python API:

from transformers import AutoModelForSequenceClassification, AutoTokenizer

model = AutoModelForSequenceClassification.from_pretrained("botdevringring/en-naxai-ai-sentiment-classification-154012122023", use_auth_token=True)

tokenizer = AutoTokenizer.from_pretrained("botdevringring/en-naxai-ai-sentiment-classification-154012122023", use_auth_token=True)

inputs = tokenizer("Good service for a fair price. Friendly and attentive staff.", return_tensors="pt")

outputs = model(**inputs)

Or you can use cURL:

curl https://api-inference.huggingface.co/models/botdevringring/en-naxai-ai-sentiment-classification-154012122023 \
    -X POST \
    -d '{"inputs": "Good service for a fair price. Friendly and attentive staff."}' \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer <Your HF API token>"

Acknowledgements

Model trained by Eduardo Brigham for Naxai powered by The Ring Ring Company