humy65 commited on
Commit
27f24a2
·
1 Parent(s): 1fd581f

Update Hebrew Intent Model - Enhanced with data augmentation (135 examples)

Browse files
Files changed (6) hide show
  1. README.md +108 -166
  2. config.json +16 -15
  3. model.safetensors +2 -2
  4. tokenizer.json +0 -0
  5. tokenizer_config.json +7 -9
  6. vocab.txt +0 -0
README.md CHANGED
@@ -1,199 +1,141 @@
1
  ---
2
- library_name: transformers
3
- tags: []
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  ---
5
 
6
- # Model Card for Model ID
7
 
8
- <!-- Provide a quick summary of what the model is/does. -->
9
 
 
10
 
 
11
 
12
- ## Model Details
 
 
 
13
 
14
- ### Model Description
15
 
16
- <!-- Provide a longer summary of what this model is. -->
 
17
 
18
- This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
 
19
 
20
- - **Developed by:** [More Information Needed]
21
- - **Funded by [optional]:** [More Information Needed]
22
- - **Shared by [optional]:** [More Information Needed]
23
- - **Model type:** [More Information Needed]
24
- - **Language(s) (NLP):** [More Information Needed]
25
- - **License:** [More Information Needed]
26
- - **Finetuned from model [optional]:** [More Information Needed]
27
 
28
- ### Model Sources [optional]
 
 
 
 
 
29
 
30
- <!-- Provide the basic links for the model. -->
 
 
 
31
 
32
- - **Repository:** [More Information Needed]
33
- - **Paper [optional]:** [More Information Needed]
34
- - **Demo [optional]:** [More Information Needed]
35
 
36
- ## Uses
 
 
37
 
38
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
 
 
39
 
40
- ### Direct Use
 
 
 
 
 
 
 
 
 
 
 
 
41
 
42
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
43
-
44
- [More Information Needed]
45
-
46
- ### Downstream Use [optional]
47
-
48
- <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
49
-
50
- [More Information Needed]
51
-
52
- ### Out-of-Scope Use
53
-
54
- <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
55
-
56
- [More Information Needed]
57
-
58
- ## Bias, Risks, and Limitations
59
-
60
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
61
-
62
- [More Information Needed]
63
-
64
- ### Recommendations
65
-
66
- <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
67
-
68
- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
69
-
70
- ## How to Get Started with the Model
71
-
72
- Use the code below to get started with the model.
73
-
74
- [More Information Needed]
75
 
76
  ## Training Details
77
 
78
- ### Training Data
79
-
80
- <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
81
-
82
- [More Information Needed]
83
-
84
- ### Training Procedure
85
-
86
- <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
87
-
88
- #### Preprocessing [optional]
89
-
90
- [More Information Needed]
91
-
92
-
93
- #### Training Hyperparameters
94
-
95
- - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
96
-
97
- #### Speeds, Sizes, Times [optional]
98
-
99
- <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
100
-
101
- [More Information Needed]
102
-
103
- ## Evaluation
104
-
105
- <!-- This section describes the evaluation protocols and provides the results. -->
106
-
107
- ### Testing Data, Factors & Metrics
108
-
109
- #### Testing Data
110
-
111
- <!-- This should link to a Dataset Card if possible. -->
112
-
113
- [More Information Needed]
114
-
115
- #### Factors
116
-
117
- <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
118
-
119
- [More Information Needed]
120
-
121
- #### Metrics
122
-
123
- <!-- These are the evaluation metrics being used, ideally with a description of why. -->
124
-
125
- [More Information Needed]
126
-
127
- ### Results
128
-
129
- [More Information Needed]
130
-
131
- #### Summary
132
-
133
-
134
-
135
- ## Model Examination [optional]
136
-
137
- <!-- Relevant interpretability work for the model goes here -->
138
-
139
- [More Information Needed]
140
-
141
- ## Environmental Impact
142
-
143
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
144
-
145
- Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
146
-
147
- - **Hardware Type:** [More Information Needed]
148
- - **Hours used:** [More Information Needed]
149
- - **Cloud Provider:** [More Information Needed]
150
- - **Compute Region:** [More Information Needed]
151
- - **Carbon Emitted:** [More Information Needed]
152
-
153
- ## Technical Specifications [optional]
154
-
155
- ### Model Architecture and Objective
156
-
157
- [More Information Needed]
158
-
159
- ### Compute Infrastructure
160
-
161
- [More Information Needed]
162
-
163
- #### Hardware
164
-
165
- [More Information Needed]
166
-
167
- #### Software
168
-
169
- [More Information Needed]
170
-
171
- ## Citation [optional]
172
-
173
- <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
174
-
175
- **BibTeX:**
176
 
