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_review_game_genshin-aspect
- SetFitABSA Polarity Model: Funnyworld1412/ABSA_review_game_genshin-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_review_game_genshin-aspect",
"Funnyworld1412/ABSA_review_game_genshin-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 | 4 | 49.9079 | 94 |
Label | Training Sample Count |
---|---|
no aspect | 2281 |
aspect | 477 |
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.25 | - |
0.0036 | 50 | 0.331 | - |
0.0073 | 100 | 0.5002 | - |
0.0109 | 150 | 0.2904 | - |
0.0145 | 200 | 0.3791 | - |
0.0181 | 250 | 0.2253 | - |
0.0218 | 300 | 0.1909 | - |
0.0254 | 350 | 0.2504 | - |
0.0290 | 400 | 0.1241 | - |
0.0326 | 450 | 0.1021 | - |
0.0363 | 500 | 0.0985 | - |
0.0399 | 550 | 0.3831 | - |
0.0435 | 600 | 0.1841 | - |
0.0471 | 650 | 0.2487 | - |
0.0508 | 700 | 0.1573 | - |
0.0544 | 750 | 0.0499 | - |
0.0580 | 800 | 0.2214 | - |
0.0616 | 850 | 0.1427 | - |
0.0653 | 900 | 0.3544 | - |
0.0689 | 950 | 0.042 | - |
0.0725 | 1000 | 0.2918 | - |
0.0761 | 1050 | 0.0134 | - |
0.0798 | 1100 | 0.1933 | - |
0.0834 | 1150 | 0.0115 | - |
0.0870 | 1200 | 0.2393 | - |
0.0906 | 1250 | 0.2625 | - |
0.0943 | 1300 | 0.1496 | - |
0.0979 | 1350 | 0.1417 | - |
0.1015 | 1400 | 0.2111 | - |
0.1051 | 1450 | 0.2158 | - |
0.1088 | 1500 | 0.1378 | - |
0.1124 | 1550 | 0.0988 | - |
0.1160 | 1600 | 0.1183 | - |
0.1197 | 1650 | 0.324 | - |
0.1233 | 1700 | 0.3722 | - |
0.1269 | 1750 | 0.1696 | - |
0.1305 | 1800 | 0.2893 | - |
0.1342 | 1850 | 0.198 | - |
0.1378 | 1900 | 0.2854 | - |
0.1414 | 1950 | 0.3339 | - |
0.1450 | 2000 | 0.0783 | - |
0.1487 | 2050 | 0.014 | - |
0.1523 | 2100 | 0.0205 | - |
0.1559 | 2150 | 0.0151 | - |
0.1595 | 2200 | 0.3783 | - |
0.1632 | 2250 | 0.381 | - |
0.1668 | 2300 | 0.144 | - |
0.1704 | 2350 | 0.0023 | - |
0.1740 | 2400 | 0.1903 | - |
0.1777 | 2450 | 0.0033 | - |
0.1813 | 2500 | 0.0039 | - |
0.1849 | 2550 | 0.0019 | - |
0.1885 | 2600 | 0.0565 | - |
0.1922 | 2650 | 0.1551 | - |
0.1958 | 2700 | 0.0729 | - |
0.1994 | 2750 | 0.0272 | - |
0.2030 | 2800 | 0.495 | - |
0.2067 | 2850 | 0.0396 | - |
0.2103 | 2900 | 0.2288 | - |
0.2139 | 2950 | 0.0077 | - |
0.2175 | 3000 | 0.0642 | - |
0.2212 | 3050 | 0.0037 | - |
0.2248 | 3100 | 0.2447 | - |
0.2284 | 3150 | 0.0097 | - |
0.2321 | 3200 | 0.0011 | - |
0.2357 | 3250 | 0.1254 | - |
0.2393 | 3300 | 0.0046 | - |
0.2429 | 3350 | 0.0127 | - |
0.2466 | 3400 | 0.0093 | - |
0.2502 | 3450 | 0.0005 | - |
0.2538 | 3500 | 0.0022 | - |
0.2574 | 3550 | 0.0005 | - |
0.2611 | 3600 | 0.0002 | - |
0.2647 | 3650 | 0.0231 | - |
0.2683 | 3700 | 0.0016 | - |
0.2719 | 3750 | 0.1945 | - |
0.2756 | 3800 | 0.002 | - |
0.2792 | 3850 | 0.0235 | - |
0.2828 | 3900 | 0.006 | - |
0.2864 | 3950 | 0.0003 | - |
0.2901 | 4000 | 0.007 | - |
0.2937 | 4050 | 0.0227 | - |
0.2973 | 4100 | 0.1794 | - |
0.3009 | 4150 | 0.2629 | - |
0.3046 | 4200 | 0.3005 | - |
0.3082 | 4250 | 0.1974 | - |
0.3118 | 4300 | 0.001 | - |
0.3154 | 4350 | 0.0123 | - |
0.3191 | 4400 | 0.0027 | - |
0.3227 | 4450 | 0.0002 | - |
0.3263 | 4500 | 0.0005 | - |
0.3299 | 4550 | 0.0002 | - |
0.3336 | 4600 | 0.0007 | - |
0.3372 | 4650 | 0.0332 | - |
0.3408 | 4700 | 0.052 | - |
0.3445 | 4750 | 0.0103 | - |
0.3481 | 4800 | 0.0067 | - |
0.3517 | 4850 | 0.0003 | - |
0.3553 | 4900 | 0.0008 | - |
0.3590 | 4950 | 0.0088 | - |
0.3626 | 5000 | 0.0002 | - |
0.3662 | 5050 | 0.0111 | - |
0.3698 | 5100 | 0.0836 | - |
0.3735 | 5150 | 0.0001 | - |
0.3771 | 5200 | 0.2398 | - |
0.3807 | 5250 | 0.0002 | - |
0.3843 | 5300 | 0.1435 | - |
0.3880 | 5350 | 0.0001 | - |
0.3916 | 5400 | 0.0296 | - |
0.3952 | 5450 | 0.0003 | - |
0.3988 | 5500 | 0.1126 | - |
0.4025 | 5550 | 0.0009 | - |
0.4061 | 5600 | 0.0055 | - |
0.4097 | 5650 | 0.0031 | - |
0.4133 | 5700 | 0.1929 | - |
0.4170 | 5750 | 0.0002 | - |
0.4206 | 5800 | 0.2565 | - |
0.4242 | 5850 | 0.0002 | - |
0.4278 | 5900 | 0.0033 | - |
0.4315 | 5950 | 0.0011 | - |
0.4351 | 6000 | 0.0001 | - |
0.4387 | 6050 | 0.0004 | - |
0.4423 | 6100 | 0.0003 | - |
0.4460 | 6150 | 0.1076 | - |
0.4496 | 6200 | 0.0011 | - |
0.4532 | 6250 | 0.0034 | - |
0.4569 | 6300 | 0.0176 | - |
0.4605 | 6350 | 0.2883 | - |
0.4641 | 6400 | 0.0 | - |
0.4677 | 6450 | 0.0172 | - |
0.4714 | 6500 | 0.0014 | - |
0.4750 | 6550 | 0.0571 | - |
0.4786 | 6600 | 0.0287 | - |
0.4822 | 6650 | 0.1461 | - |
0.4859 | 6700 | 0.2333 | - |
0.4895 | 6750 | 0.1468 | - |
0.4931 | 6800 | 0.0005 | - |
0.4967 | 6850 | 0.0039 | - |
0.5004 | 6900 | 0.0004 | - |
0.5040 | 6950 | 0.0008 | - |
0.5076 | 7000 | 0.0004 | - |
0.5112 | 7050 | 0.0005 | - |
0.5149 | 7100 | 0.001 | - |
0.5185 | 7150 | 0.0041 | - |
0.5221 | 7200 | 0.0157 | - |
0.5257 | 7250 | 0.0228 | - |
0.5294 | 7300 | 0.0002 | - |
0.5330 | 7350 | 0.0004 | - |
0.5366 | 7400 | 0.0081 | - |
0.5402 | 7450 | 0.0004 | - |
0.5439 | 7500 | 0.1227 | - |
0.5475 | 7550 | 0.0001 | - |
0.5511 | 7600 | 0.0006 | - |
0.5547 | 7650 | 0.0003 | - |
0.5584 | 7700 | 0.0475 | - |
0.5620 | 7750 | 0.1848 | - |
0.5656 | 7800 | 0.0007 | - |
0.5693 | 7850 | 0.001 | - |
0.5729 | 7900 | 0.0002 | - |
0.5765 | 7950 | 0.0018 | - |
0.5801 | 8000 | 0.0009 | - |
0.5838 | 8050 | 0.0019 | - |
0.5874 | 8100 | 0.0001 | - |
0.5910 | 8150 | 0.0012 | - |
0.5946 | 8200 | 0.0536 | - |
0.5983 | 8250 | 0.0943 | - |
0.6019 | 8300 | 0.006 | - |
0.6055 | 8350 | 0.0019 | - |
0.6091 | 8400 | 0.0 | - |
0.6128 | 8450 | 0.0004 | - |
0.6164 | 8500 | 0.0 | - |
0.6200 | 8550 | 0.2588 | - |
0.6236 | 8600 | 0.0001 | - |
0.6273 | 8650 | 0.0084 | - |
0.6309 | 8700 | 0.0001 | - |
0.6345 | 8750 | 0.4123 | - |
0.6381 | 8800 | 0.073 | - |
0.6418 | 8850 | 0.0 | - |
0.6454 | 8900 | 0.1361 | - |
0.6490 | 8950 | 0.0249 | - |
0.6526 | 9000 | 0.0003 | - |
0.6563 | 9050 | 0.0018 | - |
0.6599 | 9100 | 0.0115 | - |
0.6635 | 9150 | 0.1789 | - |
0.6672 | 9200 | 0.0001 | - |
0.6708 | 9250 | 0.0006 | - |
0.6744 | 9300 | 0.002 | - |
0.6780 | 9350 | 0.0 | - |
0.6817 | 9400 | 0.0042 | - |
0.6853 | 9450 | 0.0003 | - |
0.6889 | 9500 | 0.0105 | - |
0.6925 | 9550 | 0.0 | - |
0.6962 | 9600 | 0.0285 | - |
0.6998 | 9650 | 0.0002 | - |
0.7034 | 9700 | 0.0 | - |
0.7070 | 9750 | 0.001 | - |
0.7107 | 9800 | 0.0641 | - |
0.7143 | 9850 | 0.0096 | - |
0.7179 | 9900 | 0.0001 | - |
0.7215 | 9950 | 0.0003 | - |
0.7252 | 10000 | 0.3666 | - |
0.7288 | 10050 | 0.0001 | - |
0.7324 | 10100 | 0.0001 | - |
0.7360 | 10150 | 0.0001 | - |
0.7397 | 10200 | 0.2526 | - |
0.7433 | 10250 | 0.0286 | - |
0.7469 | 10300 | 0.0001 | - |
0.7505 | 10350 | 0.004 | - |
0.7542 | 10400 | 0.0 | - |
0.7578 | 10450 | 0.0237 | - |
0.7614 | 10500 | 0.0012 | - |
0.7650 | 10550 | 0.0001 | - |
0.7687 | 10600 | 0.0223 | - |
0.7723 | 10650 | 0.0349 | - |
0.7759 | 10700 | 0.033 | - |
0.7796 | 10750 | 0.0005 | - |
0.7832 | 10800 | 0.0001 | - |
0.7868 | 10850 | 0.0001 | - |
0.7904 | 10900 | 0.0002 | - |
0.7941 | 10950 | 0.0005 | - |
0.7977 | 11000 | 0.0003 | - |
0.8013 | 11050 | 0.0 | - |
0.8049 | 11100 | 0.0348 | - |
0.8086 | 11150 | 0.0 | - |
0.8122 | 11200 | 0.0001 | - |
0.8158 | 11250 | 0.0 | - |
0.8194 | 11300 | 0.0 | - |
0.8231 | 11350 | 0.0 | - |
0.8267 | 11400 | 0.0002 | - |
0.8303 | 11450 | 0.0002 | - |
0.8339 | 11500 | 0.0112 | - |
0.8376 | 11550 | 0.0099 | - |
0.8412 | 11600 | 0.0 | - |
0.8448 | 11650 | 0.0 | - |
0.8484 | 11700 | 0.045 | - |
0.8521 | 11750 | 0.138 | - |
0.8557 | 11800 | 0.0283 | - |
0.8593 | 11850 | 0.0001 | - |
0.8629 | 11900 | 0.0 | - |
0.8666 | 11950 | 0.0751 | - |
0.8702 | 12000 | 0.0002 | - |
0.8738 | 12050 | 0.0 | - |
0.8774 | 12100 | 0.0001 | - |
0.8811 | 12150 | 0.0948 | - |
0.8847 | 12200 | 0.0896 | - |
0.8883 | 12250 | 0.1255 | - |
0.8920 | 12300 | 0.0001 | - |
0.8956 | 12350 | 0.0 | - |
0.8992 | 12400 | 0.1456 | - |
0.9028 | 12450 | 0.0079 | - |
0.9065 | 12500 | 0.0 | - |
0.9101 | 12550 | 0.0 | - |
0.9137 | 12600 | 0.0002 | - |
0.9173 | 12650 | 0.0047 | - |
0.9210 | 12700 | 0.1701 | - |
0.9246 | 12750 | 0.0423 | - |
0.9282 | 12800 | 0.0001 | - |
0.9318 | 12850 | 0.0969 | - |
0.9355 | 12900 | 0.0001 | - |
0.9391 | 12950 | 0.0 | - |
0.9427 | 13000 | 0.0 | - |
0.9463 | 13050 | 0.0301 | - |
0.9500 | 13100 | 0.0066 | - |
0.9536 | 13150 | 0.0 | - |
0.9572 | 13200 | 0.0 | - |
0.9608 | 13250 | 0.0 | - |
0.9645 | 13300 | 0.0 | - |
0.9681 | 13350 | 0.0008 | - |
0.9717 | 13400 | 0.0255 | - |
0.9753 | 13450 | 0.0 | - |
0.9790 | 13500 | 0.0908 | - |
0.9826 | 13550 | 0.0826 | - |
0.9862 | 13600 | 0.0 | - |
0.9898 | 13650 | 0.0247 | - |
0.9935 | 13700 | 0.0 | - |
0.9971 | 13750 | 0.0546 | - |
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
- 1
Inference API (serverless) has been turned off for this model.