Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
@@ -1,212 +1,67 @@
|
|
1 |
-
---
|
2 |
-
library_name: transformers
|
3 |
-
license: cc-by-sa-4.0
|
4 |
-
tags:
|
5 |
-
- text-classification
|
6 |
-
- incoherence
|
7 |
-
- text
|
8 |
-
model_info: A custom fine-tuned model for classifying text as incoherent or coherent.
|
9 |
-
description: This is a DistilBERT model fine-tuned to classify text based on its coherence.
|
10 |
-
The model can identify various types of incoherence, such as grammatical errors,
|
11 |
-
word soup, random words, and run-on sentences.
|
12 |
-
usage: This model can be used for text classification tasks, specifically for detecting
|
13 |
-
and categorizing different types of text incoherence.
|
14 |
-
limitations: The model has been trained on a generated dataset, so care must be taken
|
15 |
-
in evaluating it in the real world. More data may need to be collected before evaluating
|
16 |
-
this model in a real-world setting.
|
17 |
-
---
|
18 |
-
|
19 |
-
# Model Card for Model ID
|
20 |
-
|
21 |
-
<!-- Provide a quick summary of what the model is/does. -->
|
22 |
|
|
|
23 |
|
|
|
24 |
|
25 |
## Model Details
|
26 |
|
27 |
-
|
|
|
|
|
|
|
28 |
|
29 |
-
|
30 |
|
|
|
|
|
|
|
|
|
|
|
31 |
|
|
|
32 |
|
33 |
-
|
34 |
-
- **Funded by [optional]:** [More Information Needed]
|
35 |
-
- **Shared by [optional]:** [More Information Needed]
|
36 |
-
- **Model type:** [More Information Needed]
|
37 |
-
- **Language(s) (NLP):** [More Information Needed]
|
38 |
-
- **License:** cc-by-sa-4.0
|
39 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
40 |
|
41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
|
43 |
-
|
44 |
|
45 |
-
|
46 |
-
-
|
47 |
-
- **Demo [optional]:** [More Information Needed]
|
48 |
|
49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
|
51 |
-
|
|
|
|
|
|
|
52 |
|
53 |
-
|
54 |
|
55 |
-
|
56 |
|
57 |
-
|
58 |
|
59 |
-
|
60 |
|
61 |
-
|
62 |
|
63 |
-
|
64 |
|
65 |
-
|
66 |
|
67 |
-
|
68 |
|
69 |
-
|
70 |
-
|
71 |
-
## Bias, Risks, and Limitations
|
72 |
-
|
73 |
-
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
74 |
-
|
75 |
-
[More Information Needed]
|
76 |
-
|
77 |
-
### Recommendations
|
78 |
-
|
79 |
-
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
80 |
-
|
81 |
-
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
82 |
-
|
83 |
-
## How to Get Started with the Model
|
84 |
-
|
85 |
-
Use the code below to get started with the model.
|
86 |
-
|
87 |
-
[More Information Needed]
|
88 |
-
|
89 |
-
## Training Details
|
90 |
-
|
91 |
-
### Training Data
|
92 |
-
|
93 |
-
<!-- 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. -->
|
94 |
-
|
95 |
-
[More Information Needed]
|
96 |
-
|
97 |
-
### Training Procedure
|
98 |
-
|
99 |
-
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
100 |
-
|
101 |
-
#### Preprocessing [optional]
|
102 |
-
|
103 |
-
[More Information Needed]
|
104 |
-
|
105 |
-
|
106 |
-
#### Training Hyperparameters
|
107 |
-
|
108 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
109 |
-
|
110 |
-
#### Speeds, Sizes, Times [optional]
|
111 |
-
|
112 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
113 |
-
|
114 |
-
[More Information Needed]
|
115 |
-
|
116 |
-
## Evaluation
|
117 |
-
|
118 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
119 |
-
|
120 |
-
### Testing Data, Factors & Metrics
|
121 |
-
|
122 |
-
#### Testing Data
|
123 |
-
|
124 |
-
<!-- This should link to a Dataset Card if possible. -->
|
125 |
-
|
126 |
-
[More Information Needed]
|
127 |
-
|
128 |
-
#### Factors
|
129 |
-
|
130 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
131 |
-
|
132 |
-
[More Information Needed]
|
133 |
-
|
134 |
-
#### Metrics
|
135 |
-
|
136 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
137 |
-
|
138 |
-
[More Information Needed]
|
139 |
-
|
140 |
-
### Results
|
141 |
-
|
142 |
-
[More Information Needed]
|
143 |
-
|
144 |
-
#### Summary
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
## Model Examination [optional]
|
149 |
-
|
150 |
-
<!-- Relevant interpretability work for the model goes here -->
|
151 |
-
|
152 |
-
[More Information Needed]
|
153 |
-
|
154 |
-
## Environmental Impact
|
155 |
-
|
156 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
157 |
-
|
158 |
-
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).
|
159 |
-
|
160 |
-
- **Hardware Type:** [More Information Needed]
|
161 |
-
- **Hours used:** [More Information Needed]
|
162 |
-
- **Cloud Provider:** [More Information Needed]
|
163 |
-
- **Compute Region:** [More Information Needed]
|
164 |
-
- **Carbon Emitted:** [More Information Needed]
|
165 |
-
|
166 |
-
## Technical Specifications [optional]
|
167 |
-
|
168 |
-
### Model Architecture and Objective
|
169 |
-
|
170 |
-
[More Information Needed]
|
171 |
-
|
172 |
-
### Compute Infrastructure
|
173 |
-
|
174 |
-
[More Information Needed]
|
175 |
-
|
176 |
-
#### Hardware
|
177 |
-
|
178 |
-
[More Information Needed]
|
179 |
-
|
180 |
-
#### Software
|
181 |
-
|
182 |
-
[More Information Needed]
|
183 |
-
|
184 |
-
## Citation [optional]
|
185 |
-
|
186 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
187 |
-
|
188 |
-
**BibTeX:**
|
189 |
-
|
190 |
-
[More Information Needed]
|
191 |
-
|
192 |
-
**APA:**
|
193 |
-
|
194 |
-
[More Information Needed]
|
195 |
-
|
196 |
-
## Glossary [optional]
|
197 |
-
|
198 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
199 |
-
|
200 |
-
[More Information Needed]
|
201 |
-
|
202 |
-
## More Information [optional]
|
203 |
-
|
204 |
-
[More Information Needed]
|
205 |
-
|
206 |
-
## Model Card Authors [optional]
|
207 |
-
|
208 |
-
[More Information Needed]
|
209 |
-
|
210 |
-
## Model Card Contact
|
211 |
-
|
212 |
-
[More Information Needed]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
|
2 |
+
# DistilBERT Incoherence Classifier
|
3 |
|
4 |
+
This is a fine-tuned DistilBERT model for classifying text based on its coherence. It can identify various types of incoherence.
|
5 |
|
6 |
## Model Details
|
7 |
|
8 |
+
- **Model:** DistilBERT (distilbert-base-uncased)
|
9 |
+
- **Task:** Text Classification (Coherence Detection)
|
10 |
+
- **Fine-tuning:** The model was fine-tuned using a custom-generated dataset that features various types of incoherence.
|
11 |
+
- **Training Dataset** The model was trained on the [incoherent-text-dataset](https://huggingface.co/datasets/your_huggingface_username/incoherent-text-dataset) dataset, located on Huggingface.
|
12 |
|
13 |
+
## Training Metrics
|
14 |
|
15 |
+
| Epoch | Training Loss | Validation Loss | Accuracy | Precision | Recall | F1 |
|
16 |
+
| :---- | :------------ | :-------------- | :------- | :-------- | :----- | :------- |
|
17 |
+
| 1 | 0.037500 | 0.071958 | 0.984995 | 0.985002 | 0.984995 | 0.984564 |
|
18 |
+
| 2 | 0.008900 | 0.068670 | 0.985995 | 0.985973 | 0.985995 | 0.985603 |
|
19 |
+
| 3 | 0.008500 | 0.058111 | 0.990330 | 0.990260 | 0.990330 | 0.990262 |
|
20 |
|
21 |
+
## Evaluation Metrics
|
22 |
|
23 |
+
The following metrics were measured on the test set:
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
|
25 |
+
| Metric | Value |
|
26 |
+
| :---------- | :------- |
|
27 |
+
| Loss | 0.049511 |
|
28 |
+
| Accuracy | 0.991 |
|
29 |
+
| Precision | 0.990958 |
|
30 |
+
| Recall | 0.991 |
|
31 |
+
| F1-Score | 0.990962 |
|
32 |
|
33 |
+
## Classification Report:
|
34 |
|
35 |
+
```
|
36 |
+
precision recall f1-score support
|
|
|
37 |
|
38 |
+
coherent 0.99 0.99 0.99 1500
|
39 |
+
grammatical_errors 0.96 0.94 0.95 250
|
40 |
+
random_bytes 1.00 1.00 1.00 250
|
41 |
+
random_tokens 1.00 1.00 1.00 250
|
42 |
+
random_words 1.00 1.00 1.00 250
|
43 |
+
run_on 1.00 0.99 1.00 250
|
44 |
+
word_soup 1.00 1.00 1.00 250
|
45 |
|
46 |
+
accuracy 0.99 3000
|
47 |
+
macro avg 0.99 0.99 0.99 3000
|
48 |
+
weighted avg 0.99 0.99 0.99 3000
|
49 |
+
```
|
50 |
|
51 |
+
## Confusion Matrix
|
52 |
|
53 |
+

|
54 |
|
55 |
+
The confusion matrix above shows the performance of the model on each class.
|
56 |
|
57 |
+
## Usage
|
58 |
|
59 |
+
This model can be used for text classification tasks, specifically for detecting and categorizing different types of text incoherence. You can use the `inference_example` function provided in the notebook to test your own text.
|
60 |
|
61 |
+
## Limitations
|
62 |
|
63 |
+
The model has been trained on a generated dataset, so care must be taken in evaluating it in the real world. More data may need to be collected before evaluating this model in a real-world setting.
|
64 |
|
65 |
+
## License
|
66 |
|
67 |
+
CC-BY-SA 4.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|