Update README.md
Browse files
README.md
CHANGED
|
@@ -33,4 +33,59 @@ model-index:
|
|
| 33 |
value: 0.8979
|
| 34 |
library_name: transformers
|
| 35 |
pipeline_tag: text-classification
|
| 36 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
value: 0.8979
|
| 34 |
library_name: transformers
|
| 35 |
pipeline_tag: text-classification
|
| 36 |
+
---
|
| 37 |
+
# Facebook Post Classifier (RoBERTa Base, fine-tuned)
|
| 38 |
+
|
| 39 |
+
This model classifies short Facebook posts into **one** of the following **three mutually exclusive categories**:
|
| 40 |
+
- `Appreciation`
|
| 41 |
+
- `Complaint`
|
| 42 |
+
- `Feedback`
|
| 43 |
+
|
| 44 |
+
It 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 Use
|
| 47 |
+
|
| 48 |
+
- Customer support automation
|
| 49 |
+
- Sentiment analysis on social media
|
| 50 |
+
- CRM pipelines or chatbot classification
|
| 51 |
+
|
| 52 |
+
## π Performance
|
| 53 |
+
|
| 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 Use
|
| 64 |
+
|
| 65 |
+
```python
|
| 66 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
| 67 |
+
from torch.nn.functional import softmax
|
| 68 |
+
import torch
|
| 69 |
+
|
| 70 |
+
model = AutoModelForSequenceClassification.from_pretrained("your-username/fb-post-classifier-roberta")
|
| 71 |
+
tokenizer = AutoTokenizer.from_pretrained("your-username/fb-post-classifier-roberta")
|
| 72 |
+
|
| 73 |
+
inputs = tokenizer("I love the fast delivery!", return_tensors="pt")
|
| 74 |
+
outputs = model(**inputs)
|
| 75 |
+
probs = softmax(outputs.logits, dim=1)
|
| 76 |
+
|
| 77 |
+
label = torch.argmax(probs).item()
|
| 78 |
+
classes = ["Appreciation", "Complaint", "Feedback"]
|
| 79 |
+
print("Predicted:", classes[label])
|
| 80 |
+
```
|
| 81 |
+
|
| 82 |
+
## π§Ύ License
|
| 83 |
+
MIT License
|
| 84 |
+
|
| 85 |
+
## πββοΈ Author
|
| 86 |
+
This model was fine-tuned by @harshithan.
|
| 87 |
+
|
| 88 |
+
## π Academic Disclaimer
|
| 89 |
+
This model was developed as part of an academic experimentation project. It is intended solely for educational and research purposes.
|
| 90 |
+
The 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 |
+
|