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