Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
datasets:
|
3 |
+
- nhull/tripadvisor-split-dataset-v2
|
4 |
+
base_model:
|
5 |
+
- huawei-noah/TinyBERT_General_4L_312D
|
6 |
+
---
|
7 |
+
# TinyBERT Sentiment Analysis Model
|
8 |
+
|
9 |
+
This is a fine-tuned TinyBERT model for sentiment analysis on the Tripadvisor dataset.
|
10 |
+
|
11 |
+
## Model Details
|
12 |
+
- **Base Model**: `huawei-noah/TinyBERT_General_4L_312D`
|
13 |
+
- **Dataset**: `nhull/tripadvisor-split-dataset-v2`
|
14 |
+
- **Task**: Multiclass sentiment analysis (5 classes)
|
15 |
+
|
16 |
+
## Usage
|
17 |
+
|
18 |
+
```python
|
19 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
20 |
+
|
21 |
+
# Load the model
|
22 |
+
tokenizer = AutoTokenizer.from_pretrained("username/tinybert-sentiment-analysis")
|
23 |
+
model = AutoModelForSequenceClassification.from_pretrained("username/tinybert-sentiment-analysis")
|
24 |
+
|
25 |
+
# Predict sentiment
|
26 |
+
text = "The hotel was amazing and had great service!"
|
27 |
+
inputs = tokenizer(text, return_tensors="pt")
|
28 |
+
outputs = model(**inputs)
|
29 |
+
predicted_class = outputs.logits.argmax().item()
|
30 |
+
print(f"Predicted class: {predicted_class}")
|