Update README.md
Browse files
README.md
CHANGED
@@ -1,12 +1,29 @@
|
|
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
|
@@ -15,185 +32,96 @@ tags: []
|
|
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 |
-
|
|
|
|
|
|
|
29 |
|
30 |
-
|
31 |
|
32 |
-
- **
|
33 |
-
- **
|
34 |
-
- **
|
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 |
-
|
43 |
-
|
44 |
-
[More Information Needed]
|
45 |
-
|
46 |
-
### Downstream Use [optional]
|
47 |
|
48 |
-
|
49 |
|
50 |
-
|
|
|
51 |
|
52 |
### Out-of-Scope Use
|
53 |
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
|
58 |
## Bias, Risks, and Limitations
|
59 |
|
60 |
-
|
61 |
|
62 |
-
|
|
|
63 |
|
64 |
### Recommendations
|
65 |
|
66 |
-
|
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 |
-
|
|
|
75 |
|
76 |
-
## Training Details
|
77 |
|
78 |
-
|
79 |
|
80 |
-
|
81 |
|
82 |
-
[
|
|
|
83 |
|
84 |
-
|
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 |
-
|
94 |
|
95 |
-
|
96 |
|
97 |
-
|
98 |
|
99 |
-
|
100 |
|
101 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
|
103 |
## Evaluation
|
104 |
|
105 |
-
|
106 |
|
107 |
-
|
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 |
-
|
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 |
library_name: transformers
|
3 |
+
tags:
|
4 |
+
- open data ma
|
5 |
+
- questions
|
6 |
+
- intents
|
7 |
+
- classification
|
8 |
+
- function calling
|
9 |
+
license: apache-2.0
|
10 |
+
language:
|
11 |
+
- fr
|
12 |
+
metrics:
|
13 |
+
- accuracy
|
14 |
+
pipeline_tag: text-classification
|
15 |
+
datasets:
|
16 |
+
- tferhan/Data_Gov_Ma_FAQ
|
17 |
+
base_model: almanach/camembert-base
|
18 |
---
|
19 |
|
20 |
# Model Card for Model ID
|
21 |
|
22 |
<!-- Provide a quick summary of what the model is/does. -->
|
23 |
+
This model is fine-tuned from the `camembert-base` model and is designed to classify user intent
|
24 |
+
questions for the website data.gov.ma in French. It can distinguish whether a user is making a general inquiry
|
25 |
+
or requesting specific data. The training data was generated using GPT-4o-mini and includes information specific
|
26 |
+
to data.gov.ma. The model was fine-tuned using LoRA with specific hyperparameters, achieving an accuracy of up to 0.98.
|
27 |
|
28 |
|
29 |
## Model Details
|
|
|
32 |
|
33 |
<!-- Provide a longer summary of what this model is. -->
|
34 |
|
|
|
35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
|
37 |
+
- **Developed by:** TFERHAN
|
38 |
+
- **Language:** French
|
39 |
+
- **License:** Apache 2.0
|
40 |
+
- **Finetuned from model:** camembert-base
|
41 |
|
42 |
+
## Use Case
|
43 |
|
44 |
+
- **Purpose:** Classify user intent questions for the chatbot on the data.gov.ma website.
|
45 |
+
- **Languages:** French (optimized for), performs poorly on other languages.
|
46 |
+
- **Data Source:** Generated using GPT-4o-mini with data from data.gov.ma.
|
47 |
|
48 |
## Uses
|
49 |
|
|
|
|
|
50 |
### Direct Use
|
51 |
|
52 |
+
The model can be directly used to classify user intents in chatbot scenarios for the website data.gov.ma, distinguishing between general inquiries and data requests.
|
|
|
|
|
|
|
|
|
53 |
|
54 |
+
### Downstream Use
|
55 |
|
56 |
+
The model is particularly suited for applications involving the French language and can be integrated into larger chatbot systems or
|
57 |
+
fine-tuned further for similar tasks in different contexts.
|
58 |
|
59 |
### Out-of-Scope Use
|
60 |
|
61 |
+
- Misuse for different languages without fine-tuning.
|
62 |
+
- Applications that do not involve French language queries.
|
63 |
+
- Sensitive or highly critical applications without extensive validation.
|
64 |
|
65 |
## Bias, Risks, and Limitations
|
66 |
|
67 |
+
### Technical Limitations
|
68 |
|
69 |
+
- Performance may degrade significantly on languages other than French.
|
70 |
+
- Limited to intents related to general queries and data requests.
|
71 |
|
72 |
### Recommendations
|
73 |
|
74 |
+
- The model should be retrained or fine-tuned with appropriate data before deployment in non-French contexts.
|
75 |
+
- Continuous monitoring and evaluation should be conducted to ensure reliability and fairness.
|
|
|
76 |
|
77 |
## How to Get Started with the Model
|
78 |
|
79 |
+
Use the code snippet below to get started with the model:
|
80 |
|
81 |
+
```python
|
82 |
+
from transformers import pipeline
|
83 |
|
|
|
84 |
|
85 |
+
model_name = "tferhan/finetuned_camb_intents"
|
86 |
|
87 |
+
nlp_pipeline = pipeline("text-classification", model_name)
|
88 |
|
89 |
+
questions = ["qu'est ce que open data", "je veux les informations de l'eau potable"]
|
90 |
+
results = nlp_pipeline_class(questions)
|
91 |
|
92 |
+
for result in results:
|
93 |
+
print(result)
|
|
|
|
|
|
|
|
|
|
|
94 |
|
95 |
+
#{'label': 'LABEL_0', 'score': 0.9999700784683228} === general
|
96 |
+
#{'label': 'LABEL_1', 'score': 0.9994990825653076} === request_data
|
97 |
+
```
|
98 |
|
99 |
+
## Training Details
|
100 |
|
101 |
+
### Training Data
|
102 |
|
103 |
+
- **Data Source:** Generated using GPT-4o-mini with help from words and data from data.gov.ma.
|
104 |
|
105 |
+
### Training Procedure
|
106 |
|
107 |
+
- **Preprocessing:**
|
108 |
+
- Standard text preprocessing steps - tokenization, text cleaning, and normalization.
|
109 |
+
- **Training Hyperparameters:**
|
110 |
+
- Epochs: `10`
|
111 |
+
- Train Batch Size: `4`
|
112 |
+
- Eval Batch Size: `4`
|
113 |
+
- Learning Rate: `2e-5`
|
114 |
+
- Evaluation Strategy: `epoch`
|
115 |
+
- Weight Decay: `0.01`
|
116 |
+
- **Log History:** `log_history.json`
|
117 |
|
118 |
## Evaluation
|
119 |
|
120 |
+
### Testing Data & Metrics
|
121 |
|
122 |
+
- **Testing Data:** Subset of the generated data based on data.gov.ma.
|
123 |
+
- **Evaluation Metrics:** Accuracy.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
|
125 |
### Results
|
126 |
|
127 |
+
- **Maximum Accuracy:** 0.98%
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|