Update README.md
Browse files
README.md
CHANGED
|
@@ -23,28 +23,11 @@ This model is a fine-tuned version of ParsBERT (HooshvareLab/bert-base-parsbert-
|
|
| 23 |
- **Language(s) (NLP):** Persian (fa)
|
| 24 |
- **License:** MIT
|
| 25 |
- **Finetuned from model:** HooshvareLab/bert-base-parsbert-uncased
|
| 26 |
-
### Model Sources
|
| 27 |
<!-- Provide the basic links for the model. -->
|
| 28 |
- **Repository:** https://github.com/ArefJafary/Persian-Emotion-Classification-BERT
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
## Uses
|
| 32 |
-
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
| 33 |
-
### Direct Use
|
| 34 |
-
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
| 35 |
-
The model can be used directly for inferring emotions from Persian text inputs, such as tweets or short messages, via the Hugging Face Transformers pipeline. It is suitable for applications in social media monitoring, customer feedback analysis, or psychological text analysis in Persian-speaking contexts.
|
| 36 |
-
### Downstream Use [optional]
|
| 37 |
-
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
|
| 38 |
-
The model can be further fine-tuned for specific downstream tasks like multi-label emotion detection or integrated into larger NLP systems for Persian language processing.
|
| 39 |
-
### Out-of-Scope Use
|
| 40 |
-
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
|
| 41 |
-
The model is not intended for use in non-Persian languages, multi-label classification, or real-time high-stakes applications without further validation. It may not perform well on formal Persian text, dialects, or noisy data beyond tweets. Misuse could include biased emotional profiling or surveillance without ethical considerations.
|
| 42 |
-
## Bias, Risks, and Limitations
|
| 43 |
-
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
| 44 |
-
The model may inherit biases from the training datasets, which are primarily sourced from social media (tweets), potentially reflecting cultural, demographic, or topical biases in Persian online content. It handles 6 emotions but may struggle with nuanced or mixed emotions. Performance is evaluated on a held-out set, but real-world generalization could vary. Class imbalance in emotions like HATE or SURPRISE might affect minority class predictions.
|
| 45 |
-
### Recommendations
|
| 46 |
-
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
| 47 |
-
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. Evaluate the model on your specific dataset before deployment. Consider debiasing techniques or additional data for underrepresented emotions. Use ethically and transparently, especially in sensitive applications.
|
| 48 |
## How to Get Started with the Model
|
| 49 |
Use the code below to get started with the model.
|
| 50 |
```python
|
|
@@ -74,7 +57,7 @@ The model was trained on a merged dataset from three Persian emotion corpora:
|
|
| 74 |
Datasets were standardized, cleaned (normalization with Parsivar, removal of URLs, mentions, emojis, etc.), deduplicated, and split into 90% train / 10% validation, with ArmanEmo held out for testing.
|
| 75 |
### Training Procedure
|
| 76 |
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
| 77 |
-
#### Preprocessing
|
| 78 |
Text was normalized using Parsivar, with character mapping, diacritic removal, and stripping of URLs, mentions, hashtags, emojis, punctuation, digits, and extra spaces. Multi-label instances in EmoPars were converted to single-label via dominant label.
|
| 79 |
#### Training Hyperparameters
|
| 80 |
- **Training regime:** fp32 (assumed, not specified)
|
|
@@ -84,8 +67,7 @@ Text was normalized using Parsivar, with character mapping, diacritic removal, a
|
|
| 84 |
- Optimizer: Not specified (default Hugging Face Trainer)
|
| 85 |
- Loss: Weighted cross-entropy to handle class imbalance
|
| 86 |
- Early stopping: After 2 epochs without validation loss improvement
|
| 87 |
-
|
| 88 |
-
Not specified.
|
| 89 |
## Evaluation
|
| 90 |
<!-- This section describes the evaluation protocols and provides the results. -->
|
| 91 |
### Testing Data, Factors & Metrics
|
|
@@ -107,7 +89,7 @@ Detailed per-class metrics and confusion matrix available in the repository.
|
|
| 107 |
The model shows robust performance on unseen Persian tweet data, with good generalization across emotions.
|
| 108 |
|
| 109 |
|
| 110 |
-
## Technical Specifications
|
| 111 |
### Model Architecture and Objective
|
| 112 |
BERT base model with a sequence classification head for multi-class emotion prediction.
|
| 113 |
#### Hardware
|
|
|
|
| 23 |
- **Language(s) (NLP):** Persian (fa)
|
| 24 |
- **License:** MIT
|
| 25 |
- **Finetuned from model:** HooshvareLab/bert-base-parsbert-uncased
|
| 26 |
+
### Model Sources
|
| 27 |
<!-- Provide the basic links for the model. -->
|
| 28 |
- **Repository:** https://github.com/ArefJafary/Persian-Emotion-Classification-BERT
|
| 29 |
+
|
| 30 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
## How to Get Started with the Model
|
| 32 |
Use the code below to get started with the model.
|
| 33 |
```python
|
|
|
|
| 57 |
Datasets were standardized, cleaned (normalization with Parsivar, removal of URLs, mentions, emojis, etc.), deduplicated, and split into 90% train / 10% validation, with ArmanEmo held out for testing.
|
| 58 |
### Training Procedure
|
| 59 |
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
| 60 |
+
#### Preprocessing
|
| 61 |
Text was normalized using Parsivar, with character mapping, diacritic removal, and stripping of URLs, mentions, hashtags, emojis, punctuation, digits, and extra spaces. Multi-label instances in EmoPars were converted to single-label via dominant label.
|
| 62 |
#### Training Hyperparameters
|
| 63 |
- **Training regime:** fp32 (assumed, not specified)
|
|
|
|
| 67 |
- Optimizer: Not specified (default Hugging Face Trainer)
|
| 68 |
- Loss: Weighted cross-entropy to handle class imbalance
|
| 69 |
- Early stopping: After 2 epochs without validation loss improvement
|
| 70 |
+
|
|
|
|
| 71 |
## Evaluation
|
| 72 |
<!-- This section describes the evaluation protocols and provides the results. -->
|
| 73 |
### Testing Data, Factors & Metrics
|
|
|
|
| 89 |
The model shows robust performance on unseen Persian tweet data, with good generalization across emotions.
|
| 90 |
|
| 91 |
|
| 92 |
+
## Technical Specifications
|
| 93 |
### Model Architecture and Objective
|
| 94 |
BERT base model with a sequence classification head for multi-class emotion prediction.
|
| 95 |
#### Hardware
|