CoolFace
Modelpublic

harshithan/fb-post-classifier-roberta_v1

sourceHugging Facemitupdated 1y agoView on Hugging Face
0likes9downloads
README.md92 linesDownload Raw Back to root
1---2license: mit3language:4- en5metrics:6- f17- accuracy8base_model:9- cardiffnlp/twitter-roberta-base10datasets:11- custom12tags:13- facebook14- text-classification15- sentiment16- customer-support17- transformers18- roberta19- huggingface20- fine-tuned21model-index:22- name: fb-post-classifier-roberta23  results:24  - task:25      name: Text Classification26      type: text-classification27    dataset:28      name: Facebook Posts (Appreciation / Complaint / Feedback)29      type: custom30    metrics:31    - name: F132      type: f133      value: 0.897934library_name: transformers35pipeline_tag: text-classification36---37# Facebook Post Classifier (RoBERTa Base, fine-tuned)38 39This model classifies short Facebook posts into **one** of the following **three mutually exclusive categories**:40- `Appreciation`41- `Complaint`42- `Feedback`43 44It is fine-tuned on ~8k manually labeled posts from business pages (e.g. Target, Walmart), based on the `cardiffnlp/twitter-roberta-base` model, which is pretrained on 58M tweets.45 46## ๐Ÿง  Intended Use47 48- Customer support automation49- Sentiment analysis on social media50- CRM pipelines or chatbot classification51 52## ๐Ÿ“Š Performance53 54| Class        | Precision | Recall | F1 Score |55|--------------|-----------|--------|----------|56| Appreciation | 0.906     | 0.936  | 0.921    |57| Complaint    | 0.931     | 0.902  | 0.916    |58| Feedback     | 0.840     | 0.874  | 0.857    |59| **Average**  | โ€“         | โ€“      | **0.898** |60 61> Evaluated on 2039 unseen posts with held-out labels using macro-averaged F1.62 63## ๐Ÿ› ๏ธ How to Use64 65```python66from transformers import AutoTokenizer, AutoModelForSequenceClassification67from torch.nn.functional import softmax68import torch69 70model = AutoModelForSequenceClassification.from_pretrained("harshithan/fb-post-classifier-roberta_v1")71tokenizer = AutoTokenizer.from_pretrained("harshithan/fb-post-classifier-roberta_v1")72 73inputs = tokenizer("I love the fast delivery!", return_tensors="pt")74outputs = model(**inputs)75probs = softmax(outputs.logits, dim=1)76 77label = torch.argmax(probs).item()78classes = ["Appreciation", "Complaint", "Feedback"]79print("Predicted:", classes[label])80```81 82## ๐Ÿงพ License83MIT License84 85## ๐Ÿ™‹โ€โ™€๏ธ Author86This model was fine-tuned by @harshithan.87 88## ๐Ÿ“š Academic Disclaimer89This model was developed as part of an academic experimentation project. It is intended solely for educational and research purposes.90The model has not been validated for production use and may not generalize to real-world Facebook or customer support data beyond the scope of the assignment.91 92