File size: 1,189 Bytes
72e3698 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | # Finance Classifier Model
This directory contains the fine-tuned mBERT model for binary financial conversation classification.
## Model Files
The model directory should contain:
- `config.json` - Model configuration
- `tokenizer_config.json` - Tokenizer configuration
- `special_tokens_map.json` - Special tokens mapping
- `pytorch_model.bin` - Trained model weights (generated by training)
## Training
To generate the trained model, run:
```bash
cd nlp/
python train_classifier.py
```
This will:
1. Load training data from `../classifier_training.json`
2. Fine-tune bert-base-multilingual-cased on financial vs non-financial classification
3. Save the trained model to this directory
## Model Details
- **Base Model**: bert-base-multilingual-cased
- **Task**: Binary Classification (financial: 1, non-financial: 0)
- **Input**: Text sentences
- **Languages**: Multilingual support
- **Training File**: `classifier_training.json`
## Usage
```python
from nlp.classifier import FinanceClassifier
clf = FinanceClassifier()
result = clf.predict("Loan lena chahiye")
print(result) # {'prediction': 'financial', 'confidence': 0.95}
```
|