177
- [More Information Needed]
178
 
179
- **APA:**
 
 
 
 
 
180
 
181
- [More Information Needed]
182
 
183
- ## Glossary [optional]
 
 
 
184
 
185
- <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
186
 
187
- [More Information Needed]
 
 
 
188
 
189
- ## More Information [optional]
190
 
191
- [More Information Needed]
 
 
192
 
193
- ## Model Card Authors [optional]
194
 
195
- [More Information Needed]
 
 
 
 
 
 
 
 
196
 
197
- ## Model Card Contact
198
 
199
- [More Information Needed]
 
1
  ---
2
+ language: he
3
+ license: apache-2.0
4
+ datasets:
5
+ - custom
6
+ tags:
7
+ - text-classification
8
+ - intent-classification
9
+ - hebrew
10
+ - nlp
11
+ - bert
12
+ - customer-service
13
+ widget:
14
+ - text: "שכחתי את הסיסמה שלי"
15
+ example_title: "Password Reset"
16
+ - text: "רוצה לבטל את המנוי"
17
+ example_title: "Cancel Subscription"
18
+ - text: "כמה עולה החבילה"
19
+ example_title: "General Question"
20
+ - text: "האתר לא עובד"
21
+ example_title: "Technical Support"
22
  ---
23
 
24
+ # Hebrew Intent Classification Model
25
 
26
+ ## Model Description
27
 
28
+ This model is a fine-tuned BERT model for Hebrew intent classification, specifically designed for customer service scenarios. It can classify Hebrew text into 4 different intent categories commonly found in customer support interactions.
29
 
30
+ ## Supported Intent Classes
31
 
32
+ 1. **ביטול מנוי** (Cancel Subscription) - Requests to cancel or terminate services
33
+ 2. **שאלה כללית** (General Question) - General inquiries about services, pricing, or account management
34
+ 3. **שכחת סיסמה** (Password Reset) - Issues related to forgotten passwords or login problems
35
+ 4. **תמיכה טכנית** (Technical Support) - Technical issues, bugs, or system problems
36
 
37
+ ## Usage
38
 
39
+ ```python
40
+ from transformers import pipeline
41
 
42
+ # Load the model
43
+ classifier = pipeline("text-classification", model="Huggingm1r@n/hebrew-intent-classifier")
44
 
45
+ # Make predictions
46
+ result = classifier("שכחתי את הסיסמה שלי")
47
+ print(result)
48
+ # [{'label': 'שכחת סיסמה', 'score': 0.95}]
 
 
 
49
 
50
+ # Test other examples
51
+ examples = [
52
+ "רוצה לבטל את המנוי",
53
+ "כמה עולה החבילה",
54
+ "האתר לא עובד"
55
+ ]
56
 
57
+ for text in examples:
58
+ result = classifier(text)
59
+ print(f"'{text}' -> {result[0]['label']} ({result[0]['score']:.2%})")
60
+ ```
61
 
62
+ ## Direct Usage with Transformers
 
 
63
 
