rohin30n commited on
Commit
72e3698
·
verified ·
1 Parent(s): 12db39a

Upload trained classifier model

Browse files
README.md ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Finance Classifier Model
2
+
3
+ This directory contains the fine-tuned mBERT model for binary financial conversation classification.
4
+
5
+ ## Model Files
6
+
7
+ The model directory should contain:
8
+ - `config.json` - Model configuration
9
+ - `tokenizer_config.json` - Tokenizer configuration
10
+ - `special_tokens_map.json` - Special tokens mapping
11
+ - `pytorch_model.bin` - Trained model weights (generated by training)
12
+
13
+ ## Training
14
+
15
+ To generate the trained model, run:
16
+
17
+ ```bash
18
+ cd nlp/
19
+ python train_classifier.py
20
+ ```
21
+
22
+ This will:
23
+ 1. Load training data from `../classifier_training.json`
24
+ 2. Fine-tune bert-base-multilingual-cased on financial vs non-financial classification
25
+ 3. Save the trained model to this directory
26
+
27
+ ## Model Details
28
+
29
+ - **Base Model**: bert-base-multilingual-cased
30
+ - **Task**: Binary Classification (financial: 1, non-financial: 0)
31
+ - **Input**: Text sentences
32
+ - **Languages**: Multilingual support
33
+ - **Training File**: `classifier_training.json`
34
+
35
+ ## Usage
36
+
37
+ ```python
38
+ from nlp.classifier import FinanceClassifier
39
+
40
+ clf = FinanceClassifier()
41
+ result = clf.predict("Loan lena chahiye")
42
+ print(result) # {'prediction': 'financial', 'confidence': 0.95}
43
+ ```
config.json ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_cross_attention": false,
3
+ "architectures": [
4
+ "BertForSequenceClassification"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "bos_token_id": null,
8
+ "classifier_dropout": null,
9
+ "directionality": "bidi",
10
+ "dtype": "float32",
11
+ "eos_token_id": null,
12
+ "hidden_act": "gelu",
13
+ "hidden_dropout_prob": 0.1,
14
+ "hidden_size": 768,
15
+ "initializer_range": 0.02,
16
+ "intermediate_size": 3072,
17
+ "is_decoder": false,
18
+ "layer_norm_eps": 1e-12,
19
+ "max_position_embeddings": 512,
20
+ "model_type": "bert",
21
+ "num_attention_heads": 12,
22
+ "num_hidden_layers": 12,
23
+ "pad_token_id": 0,
24
+ "pooler_fc_size": 768,
25
+ "pooler_num_attention_heads": 12,
26
+ "pooler_num_fc_layers": 3,
27
+ "pooler_size_per_head": 128,
28
+ "pooler_type": "first_token_transform",
29
+ "problem_type": "single_label_classification",
30
+ "tie_word_embeddings": true,
31
+ "transformers_version": "5.4.0",
32
+ "type_vocab_size": 2,
33
+ "use_cache": true,
34
+ "vocab_size": 119547
35
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b328ed5a5e4708054b12a9e20397f37358f943f6d5956a251029d24848e7134b
3
+ size 711443432
special_tokens_map.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "[CLS]",
3
+ "cls_token": "[CLS]",
4
+ "eos_token": "[SEP]",
5
+ "mask_token": "[MASK]",
6
+ "pad_token": "[PAD]",
7
+ "sep_token": "[SEP]",
8
+ "unk_token": "[UNK]"
9
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "backend": "tokenizers",
3
+ "cls_token": "[CLS]",
4
+ "do_lower_case": false,
5
+ "is_local": false,
6
+ "mask_token": "[MASK]",
7
+ "model_max_length": 512,
8
+ "pad_token": "[PAD]",
9
+ "sep_token": "[SEP]",
10
+ "strip_accents": null,
11
+ "tokenize_chinese_chars": true,
12
+ "tokenizer_class": "BertTokenizer",
13
+ "unk_token": "[UNK]"
14
+ }