Update README.md
Browse files
README.md
CHANGED
|
@@ -10,24 +10,31 @@ tags:
|
|
| 10 |
- bert
|
| 11 |
---
|
| 12 |
|
| 13 |
-
Model Description
|
| 14 |
|
| 15 |
-
This model predicts the star rating (1-5) of a Yelp review based on its text content. It was trained using GPT-2 and BERT, with BERT achieving the best performance at 75% validation accuracy. The model addresses class imbalance using weighted loss and optimizes hyperparameters to enhance generalization.
|
| 16 |
|
| 17 |
-
Training Details
|
| 18 |
|
| 19 |
-
Dataset: Yelp Reviews dataset (100,000 samples used)
|
| 20 |
|
| 21 |
-
Preprocessing:
|
| 22 |
|
| 23 |
-
GPT-2 Tokenizer with Byte-Pair Encoding (BPE) for rare words
|
|
|
|
| 24 |
|
| 25 |
-
|
| 26 |
|
| 27 |
-
|
| 28 |
|
| 29 |
-
|
| 30 |
|
| 31 |
-
|
| 32 |
|
| 33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
- bert
|
| 11 |
---
|
| 12 |
|
| 13 |
+
# **Model Description**
|
| 14 |
|
| 15 |
+
This model predicts the star rating (1 - 5) of a Yelp review based on its text content. It was trained using **GPT-2** and **BERT**, with **BERT** achieving the best performance at **75%** validation accuracy. The model addresses class imbalance using weighted loss and optimizes hyperparameters to enhance generalization.
|
| 16 |
|
| 17 |
+
# **Training Details**
|
| 18 |
|
| 19 |
+
- **Dataset**: Yelp Reviews dataset (100,000 samples used)
|
| 20 |
|
| 21 |
+
- **Preprocessing**:
|
| 22 |
|
| 23 |
+
- **GPT-2 Tokenizer** with **Byte-Pair Encoding (BPE)** for rare words
|
| 24 |
+
- Truncation (128 tokens) and padding for uniform input size
|
| 25 |
|
| 26 |
+
- **Models Trained**:
|
| 27 |
|
| 28 |
+
- **GPT-2**: Fine-tuned with a custom classification head, achieving **67% validation accuracy**
|
| 29 |
|
| 30 |
+
- **BERT**: Fine-tuned with bidirectional attention, achieving **75% validation accuracy**
|
| 31 |
|
| 32 |
+
- **Loss Function**: Weighted **Cross-Entropy Loss** to counteract class imbalance
|
| 33 |
|
| 34 |
+
# **Limitations**
|
| 35 |
+
|
| 36 |
+
- Performance may degrade on **highly informal or extremely short reviews**
|
| 37 |
+
|
| 38 |
+
- **Class imbalance** still affects predictions for underrepresented ratings
|
| 39 |
+
|
| 40 |
+
- Model was trained on **English-language** reviews only
|