Update README.md
Browse files
README.md
CHANGED
@@ -1,199 +1,105 @@
|
|
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 |
-
|
17 |
-
|
18 |
-
|
|
|
|
|
|
|
|
|
19 |
|
20 |
-
|
21 |
-
- **
|
22 |
-
- **
|
23 |
-
- **Model
|
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 |
-
|
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 |
-
|
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 |
-
|
|
|
|
|
|
|
|
|
73 |
|
74 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
|
76 |
## Training Details
|
77 |
|
78 |
### Training Data
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
[More Information Needed]
|
83 |
|
84 |
### Training Procedure
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
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 |
+
# Model Card for crpatel/mistral_prompt_tuning_tweet_classifier
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
## Model Details
|
4 |
|
5 |
### Model Description
|
6 |
+
This model is a fine-tuned version of Mistral, specifically trained for classifying tweets as complaints or non-complaints. The fine-tuning has been done using PEFT (Parameter-Efficient Fine-Tuning) and prompt tuning techniques. The model leverages the "ought/raft" dataset, specifically the "twitter_complaints" subset.
|
7 |
|
8 |
+
- **Developed by:** crpatel
|
9 |
+
- **Shared by [optional]:** crpatel
|
10 |
+
- **Model type:** Causal Language Model (Fine-tuned with PEFT)
|
11 |
+
- **Language(s) (NLP):** English
|
12 |
+
- **License:** Apache 2.0
|
13 |
+
- **Finetuned from model:** Mistral
|
14 |
+
- **Base Model Credit:** The base model, Mistral, was developed by [Mistral AI](https://mistral.ai/).
|
15 |
|
16 |
+
### Model Sources
|
17 |
+
- **Repository:** [Hugging Face Model Hub](https://huggingface.co/crpatel/mistral_prompt_tuning_tweet_classifier)
|
18 |
+
- **Dataset:** [RAFT - Twitter Complaints](https://huggingface.co/datasets/ought/raft)
|
19 |
+
- **Base Model:** [Mistral AI](https://mistral.ai/)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
## Uses
|
22 |
|
|
|
|
|
23 |
### Direct Use
|
24 |
+
This model can be used for classifying tweets as complaints or non-complaints, which can be useful for customer service automation, sentiment analysis, and social media monitoring.
|
25 |
|
26 |
+
### Downstream Use
|
27 |
+
The model can be fine-tuned further for other social media classification tasks or sentiment analysis applications in customer support systems.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
|
29 |
### Out-of-Scope Use
|
30 |
+
This model is not designed for general sentiment analysis outside of complaint detection. Misuse for legal or high-stakes decision-making without validation is discouraged.
|
|
|
|
|
|
|
31 |
|
32 |
## Bias, Risks, and Limitations
|
33 |
|
|
|
|
|
|
|
|
|
34 |
### Recommendations
|
35 |
+
- The model should be evaluated for biases before deployment.
|
36 |
+
- Users should verify results against human-labeled datasets.
|
37 |
+
- The model may not generalize well to tweets outside the training distribution.
|
|
|
38 |
|
39 |
## How to Get Started with the Model
|
40 |
|
41 |
+
```python
|
42 |
+
from peft import PeftModel, PeftConfig
|
43 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
44 |
+
from datasets import load_dataset
|
45 |
+
import torch
|
46 |
|
47 |
+
dataset = load_dataset("ought/raft", "twitter_complaints")
|
48 |
+
peft_model_id = "crpatel/mistral_prompt_tuning_tweet_classifier"
|
49 |
+
device = "cuda" if torch.cuda.is_available() else "cpu"
|
50 |
+
text_column = "Tweet text"
|
51 |
+
label_column = "text_label"
|
52 |
+
|
53 |
+
config = PeftConfig.from_pretrained(peft_model_id)
|
54 |
+
model = AutoModelForCausalLM.from_pretrained(config.base_model_name_or_path, torch_dtype=torch.float16).to(device)
|
55 |
+
model = PeftModel.from_pretrained(model, peft_model_id)
|
56 |
+
tokenizer = AutoTokenizer.from_pretrained(config.base_model_name_or_path)
|
57 |
+
```
|
58 |
|
59 |
## Training Details
|
60 |
|
61 |
### Training Data
|
62 |
+
- **Dataset:** Ought/RAFT - Twitter Complaints
|
63 |
+
- **Preprocessing:** Tokenization with AutoTokenizer
|
64 |
+
- **Filtering:** Preprocessing steps included lowercasing and cleaning tweet text
|
|
|
65 |
|
66 |
### Training Procedure
|
67 |
+
- **Optimization Algorithm:** AdamW
|
68 |
+
- **Precision:** FP16 for memory efficiency
|
69 |
+
- **Batch Size:** 16
|
70 |
+
- **Learning Rate:** 5e-5
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
|
72 |
### Model Architecture and Objective
|
73 |
+
The model is based on Mistral and fine-tuned using PEFT to optimize efficiency in tweet classification.
|
74 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
|
76 |
#### Software
|
77 |
+
- **Transformers Library:** 🤗 Transformers
|
78 |
+
- **Training Framework:** PyTorch
|
79 |
+
- **Fine-Tuning:** PEFT (Parameter-Efficient Fine-Tuning)
|
80 |
+
|
81 |
+
## Citation
|
82 |
+
If you use this model, please cite:
|
83 |
+
|
84 |
+
```bibtex
|
85 |
+
@article{crpatel2024,
|
86 |
+
author = {C.R. Patel},
|
87 |
+
title = {Mistral Prompt Tuning Tweet Classifier},
|
88 |
+
year = {2024},
|
89 |
+
publisher = {Hugging Face},
|
90 |
+
journal = {Hugging Face Model Hub}
|
91 |
+
}
|
92 |
+
```
|
93 |
+
|
94 |
+
Additionally, credit the base model:
|
95 |
+
|
96 |
+
```bibtex
|
97 |
+
@article{mistral2023,
|
98 |
+
author = {Mistral AI},
|
99 |
+
title = {Mistral Language Model},
|
100 |
+
year = {2023},
|
101 |
+
publisher = {Mistral AI},
|
102 |
+
journal = {Mistral AI Model Hub}
|
103 |
+
}
|
104 |
+
```
|
105 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|