Text Classification
setfit
Safetensors
sentence-transformers
English
mpnet
generated_from_setfit_trainer
Eval Results (legacy)
text-embeddings-inference
Instructions to use CrisisNarratives/setfit-8classes-multi_label with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- setfit
How to use CrisisNarratives/setfit-8classes-multi_label with setfit:
from setfit import SetFitModel model = SetFitModel.from_pretrained("CrisisNarratives/setfit-8classes-multi_label") preds = model.predict(["i loved the spiderman movie!", "pineapple on pizza is the worst"]) print(preds) - sentence-transformers
How to use CrisisNarratives/setfit-8classes-multi_label with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("CrisisNarratives/setfit-8classes-multi_label") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -8,12 +8,18 @@ tags:
|
|
| 8 |
metrics:
|
| 9 |
- metric
|
| 10 |
widget:
|
| 11 |
-
- text:
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
- text:
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
pipeline_tag: text-classification
|
| 18 |
inference: false
|
| 19 |
base_model: sentence-transformers/paraphrase-mpnet-base-v2
|
|
@@ -29,320 +35,67 @@ model-index:
|
|
| 29 |
split: test
|
| 30 |
metrics:
|
| 31 |
- type: metric
|
| 32 |
-
value: 0.
|
| 33 |
name: Metric
|
| 34 |
---
|
| 35 |
|
| 36 |
-
#
|
| 37 |
|
| 38 |
-
|
| 39 |
|
| 40 |
-
|
| 41 |
|
| 42 |
-
|
| 43 |
-
2. Training a classification head with features from the fine-tuned Sentence Transformer.
|
| 44 |
-
|
| 45 |
-
## Model Details
|
| 46 |
-
|
| 47 |
-
### Model Description
|
| 48 |
-
- **Model Type:** SetFit
|
| 49 |
-
- **Sentence Transformer body:** [sentence-transformers/paraphrase-mpnet-base-v2](https://huggingface.co/sentence-transformers/paraphrase-mpnet-base-v2)
|
| 50 |
-
- **Classification head:** a ClassifierChain instance
|
| 51 |
-
- **Maximum Sequence Length:** 512 tokens
|
| 52 |
-
<!-- - **Number of Classes:** Unknown -->
|
| 53 |
-
<!-- - **Training Dataset:** [Unknown](https://huggingface.co/datasets/unknown) -->
|
| 54 |
-
<!-- - **Language:** Unknown -->
|
| 55 |
-
<!-- - **License:** Unknown -->
|
| 56 |
-
|
| 57 |
-
### Model Sources
|
| 58 |
-
|
| 59 |
-
- **Repository:** [SetFit on GitHub](https://github.com/huggingface/setfit)
|
| 60 |
-
- **Paper:** [Efficient Few-Shot Learning Without Prompts](https://arxiv.org/abs/2209.11055)
|
| 61 |
-
- **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
|
| 62 |
-
|
| 63 |
-
## Evaluation
|
| 64 |
-
|
| 65 |
-
### Metrics
|
| 66 |
-
| Label | Metric |
|
| 67 |
-
|:--------|:-------|
|
| 68 |
-
| **all** | 0.7340 |
|
| 69 |
-
|
| 70 |
-
## Uses
|
| 71 |
-
|
| 72 |
-
### Direct Use for Inference
|
| 73 |
-
|
| 74 |
-
First install the SetFit library:
|
| 75 |
-
|
| 76 |
-
```bash
|
| 77 |
-
pip install setfit
|
| 78 |
-
```
|
| 79 |
-
|
| 80 |
-
Then you can load this model and run inference.
|
| 81 |
-
|
| 82 |
-
```python
|
| 83 |
-
from setfit import SetFitModel
|
| 84 |
-
|
| 85 |
-
# Download from the 🤗 Hub
|
| 86 |
-
model = SetFitModel.from_pretrained("CrisisNarratives/setfit-8classes-multi_label")
|
| 87 |
-
# Run inference
|
| 88 |
-
preds = model("Im sorry.")
|
| 89 |
-
```
|
| 90 |
-
|
| 91 |
-
<!--
|
| 92 |
-
### Downstream Use
|
| 93 |
-
|
| 94 |
-
*List how someone could finetune this model on their own dataset.*
|
| 95 |
-
-->
|
| 96 |
-
|
| 97 |
-
<!--
|
| 98 |
-
### Out-of-Scope Use
|
| 99 |
-
|
| 100 |
-
*List how the model may foreseeably be misused and address what users ought not to do with the model.*
|
| 101 |
-
-->
|
| 102 |
-
|
| 103 |
-
<!--
|
| 104 |
-
## Bias, Risks and Limitations
|
| 105 |
-
|
| 106 |
-
*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
|
| 107 |
-
-->
|
| 108 |
|
| 109 |
-
|
| 110 |
-
### Recommendations
|
| 111 |
|
| 112 |
-
*
|
| 113 |
-
--
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 114 |
|
| 115 |
-
|
| 116 |
|
| 117 |
-
###
|
| 118 |
-
| Training set | Min | Median | Max |
|
| 119 |
-
|:-------------|:----|:--------|:-----|
|
| 120 |
-
| Word count | 1 | 25.3789 | 1681 |
|
| 121 |
|
| 122 |
-
|
| 123 |
-
-
|
| 124 |
-
- num_epochs: (3, 3)
|
| 125 |
-
- max_steps: -1
|
| 126 |
-
- sampling_strategy: oversampling
|
| 127 |
-
- num_iterations: 40
|
| 128 |
-
- body_learning_rate: (1.752e-05, 1.752e-05)
|
| 129 |
-
- head_learning_rate: 1.752e-05
|
| 130 |
-
- loss: CosineSimilarityLoss
|
| 131 |
-
- distance_metric: cosine_distance
|
| 132 |
-
- margin: 0.25
|
| 133 |
-
- end_to_end: False
|
| 134 |
-
- use_amp: False
|
| 135 |
-
- warmup_proportion: 0.1
|
| 136 |
-
- seed: 30
|
| 137 |
-
- eval_max_steps: -1
|
| 138 |
-
- load_best_model_at_end: False
|
| 139 |
|
| 140 |
-
###
|
| 141 |
-
| Epoch | Step | Training Loss | Validation Loss |
|
| 142 |
-
|:------:|:----:|:-------------:|:---------------:|
|
| 143 |
-
| 0.0004 | 1 | 0.4024 | - |
|
| 144 |
-
| 0.0185 | 50 | 0.2502 | - |
|
| 145 |
-
| 0.0370 | 100 | 0.2222 | - |
|
| 146 |
-
| 0.0555 | 150 | 0.2279 | - |
|
| 147 |
-
| 0.0739 | 200 | 0.2556 | - |
|
| 148 |
-
| 0.0924 | 250 | 0.2444 | - |
|
| 149 |
-
| 0.1109 | 300 | 0.2441 | - |
|
| 150 |
-
| 0.1294 | 350 | 0.2538 | - |
|
| 151 |
-
| 0.1479 | 400 | 0.2245 | - |
|
| 152 |
-
| 0.1664 | 450 | 0.2111 | - |
|
| 153 |
-
| 0.1848 | 500 | 0.1554 | - |
|
| 154 |
-
| 0.2033 | 550 | 0.1361 | - |
|
| 155 |
-
| 0.2218 | 600 | 0.1712 | - |
|
| 156 |
-
| 0.2403 | 650 | 0.1506 | - |
|
| 157 |
-
| 0.2588 | 700 | 0.1175 | - |
|
| 158 |
-
| 0.2773 | 750 | 0.0695 | - |
|
| 159 |
-
| 0.2957 | 800 | 0.0916 | - |
|
| 160 |
-
| 0.3142 | 850 | 0.0884 | - |
|
| 161 |
-
| 0.3327 | 900 | 0.0412 | - |
|
| 162 |
-
| 0.3512 | 950 | 0.1189 | - |
|
| 163 |
-
| 0.3697 | 1000 | 0.0485 | - |
|
| 164 |
-
| 0.3882 | 1050 | 0.1098 | - |
|
| 165 |
-
| 0.4067 | 1100 | 0.0303 | - |
|
| 166 |
-
| 0.4251 | 1150 | 0.0244 | - |
|
| 167 |
-
| 0.4436 | 1200 | 0.0429 | - |
|
| 168 |
-
| 0.4621 | 1250 | 0.034 | - |
|
| 169 |
-
| 0.4806 | 1300 | 0.0725 | - |
|
| 170 |
-
| 0.4991 | 1350 | 0.0438 | - |
|
| 171 |
-
| 0.5176 | 1400 | 0.0124 | - |
|
| 172 |
-
| 0.5360 | 1450 | 0.1603 | - |
|
| 173 |
-
| 0.5545 | 1500 | 0.1134 | - |
|
| 174 |
-
| 0.5730 | 1550 | 0.098 | - |
|
| 175 |
-
| 0.5915 | 1600 | 0.0343 | - |
|
| 176 |
-
| 0.6100 | 1650 | 0.0354 | - |
|
| 177 |
-
| 0.6285 | 1700 | 0.0892 | - |
|
| 178 |
-
| 0.6470 | 1750 | 0.0137 | - |
|
| 179 |
-
| 0.6654 | 1800 | 0.071 | - |
|
| 180 |
-
| 0.6839 | 1850 | 0.0317 | - |
|
| 181 |
-
| 0.7024 | 1900 | 0.0285 | - |
|
| 182 |
-
| 0.7209 | 1950 | 0.0311 | - |
|
| 183 |
-
| 0.7394 | 2000 | 0.0755 | - |
|
| 184 |
-
| 0.7579 | 2050 | 0.09 | - |
|
| 185 |
-
| 0.7763 | 2100 | 0.0565 | - |
|
| 186 |
-
| 0.7948 | 2150 | 0.0099 | - |
|
| 187 |
-
| 0.8133 | 2200 | 0.0236 | - |
|
| 188 |
-
| 0.8318 | 2250 | 0.0663 | - |
|
| 189 |
-
| 0.8503 | 2300 | 0.1391 | - |
|
| 190 |
-
| 0.8688 | 2350 | 0.0176 | - |
|
| 191 |
-
| 0.8872 | 2400 | 0.0645 | - |
|
| 192 |
-
| 0.9057 | 2450 | 0.0318 | - |
|
| 193 |
-
| 0.9242 | 2500 | 0.0186 | - |
|
| 194 |
-
| 0.9427 | 2550 | 0.0514 | - |
|
| 195 |
-
| 0.9612 | 2600 | 0.0261 | - |
|
| 196 |
-
| 0.9797 | 2650 | 0.0535 | - |
|
| 197 |
-
| 0.9982 | 2700 | 0.018 | - |
|
| 198 |
-
| 1.0166 | 2750 | 0.0218 | - |
|
| 199 |
-
| 1.0351 | 2800 | 0.0351 | - |
|
| 200 |
-
| 1.0536 | 2850 | 0.0704 | - |
|
| 201 |
-
| 1.0721 | 2900 | 0.0251 | - |
|
| 202 |
-
| 1.0906 | 2950 | 0.0156 | - |
|
| 203 |
-
| 1.1091 | 3000 | 0.0821 | - |
|
| 204 |
-
| 1.1275 | 3050 | 0.0273 | - |
|
| 205 |
-
| 1.1460 | 3100 | 0.0719 | - |
|
| 206 |
-
| 1.1645 | 3150 | 0.0496 | - |
|
| 207 |
-
| 1.1830 | 3200 | 0.0124 | - |
|
| 208 |
-
| 1.2015 | 3250 | 0.0576 | - |
|
| 209 |
-
| 1.2200 | 3300 | 0.0453 | - |
|
| 210 |
-
| 1.2384 | 3350 | 0.0236 | - |
|
| 211 |
-
| 1.2569 | 3400 | 0.013 | - |
|
| 212 |
-
| 1.2754 | 3450 | 0.0909 | - |
|
| 213 |
-
| 1.2939 | 3500 | 0.024 | - |
|
| 214 |
-
| 1.3124 | 3550 | 0.0264 | - |
|
| 215 |
-
| 1.3309 | 3600 | 0.0397 | - |
|
| 216 |
-
| 1.3494 | 3650 | 0.0484 | - |
|
| 217 |
-
| 1.3678 | 3700 | 0.0301 | - |
|
| 218 |
-
| 1.3863 | 3750 | 0.0512 | - |
|
| 219 |
-
| 1.4048 | 3800 | 0.0625 | - |
|
| 220 |
-
| 1.4233 | 3850 | 0.0583 | - |
|
| 221 |
-
| 1.4418 | 3900 | 0.0506 | - |
|
| 222 |
-
| 1.4603 | 3950 | 0.0561 | - |
|
| 223 |
-
| 1.4787 | 4000 | 0.0295 | - |
|
| 224 |
-
| 1.4972 | 4050 | 0.1352 | - |
|
| 225 |
-
| 1.5157 | 4100 | 0.0101 | - |
|
| 226 |
-
| 1.5342 | 4150 | 0.0221 | - |
|
| 227 |
-
| 1.5527 | 4200 | 0.057 | - |
|
| 228 |
-
| 1.5712 | 4250 | 0.0389 | - |
|
| 229 |
-
| 1.5896 | 4300 | 0.0173 | - |
|
| 230 |
-
| 1.6081 | 4350 | 0.0605 | - |
|
| 231 |
-
| 1.6266 | 4400 | 0.0187 | - |
|
| 232 |
-
| 1.6451 | 4450 | 0.0401 | - |
|
| 233 |
-
| 1.6636 | 4500 | 0.0571 | - |
|
| 234 |
-
| 1.6821 | 4550 | 0.0612 | - |
|
| 235 |
-
| 1.7006 | 4600 | 0.03 | - |
|
| 236 |
-
| 1.7190 | 4650 | 0.0299 | - |
|
| 237 |
-
| 1.7375 | 4700 | 0.0583 | - |
|
| 238 |
-
| 1.7560 | 4750 | 0.0279 | - |
|
| 239 |
-
| 1.7745 | 4800 | 0.027 | - |
|
| 240 |
-
| 1.7930 | 4850 | 0.0343 | - |
|
| 241 |
-
| 1.8115 | 4900 | 0.0634 | - |
|
| 242 |
-
| 1.8299 | 4950 | 0.0748 | - |
|
| 243 |
-
| 1.8484 | 5000 | 0.0699 | - |
|
| 244 |
-
| 1.8669 | 5050 | 0.0678 | - |
|
| 245 |
-
| 1.8854 | 5100 | 0.0724 | - |
|
| 246 |
-
| 1.9039 | 5150 | 0.0211 | - |
|
| 247 |
-
| 1.9224 | 5200 | 0.037 | - |
|
| 248 |
-
| 1.9409 | 5250 | 0.0891 | - |
|
| 249 |
-
| 1.9593 | 5300 | 0.0235 | - |
|
| 250 |
-
| 1.9778 | 5350 | 0.0339 | - |
|
| 251 |
-
| 1.9963 | 5400 | 0.029 | - |
|
| 252 |
-
| 2.0148 | 5450 | 0.1292 | - |
|
| 253 |
-
| 2.0333 | 5500 | 0.0457 | - |
|
| 254 |
-
| 2.0518 | 5550 | 0.0577 | - |
|
| 255 |
-
| 2.0702 | 5600 | 0.063 | - |
|
| 256 |
-
| 2.0887 | 5650 | 0.0198 | - |
|
| 257 |
-
| 2.1072 | 5700 | 0.0367 | - |
|
| 258 |
-
| 2.1257 | 5750 | 0.0475 | - |
|
| 259 |
-
| 2.1442 | 5800 | 0.0368 | - |
|
| 260 |
-
| 2.1627 | 5850 | 0.0401 | - |
|
| 261 |
-
| 2.1811 | 5900 | 0.0353 | - |
|
| 262 |
-
| 2.1996 | 5950 | 0.0387 | - |
|
| 263 |
-
| 2.2181 | 6000 | 0.0325 | - |
|
| 264 |
-
| 2.2366 | 6050 | 0.046 | - |
|
| 265 |
-
| 2.2551 | 6100 | 0.03 | - |
|
| 266 |
-
| 2.2736 | 6150 | 0.0338 | - |
|
| 267 |
-
| 2.2921 | 6200 | 0.0374 | - |
|
| 268 |
-
| 2.3105 | 6250 | 0.0206 | - |
|
| 269 |
-
| 2.3290 | 6300 | 0.031 | - |
|
| 270 |
-
| 2.3475 | 6350 | 0.0493 | - |
|
| 271 |
-
| 2.3660 | 6400 | 0.0182 | - |
|
| 272 |
-
| 2.3845 | 6450 | 0.0352 | - |
|
| 273 |
-
| 2.4030 | 6500 | 0.0622 | - |
|
| 274 |
-
| 2.4214 | 6550 | 0.0682 | - |
|
| 275 |
-
| 2.4399 | 6600 | 0.0227 | - |
|
| 276 |
-
| 2.4584 | 6650 | 0.0401 | - |
|
| 277 |
-
| 2.4769 | 6700 | 0.0348 | - |
|
| 278 |
-
| 2.4954 | 6750 | 0.0417 | - |
|
| 279 |
-
| 2.5139 | 6800 | 0.0232 | - |
|
| 280 |
-
| 2.5323 | 6850 | 0.0603 | - |
|
| 281 |
-
| 2.5508 | 6900 | 0.0981 | - |
|
| 282 |
-
| 2.5693 | 6950 | 0.0433 | - |
|
| 283 |
-
| 2.5878 | 7000 | 0.0187 | - |
|
| 284 |
-
| 2.6063 | 7050 | 0.0099 | - |
|
| 285 |
-
| 2.6248 | 7100 | 0.0276 | - |
|
| 286 |
-
| 2.6433 | 7150 | 0.0516 | - |
|
| 287 |
-
| 2.6617 | 7200 | 0.0211 | - |
|
| 288 |
-
| 2.6802 | 7250 | 0.0191 | - |
|
| 289 |
-
| 2.6987 | 7300 | 0.1152 | - |
|
| 290 |
-
| 2.7172 | 7350 | 0.0442 | - |
|
| 291 |
-
| 2.7357 | 7400 | 0.0226 | - |
|
| 292 |
-
| 2.7542 | 7450 | 0.0429 | - |
|
| 293 |
-
| 2.7726 | 7500 | 0.0313 | - |
|
| 294 |
-
| 2.7911 | 7550 | 0.0601 | - |
|
| 295 |
-
| 2.8096 | 7600 | 0.0156 | - |
|
| 296 |
-
| 2.8281 | 7650 | 0.039 | - |
|
| 297 |
-
| 2.8466 | 7700 | 0.0239 | - |
|
| 298 |
-
| 2.8651 | 7750 | 0.1159 | - |
|
| 299 |
-
| 2.8835 | 7800 | 0.0223 | - |
|
| 300 |
-
| 2.9020 | 7850 | 0.0442 | - |
|
| 301 |
-
| 2.9205 | 7900 | 0.0254 | - |
|
| 302 |
-
| 2.9390 | 7950 | 0.0268 | - |
|
| 303 |
-
| 2.9575 | 8000 | 0.0415 | - |
|
| 304 |
-
| 2.9760 | 8050 | 0.0235 | - |
|
| 305 |
-
| 2.9945 | 8100 | 0.0177 | - |
|
| 306 |
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
|
| 316 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 317 |
|
| 318 |
-
|
| 319 |
-
```bibtex
|
| 320 |
-
@article{https://doi.org/10.48550/arxiv.2209.11055,
|
| 321 |
-
doi = {10.48550/ARXIV.2209.11055},
|
| 322 |
-
url = {https://arxiv.org/abs/2209.11055},
|
| 323 |
-
author = {Tunstall, Lewis and Reimers, Nils and Jo, Unso Eun Seo and Bates, Luke and Korat, Daniel and Wasserblat, Moshe and Pereg, Oren},
|
| 324 |
-
keywords = {Computation and Language (cs.CL), FOS: Computer and information sciences, FOS: Computer and information sciences},
|
| 325 |
-
title = {Efficient Few-Shot Learning Without Prompts},
|
| 326 |
-
publisher = {arXiv},
|
| 327 |
-
year = {2022},
|
| 328 |
-
copyright = {Creative Commons Attribution 4.0 International}
|
| 329 |
-
}
|
| 330 |
-
```
|
| 331 |
|
| 332 |
-
|
| 333 |
-
## Glossary
|
| 334 |
|
| 335 |
-
|
| 336 |
-
-->
|
| 337 |
|
| 338 |
-
|
| 339 |
-
## Model Card Authors
|
| 340 |
|
| 341 |
-
|
| 342 |
-
-->
|
| 343 |
|
| 344 |
-
|
| 345 |
-
## Model Card Contact
|
| 346 |
|
| 347 |
-
|
| 348 |
-
-->
|
|
|
|
| 8 |
metrics:
|
| 9 |
- metric
|
| 10 |
widget:
|
| 11 |
+
- text: A combined 20 million people per year die of smoking and hunger, so authorities
|
| 12 |
+
can't seem to feed people and they allow you to buy cigarettes but we are facing
|
| 13 |
+
another lockdown for a virus that has a 99.5% survival rate!!! THINK PEOPLE. LOOK
|
| 14 |
+
AT IT LOGICALLY WITH YOUR OWN EYES.
|
| 15 |
+
- text: Scientists do not agree on the consequences of climate change, nor is there
|
| 16 |
+
any consensus on that subject. The predictions on that from are just ascientific
|
| 17 |
+
speculation. Bring on the warming."
|
| 18 |
+
- text: If Tam is our "top doctor"....I am going back to leaches and voodoo...just
|
| 19 |
+
as much science in that as the crap she spouts
|
| 20 |
+
- text: "Can she skip school by herself and sit infront of parliament? \r\n Fake emotions\
|
| 21 |
+
\ and just a good actor."
|
| 22 |
+
- text: my dad had huge ones..so they may be real..
|
| 23 |
pipeline_tag: text-classification
|
| 24 |
inference: false
|
| 25 |
base_model: sentence-transformers/paraphrase-mpnet-base-v2
|
|
|
|
| 35 |
split: test
|
| 36 |
metrics:
|
| 37 |
- type: metric
|
| 38 |
+
value: 0.688144336139226
|
| 39 |
name: Metric
|
| 40 |
---
|
| 41 |
|
| 42 |
+
# Computational Analysis of Communicative Acts for Understanding Crisis News Comment Discourses
|
| 43 |
|
| 44 |
+
The official trained models for **"Computational Analysis of Communicative Acts for Understanding Crisis News Comment Discourses"**.
|
| 45 |
|
| 46 |
+
This model is based on **SetFit** ([SetFit: Efficient Few-Shot Learning Without Prompts](https://arxiv.org/abs/2209.11055)) and uses the **sentence-transformers/paraphrase-mpnet-base-v2** pretrained model. It has been fine-tuned on our **crisis narratives dataset**.
|
| 47 |
|
| 48 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
|
| 50 |
+
### Model Information
|
|
|
|
| 51 |
|
| 52 |
+
- **Architecture:** SetFit with sentence-transformers/paraphrase-mpnet-base-v2
|
| 53 |
+
- **Task:** Multi-label classification for communicative act actions
|
| 54 |
+
- **Classes:**
|
| 55 |
+
- `informing statement`
|
| 56 |
+
- `challenge`
|
| 57 |
+
- `rejection`
|
| 58 |
+
- `appreciation`
|
| 59 |
+
- `request`
|
| 60 |
+
- `question`
|
| 61 |
+
- `acceptance`
|
| 62 |
+
- `apology`
|
| 63 |
|
| 64 |
+
---
|
| 65 |
|
| 66 |
+
### How to Use the Model
|
|
|
|
|
|
|
|
|
|
| 67 |
|
| 68 |
+
You can find the code to fine-tune this model and detailed instructions in the following GitHub repository:
|
| 69 |
+
[Acts in Crisis Narratives - SetFit Fine-Tuning Notebook](https://github.com/Aalto-CRAI-CIS/Acts-in-crisis-narratives/blob/main/few_shot_learning/SetFit.ipynb)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
|
| 71 |
+
#### Steps to Load and Use the Model:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
|
| 73 |
+
1. Install the SetFit library:
|
| 74 |
+
```bash
|
| 75 |
+
pip install setfit
|
| 76 |
+
```
|
| 77 |
+
|
| 78 |
+
2. Load the model and run inference:
|
| 79 |
+
```python
|
| 80 |
+
from setfit import SetFitModel
|
| 81 |
|
| 82 |
+
# Download from the 🤗 Hub
|
| 83 |
+
model = SetFitModel.from_pretrained("CrisisNarratives/setfit-8classes-multi_label")
|
| 84 |
+
|
| 85 |
+
# Run inference
|
| 86 |
+
preds = model("I'm sorry.")
|
| 87 |
+
```
|
| 88 |
|
| 89 |
+
For detailed instructions, refer to the GitHub repository linked above.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
|
| 91 |
+
---
|
|
|
|
| 92 |
|
| 93 |
+
### Citation
|
|
|
|
| 94 |
|
| 95 |
+
If you use this model in your work, please cite:
|
|
|
|
| 96 |
|
| 97 |
+
##### TO BE ADDED.
|
|
|
|
| 98 |
|
| 99 |
+
### Questions or Feedback?
|
|
|
|
| 100 |
|
| 101 |
+
For questions or feedback, please reach out via our [contact form](mailto:faezeghorbanpour96@example.com).
|
|
|