SetFit Aspect Model
This is a SetFit model that can be used for Aspect Based Sentiment Analysis (ABSA). A LogisticRegression instance is used for classification. In particular, this model is in charge of filtering aspect span candidates.
The model has been trained using an efficient few-shot learning technique that involves:
- Fine-tuning a Sentence Transformer with contrastive learning.
- Training a classification head with features from the fine-tuned Sentence Transformer.
This model was trained within the context of a larger system for ABSA, which looks like so:
- Use a spaCy model to select possible aspect span candidates.
- Use this SetFit model to filter these possible aspect span candidates.
- Use a SetFit model to classify the filtered aspect span candidates.
Model Details
Model Description
- Model Type: SetFit
- Classification head: a LogisticRegression instance
- spaCy Model: id_core_news_trf
- SetFitABSA Aspect Model: Funnyworld1412/ABSA_game_squad_busters-aspect
- SetFitABSA Polarity Model: Funnyworld1412/ABSA_game_squad_busters-polarity
- Maximum Sequence Length: 512 tokens
- Number of Classes: 2 classes
Model Sources
- Repository: SetFit on GitHub
- Paper: Efficient Few-Shot Learning Without Prompts
- Blogpost: SetFit: Efficient Few-Shot Learning Without Prompts
Model Labels
Label | Examples |
---|---|
aspect |
|
no aspect |
|
Uses
Direct Use for Inference
First install the SetFit library:
pip install setfit
Then you can load this model and run inference.
from setfit import AbsaModel
# Download from the 🤗 Hub
model = AbsaModel.from_pretrained(
"Funnyworld1412/ABSA_game_squad_busters-aspect",
"Funnyworld1412/ABSA_game_squad_busters-polarity",
)
# Run inference
preds = model("The food was great, but the venue is just way too busy.")
Training Details
Training Set Metrics
Training set | Min | Median | Max |
---|---|---|---|
Word count | 6 | 42.9092 | 90 |
Label | Training Sample Count |
---|---|
no aspect | 2181 |
aspect | 506 |
Training Hyperparameters
- batch_size: (4, 4)
- num_epochs: (1, 1)
- max_steps: -1
- sampling_strategy: oversampling
- num_iterations: 10
- body_learning_rate: (2e-05, 1e-05)
- head_learning_rate: 0.01
- loss: CosineSimilarityLoss
- distance_metric: cosine_distance
- margin: 0.25
- end_to_end: False
- use_amp: False
- warmup_proportion: 0.1
- seed: 42
- eval_max_steps: -1
- load_best_model_at_end: False
Training Results
Epoch | Step | Training Loss | Validation Loss |
---|---|---|---|
0.0001 | 1 | 0.3499 | - |
0.0037 | 50 | 0.2258 | - |
0.0074 | 100 | 0.1438 | - |
0.0112 | 150 | 0.3667 | - |
0.0149 | 200 | 0.2931 | - |
0.0186 | 250 | 0.3144 | - |
0.0223 | 300 | 0.1334 | - |
0.0261 | 350 | 0.0919 | - |
0.0298 | 400 | 0.3432 | - |
0.0335 | 450 | 0.2318 | - |
0.0001 | 1 | 0.2543 | - |
0.0037 | 50 | 0.2765 | - |
0.0074 | 100 | 0.254 | - |
0.0112 | 150 | 0.0406 | - |
0.0149 | 200 | 0.0707 | - |
0.0186 | 250 | 0.0344 | - |
0.0223 | 300 | 0.0112 | - |
0.0261 | 350 | 0.4567 | - |
0.0298 | 400 | 0.2479 | - |
0.0335 | 450 | 0.0487 | - |
0.0372 | 500 | 0.1762 | - |
0.0409 | 550 | 0.1578 | - |
0.0447 | 600 | 0.319 | - |
0.0484 | 650 | 0.0443 | - |
0.0521 | 700 | 0.42 | - |
0.0558 | 750 | 0.1629 | - |
0.0595 | 800 | 0.2677 | - |
0.0633 | 850 | 0.0027 | - |
0.0670 | 900 | 0.2256 | - |
0.0707 | 950 | 0.0044 | - |
0.0744 | 1000 | 0.0248 | - |
0.0782 | 1050 | 0.0387 | - |
0.0819 | 1100 | 0.0129 | - |
0.0856 | 1150 | 0.0867 | - |
0.0893 | 1200 | 0.0801 | - |
0.0930 | 1250 | 0.1524 | - |
0.0968 | 1300 | 0.3153 | - |
0.1005 | 1350 | 0.1654 | - |
0.1042 | 1400 | 0.0051 | - |
0.1079 | 1450 | 0.0131 | - |
0.1116 | 1500 | 0.0052 | - |
0.1154 | 1550 | 0.0153 | - |
0.1191 | 1600 | 0.1445 | - |
0.1228 | 1650 | 0.0005 | - |
0.1265 | 1700 | 0.0021 | - |
0.1303 | 1750 | 0.3321 | - |
0.1340 | 1800 | 0.1726 | - |
0.1377 | 1850 | 0.3157 | - |
0.1414 | 1900 | 0.0264 | - |
0.1451 | 1950 | 0.2539 | - |
0.1489 | 2000 | 0.1556 | - |
0.1526 | 2050 | 0.0294 | - |
0.1563 | 2100 | 0.1472 | - |
0.1600 | 2150 | 0.0203 | - |
0.1638 | 2200 | 0.2612 | - |
0.1675 | 2250 | 0.0182 | - |
0.1712 | 2300 | 0.4155 | - |
0.1749 | 2350 | 0.0143 | - |
0.1786 | 2400 | 0.0013 | - |
0.1824 | 2450 | 0.36 | - |
0.1861 | 2500 | 0.2805 | - |
0.1898 | 2550 | 0.1571 | - |
0.1935 | 2600 | 0.0925 | - |
0.1972 | 2650 | 0.1762 | - |
0.2010 | 2700 | 0.2168 | - |
0.2047 | 2750 | 0.0002 | - |
0.2084 | 2800 | 0.0706 | - |
0.2121 | 2850 | 0.5384 | - |
0.2159 | 2900 | 0.0003 | - |
0.2196 | 2950 | 0.3476 | - |
0.2233 | 3000 | 0.0143 | - |
0.2270 | 3050 | 0.0052 | - |
0.2307 | 3100 | 0.1282 | - |
0.2345 | 3150 | 0.0004 | - |
0.2382 | 3200 | 0.0165 | - |
0.2419 | 3250 | 0.0077 | - |
0.2456 | 3300 | 0.011 | - |
0.2493 | 3350 | 0.0098 | - |
0.2531 | 3400 | 0.0104 | - |
0.2568 | 3450 | 0.0378 | - |
0.2605 | 3500 | 0.0294 | - |
0.2642 | 3550 | 0.1213 | - |
0.2680 | 3600 | 0.0 | - |
0.2717 | 3650 | 0.0021 | - |
0.2754 | 3700 | 0.0017 | - |
0.2791 | 3750 | 0.0273 | - |
0.2828 | 3800 | 0.012 | - |
0.2866 | 3850 | 0.008 | - |
0.2903 | 3900 | 0.0047 | - |
0.2940 | 3950 | 0.0034 | - |
0.2977 | 4000 | 0.0006 | - |
0.3015 | 4050 | 0.1756 | - |
0.3052 | 4100 | 0.1939 | - |
0.3089 | 4150 | 0.1627 | - |
0.3126 | 4200 | 0.0004 | - |
0.3163 | 4250 | 0.2098 | - |
0.3201 | 4300 | 0.002 | - |
0.3238 | 4350 | 0.2378 | - |
0.3275 | 4400 | 0.2552 | - |
0.3312 | 4450 | 0.0074 | - |
0.3349 | 4500 | 0.002 | - |
0.3387 | 4550 | 0.0152 | - |
0.3424 | 4600 | 0.0031 | - |
0.3461 | 4650 | 0.0684 | - |
0.3498 | 4700 | 0.0023 | - |
0.3536 | 4750 | 0.2301 | - |
0.3573 | 4800 | 0.0155 | - |
0.3610 | 4850 | 0.0774 | - |
0.3647 | 4900 | 0.0005 | - |
0.3684 | 4950 | 0.0013 | - |
0.3722 | 5000 | 0.055 | - |
0.3759 | 5050 | 0.006 | - |
0.3796 | 5100 | 0.0534 | - |
0.3833 | 5150 | 0.2006 | - |
0.3870 | 5200 | 0.2059 | - |
0.3908 | 5250 | 0.2467 | - |
0.3945 | 5300 | 0.0038 | - |
0.3982 | 5350 | 0.0004 | - |
0.4019 | 5400 | 0.0009 | - |
0.4057 | 5450 | 0.0002 | - |
0.4094 | 5500 | 0.2144 | - |
0.4131 | 5550 | 0.0623 | - |
0.4168 | 5600 | 0.0007 | - |
0.4205 | 5650 | 0.3073 | - |
0.4243 | 5700 | 0.0001 | - |
0.4280 | 5750 | 0.1286 | - |
0.4317 | 5800 | 0.179 | - |
0.4354 | 5850 | 0.2131 | - |
0.4392 | 5900 | 0.0005 | - |
0.4429 | 5950 | 0.1989 | - |
0.4466 | 6000 | 0.1981 | - |
0.4503 | 6050 | 0.0004 | - |
0.4540 | 6100 | 0.0001 | - |
0.4578 | 6150 | 0.4378 | - |
0.4615 | 6200 | 0.0008 | - |
0.4652 | 6250 | 0.1022 | - |
0.4689 | 6300 | 0.0002 | - |
0.4726 | 6350 | 0.0648 | - |
0.4764 | 6400 | 0.2756 | - |
0.4801 | 6450 | 0.1552 | - |
0.4838 | 6500 | 0.0524 | - |
0.4875 | 6550 | 0.2472 | - |
0.4913 | 6600 | 0.3239 | - |
0.4950 | 6650 | 0.1255 | - |
0.4987 | 6700 | 0.0293 | - |
0.5024 | 6750 | 0.0 | - |
0.5061 | 6800 | 0.001 | - |
0.5099 | 6850 | 0.0008 | - |
0.5136 | 6900 | 0.2881 | - |
0.5173 | 6950 | 0.0002 | - |
0.5210 | 7000 | 0.0008 | - |
0.5247 | 7050 | 0.1938 | - |
0.5285 | 7100 | 0.0965 | - |
0.5322 | 7150 | 0.1608 | - |
0.5359 | 7200 | 0.088 | - |
0.5396 | 7250 | 0.0003 | - |
0.5434 | 7300 | 0.0129 | - |
0.5471 | 7350 | 0.0027 | - |
0.5508 | 7400 | 0.0805 | - |
0.5545 | 7450 | 0.0059 | - |
0.5582 | 7500 | 0.2299 | - |
0.5620 | 7550 | 0.0042 | - |
0.5657 | 7600 | 0.0097 | - |
0.5694 | 7650 | 0.0 | - |
0.5731 | 7700 | 0.1738 | - |
0.5769 | 7750 | 0.0002 | - |
0.5806 | 7800 | 0.0003 | - |
0.5843 | 7850 | 0.0 | - |
0.5880 | 7900 | 0.0889 | - |
0.5917 | 7950 | 0.0769 | - |
0.5955 | 8000 | 0.0003 | - |
0.5992 | 8050 | 0.0 | - |
0.6029 | 8100 | 0.0003 | - |
0.6066 | 8150 | 0.0 | - |
0.6103 | 8200 | 0.0 | - |
0.6141 | 8250 | 0.0008 | - |
0.6178 | 8300 | 0.0002 | - |
0.6215 | 8350 | 0.0001 | - |
0.6252 | 8400 | 0.0004 | - |
0.6290 | 8450 | 0.0003 | - |
0.6327 | 8500 | 0.0052 | - |
0.6364 | 8550 | 0.1168 | - |
0.6401 | 8600 | 0.0029 | - |
0.6438 | 8650 | 0.0004 | - |
0.6476 | 8700 | 0.0003 | - |
0.6513 | 8750 | 0.0256 | - |
0.6550 | 8800 | 0.0473 | - |
0.6587 | 8850 | 0.0002 | - |
0.6624 | 8900 | 0.0001 | - |
0.6662 | 8950 | 0.0 | - |
0.6699 | 9000 | 0.0 | - |
0.6736 | 9050 | 0.0 | - |
0.6773 | 9100 | 0.1554 | - |
0.6811 | 9150 | 0.0002 | - |
0.6848 | 9200 | 0.037 | - |
0.6885 | 9250 | 0.0008 | - |
0.6922 | 9300 | 0.0 | - |
0.6959 | 9350 | 0.0247 | - |
0.6997 | 9400 | 0.0 | - |
0.7034 | 9450 | 0.2489 | - |
0.7071 | 9500 | 0.0266 | - |
0.7108 | 9550 | 0.0002 | - |
0.7146 | 9600 | 0.0001 | - |
0.7183 | 9650 | 0.029 | - |
0.7220 | 9700 | 0.0 | - |
0.7257 | 9750 | 0.0151 | - |
0.7294 | 9800 | 0.1482 | - |
0.7332 | 9850 | 0.023 | - |
0.7369 | 9900 | 0.0 | - |
0.7406 | 9950 | 0.0005 | - |
0.7443 | 10000 | 0.1778 | - |
0.7480 | 10050 | 0.0002 | - |
0.7518 | 10100 | 0.0002 | - |
0.7555 | 10150 | 0.0 | - |
0.7592 | 10200 | 0.0709 | - |
0.7629 | 10250 | 0.2704 | - |
0.7667 | 10300 | 0.3767 | - |
0.7704 | 10350 | 0.0 | - |
0.7741 | 10400 | 0.0177 | - |
0.7778 | 10450 | 0.0944 | - |
0.7815 | 10500 | 0.0421 | - |
0.7853 | 10550 | 0.0001 | - |
0.7890 | 10600 | 0.0001 | - |
0.7927 | 10650 | 0.0001 | - |
0.7964 | 10700 | 0.0003 | - |
0.8001 | 10750 | 0.0 | - |
0.8039 | 10800 | 0.0001 | - |
0.8076 | 10850 | 0.0366 | - |
0.8113 | 10900 | 0.0277 | - |
0.8150 | 10950 | 0.0 | - |
0.8188 | 11000 | 0.0412 | - |
0.8225 | 11050 | 0.0001 | - |
0.8262 | 11100 | 0.0003 | - |
0.8299 | 11150 | 0.0 | - |
0.8336 | 11200 | 0.0016 | - |
0.8374 | 11250 | 0.059 | - |
0.8411 | 11300 | 0.0 | - |
0.8448 | 11350 | 0.0001 | - |
0.8485 | 11400 | 0.0002 | - |
0.8523 | 11450 | 0.0001 | - |
0.8560 | 11500 | 0.0001 | - |
0.8597 | 11550 | 0.1203 | - |
0.8634 | 11600 | 0.0261 | - |
0.8671 | 11650 | 0.0002 | - |
0.8709 | 11700 | 0.245 | - |
0.8746 | 11750 | 0.0 | - |
0.8783 | 11800 | 0.0 | - |
0.8820 | 11850 | 0.0002 | - |
0.8857 | 11900 | 0.0318 | - |
0.8895 | 11950 | 0.0232 | - |
0.8932 | 12000 | 0.0 | - |
0.8969 | 12050 | 0.0 | - |
0.9006 | 12100 | 0.0264 | - |
0.9044 | 12150 | 0.025 | - |
0.9081 | 12200 | 0.0152 | - |
0.9118 | 12250 | 0.0 | - |
0.9155 | 12300 | 0.0001 | - |
0.9192 | 12350 | 0.0 | - |
0.9230 | 12400 | 0.02 | - |
0.9267 | 12450 | 0.0073 | - |
0.9304 | 12500 | 0.1577 | - |
0.9341 | 12550 | 0.0207 | - |
0.9378 | 12600 | 0.0289 | - |
0.9416 | 12650 | 0.0001 | - |
0.9453 | 12700 | 0.0778 | - |
0.9490 | 12750 | 0.0712 | - |
0.9527 | 12800 | 0.0 | - |
0.9565 | 12850 | 0.0 | - |
0.9602 | 12900 | 0.0 | - |
0.9639 | 12950 | 0.0002 | - |
0.9676 | 13000 | 0.0 | - |
0.9713 | 13050 | 0.0001 | - |
0.9751 | 13100 | 0.0 | - |
0.9788 | 13150 | 0.0 | - |
0.9825 | 13200 | 0.1664 | - |
0.9862 | 13250 | 0.0014 | - |
0.9900 | 13300 | 0.1693 | - |
0.9937 | 13350 | 0.0264 | - |
0.9974 | 13400 | 0.0027 | - |
Framework Versions
- Python: 3.10.13
- SetFit: 1.0.3
- Sentence Transformers: 3.0.1
- spaCy: 3.7.5
- Transformers: 4.36.2
- PyTorch: 2.1.2
- Datasets: 2.19.2
- Tokenizers: 0.15.2
Citation
BibTeX
@article{https://doi.org/10.48550/arxiv.2209.11055,
doi = {10.48550/ARXIV.2209.11055},
url = {https://arxiv.org/abs/2209.11055},
author = {Tunstall, Lewis and Reimers, Nils and Jo, Unso Eun Seo and Bates, Luke and Korat, Daniel and Wasserblat, Moshe and Pereg, Oren},
keywords = {Computation and Language (cs.CL), FOS: Computer and information sciences, FOS: Computer and information sciences},
title = {Efficient Few-Shot Learning Without Prompts},
publisher = {arXiv},
year = {2022},
copyright = {Creative Commons Attribution 4.0 International}
}
- Downloads last month
- 0
Inference API (serverless) has been turned off for this model.