64
+ ```python
65
+ from transformers import AutoTokenizer, AutoModelForSequenceClassification
66
+ import torch
67
 
68
+ # Load model and tokenizer
69
+ tokenizer = AutoTokenizer.from_pretrained("Huggingm1r@n/hebrew-intent-classifier")
70
+ model = AutoModelForSequenceClassification.from_pretrained("Huggingm1r@n/hebrew-intent-classifier")
71
 
72
+ def predict_intent(text):
73
+ inputs = tokenizer(text, return_tensors="pt", padding=True, truncation=True)
74
+
75
+ with torch.no_grad():
76
+ outputs = model(**inputs)
77
+ logits = outputs.logits
78
+ probabilities = torch.softmax(logits, dim=-1)
79
+
80
+ predicted_id = torch.argmax(logits, dim=-1).item()
81
+ predicted_label = model.config.id2label[predicted_id]
82
+ confidence = probabilities[0][predicted_id].item()
83
+
84
+ return predicted_label, confidence
85
 
86
+ # Example
87
+ intent, confidence = predict_intent("שכחתי את הסיסמה")
88
+ print(f"Intent: {intent}, Confidence: {confidence:.2%}")
89
+ ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
 
91
  ## Training Details
92
 
93
+ - **Base Model**: bert-base-multilingual-cased
94
+ - **Training Data**: 135 Hebrew customer service examples (augmented from 12 original)
95
+ - **Data Augmentation**: Manual variations, formal/informal styles, polite forms
96
+ - **Performance**: >90% accuracy on validation set
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
 
98
+ ## Example Predictions
99
 
100
+ | Hebrew Text | Predicted Intent | English Translation |
101
+ |------------|------------------|-------------------|
102
+ | שכחתי את הסיסמה שלי | שכחת סיסמה | I forgot my password |
103
+ | רוצה לבטל את המנוי | ביטול מנוי | Want to cancel subscription |
104
+ | כמה עולה החבילה | שאלה כללית | How much does the package cost |
105
+ | האתר לא עובד | תמיכה טכנית | The website doesn't work |
106
 
107
+ ## Use Cases
108
 
109
+ - **Customer Service Chatbots**: Route Hebrew customer queries automatically
110
+ - **Support Ticket Classification**: Categorize support requests by intent
111
+ - **Voice of Customer Analysis**: Analyze Hebrew customer feedback
112
+ - **Automated Response Systems**: Trigger appropriate responses based on intent
113
 
114
+ ## Limitations
115
 
116
+ - Designed for customer service domain specifically
117
+ - Limited to 4 predefined intent classes
118
+ - May not work well with very informal Hebrew or slang
119
+ - Requires Hebrew text input
120
 
121
+ ## Model Files
122
 
123
+ - Uses `safetensors` format for secure model storage
124
+ - Compatible with latest Transformers library
125
+ - Includes comprehensive tokenizer configuration
126
 
127
+ ## Citation
128
 
129
+ ```bibtex
130
+ @misc{hebrew-intent-classifier-2025,
131
+ title={Hebrew Intent Classification Model for Customer Service},
132
+ author={Huggingm1r@n},
133
+ year={2025},
134
+ publisher={Hugging Face},
135
+ url={https://huggingface.co/Huggingm1r@n/hebrew-intent-classifier}
136
+ }
137
+ ```
138
 
139
+ ## License
140
 
141
+ This model is released under the Apache 2.0 License.
config.json CHANGED
@@ -4,27 +4,23 @@
4
  ],
5
  "attention_probs_dropout_prob": 0.1,
6
  "classifier_dropout": null,
7
- "gradient_checkpointing": false,
8
  "hidden_act": "gelu",
9
  "hidden_dropout_prob": 0.1,
10
  "hidden_size": 768,
11
  "id2label": {
12
- "0": "LABEL_0",
13
- "1": "LABEL_1",
14
- "2": "LABEL_2",
15
- "3": "LABEL_3",
16
- "4": "LABEL_4",
17
- "5": "LABEL_5"
18
  },
19
  "initializer_range": 0.02,
20
  "intermediate_size": 3072,
21
  "label2id": {
22
- "LABEL_0": 0,
23
- "LABEL_1": 1,
24
- "LABEL_2": 2,
25
- "LABEL_3": 3,
26
- "LABEL_4": 4,
27
- "LABEL_5": 5
28
  },
29
  "layer_norm_eps": 1e-12,
30
  "max_position_embeddings": 512,
@@ -32,11 +28,16 @@
32
  "num_attention_heads": 12,
33
  "num_hidden_layers": 12,
34
  "pad_token_id": 0,
 
 
 
 
 
35
  "position_embedding_type": "absolute",
 
36
  "torch_dtype": "float32",
37
- "total_flos": 6997313242916978688,
38
  "transformers_version": "4.55.0",
39
  "type_vocab_size": 2,
40
  "use_cache": true,
41
- "vocab_size": 30522
42
  }
 
4
  ],
5
  "attention_probs_dropout_prob": 0.1,
6
  "classifier_dropout": null,
7
+ "directionality": "bidi",
8
  "hidden_act": "gelu",
9
  "hidden_dropout_prob": 0.1,
10
  "hidden_size": 768,
11
  "id2label": {
12
+ "0": "\u05d1\u05d9\u05d8\u05d5\u05dc \u05de\u05e0\u05d5\u05d9",
13
+ "1": "\u05e9\u05d0\u05dc\u05d4 \u05db\u05dc\u05dc\u05d9\u05ea",
14
+ "2": "\u05e9\u05db\u05d7\u05ea \u05e1\u05d9\u05e1\u05de\u05d4",
15
+ "3": "\u05ea\u05de\u05d9\u05db\u05d4 \u05d8\u05db\u05e0\u05d9\u05ea"
 
 
16
  },
17
  "initializer_range": 0.02,
18
  "intermediate_size": 3072,
19
  "label2id": {
20
+ "\u05d1\u05d9\u05d8\u05d5\u05dc \u05de\u05e0\u05d5\u05d9": 0,
21
+ "\u05e9\u05d0\u05dc\u05d4 \u05db\u05dc\u05dc\u05d9\u05ea": 1,
22
+ "\u05e9\u05db\u05d7\u05ea \u05e1\u05d9\u05e1\u05de\u05d4": 2,
23
+ "\u05ea\u05de\u05d9\u05db\u05d4 \u05d8\u05db\u05e0\u05d9\u05ea": 3
 
 
24
  },
25
  "layer_norm_eps": 1e-12,
26
  "max_position_embeddings": 512,
 
28
  "num_attention_heads": 12,
29
  "num_hidden_layers": 12,
30
  "pad_token_id": 0,
31
+ "pooler_fc_size": 768,
32
+ "pooler_num_attention_heads": 12,
33
+ "pooler_num_fc_layers": 3,
34
+ "pooler_size_per_head": 128,
35
+ "pooler_type": "first_token_transform",
36
  "position_embedding_type": "absolute",
37
+ "problem_type": "single_label_classification",
38
  "torch_dtype": "float32",
 
39
  "transformers_version": "4.55.0",
40
  "type_vocab_size": 2,
41
  "use_cache": true,
42
+ "vocab_size": 119547
43
  }
model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:df68e41ee45a046376fa0f4bdb1026290747d5e9f1b87f9a96f252e73c751a8f
3
- size 437970952
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:63c09aefdfac2af07fab6891ac4a15b7e301300cf5732451bc6620d5401abbdf
3
+ size 711449608
tokenizer.json CHANGED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json CHANGED
@@ -8,7 +8,7 @@
8
  "single_word": false,
9
  "special": true
10
  },
11
- "1": {
12
  "content": "[UNK]",
13
  "lstrip": false,
14
  "normalized": false,
@@ -16,7 +16,7 @@
16
  "single_word": false,
17
  "special": true
18
  },
19
- "2": {
20
  "content": "[CLS]",
21
  "lstrip": false,
22
  "normalized": false,
@@ -24,7 +24,7 @@
24
  "single_word": false,
25
  "special": true
26
  },
27
- "3": {
28
  "content": "[SEP]",
29
  "lstrip": false,
30
  "normalized": false,
@@ -32,7 +32,7 @@
32
  "single_word": false,
33
  "special": true
34
  },
35
- "4": {
36
  "content": "[MASK]",
37
  "lstrip": false,
38
  "normalized": false,
@@ -41,14 +41,12 @@
41
  "special": true
42
  }
43
  },
44
- "clean_up_tokenization_spaces": true,
45
  "cls_token": "[CLS]",
46
- "do_basic_tokenize": true,
47
- "do_lower_case": true,
48
  "extra_special_tokens": {},
49
  "mask_token": "[MASK]",
50
- "model_max_length": 1000000000000000019884624838656,
51
- "never_split": null,
52
  "pad_token": "[PAD]",
53
  "sep_token": "[SEP]",
54
  "strip_accents": null,
 
8
  "single_word": false,
9
  "special": true
10
  },
11
+ "100": {
12
  "content": "[UNK]",
13
  "lstrip": false,
14
  "normalized": false,
 
16
  "single_word": false,
17
  "special": true
18
  },
19
+ "101": {
20
  "content": "[CLS]",
21
  "lstrip": false,
22
  "normalized": false,
 
24
  "single_word": false,
25
  "special": true
26
  },
27
+ "102": {
28
  "content": "[SEP]",
29
  "lstrip": false,
30
  "normalized": false,
 
32
  "single_word": false,
33
  "special": true
34
  },
35
+ "103": {
36
  "content": "[MASK]",
37
  "lstrip": false,
38
  "normalized": false,
 
41
  "special": true
42
  }
43
  },
44
+ "clean_up_tokenization_spaces": false,
45
  "cls_token": "[CLS]",
46
+ "do_lower_case": false,
 
47
  "extra_special_tokens": {},
48
  "mask_token": "[MASK]",
49
+ "model_max_length": 512,
 
50
  "pad_token": "[PAD]",
51
  "sep_token": "[SEP]",
52
  "strip_accents": null,
vocab.txt CHANGED
The diff for this file is too large to render. See raw diff