SetFit Aspect Model with snunlp/KR-SBERT-V40K-klueNLI-augSTS
This is a SetFit model that can be used for Aspect Based Sentiment Analysis (ABSA). This SetFit model uses snunlp/KR-SBERT-V40K-klueNLI-augSTS as the Sentence Transformer embedding model. 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
- Sentence Transformer body: snunlp/KR-SBERT-V40K-klueNLI-augSTS
- Classification head: a LogisticRegression instance
- spaCy Model: en_core_web_lg
- SetFitABSA Aspect Model: cccornflake/modu_absa-aspect
- SetFitABSA Polarity Model: cccornflake/modu_absa-polarity
- Maximum Sequence Length: 128 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 |
---|---|
no aspect |
|
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(
"cccornflake/modu_absa-aspect",
"cccornflake/modu_absa-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 | 1 | 12.3710 | 45 |
Label | Training Sample Count |
---|---|
no aspect | 2534 |
aspect | 806 |
Training Hyperparameters
- batch_size: (4, 4)
- num_epochs: (1, 1)
- max_steps: -1
- sampling_strategy: oversampling
- num_iterations: 20
- 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.0029 | 1 | 0.144 | - |
0.1471 | 50 | 0.1638 | - |
0.2941 | 100 | 0.0111 | - |
0.4412 | 150 | 0.0003 | - |
0.5882 | 200 | 0.0001 | - |
0.7353 | 250 | 0.0002 | - |
0.8824 | 300 | 0.0001 | - |
0.0017 | 1 | 0.1847 | - |
0.0833 | 50 | 0.0009 | - |
0.1667 | 100 | 0.0001 | - |
0.25 | 150 | 0.0001 | - |
0.3333 | 200 | 0.0002 | - |
0.4167 | 250 | 0.0 | - |
0.5 | 300 | 0.0 | - |
0.5833 | 350 | 0.0 | - |
0.6667 | 400 | 0.0 | - |
0.75 | 450 | 0.0 | - |
0.8333 | 500 | 0.0 | - |
0.9167 | 550 | 0.0001 | - |
1.0 | 600 | 0.0 | - |
0.0000 | 1 | 0.0112 | - |
0.0015 | 50 | 0.4302 | - |
0.0030 | 100 | 0.0006 | - |
0.0045 | 150 | 0.2262 | - |
0.0060 | 200 | 0.3926 | 0.1537 |
0.0075 | 250 | 0.1391 | - |
0.0090 | 300 | 0.0051 | - |
0.0105 | 350 | 0.018 | - |
0.0120 | 400 | 0.2427 | 0.1252 |
0.0135 | 450 | 0.0004 | - |
0.0150 | 500 | 0.0006 | - |
0.0165 | 550 | 0.0027 | - |
0.0180 | 600 | 0.021 | 0.1186 |
0.0195 | 650 | 0.0092 | - |
0.0210 | 700 | 0.2152 | - |
0.0225 | 750 | 0.2208 | - |
0.0240 | 800 | 0.1252 | 0.0971 |
0.0254 | 850 | 0.0891 | - |
0.0269 | 900 | 0.0007 | - |
0.0284 | 950 | 0.2289 | - |
0.0299 | 1000 | 0.2675 | 0.1191 |
0.0314 | 1050 | 0.0022 | - |
0.0329 | 1100 | 0.0027 | - |
0.0344 | 1150 | 0.0004 | - |
0.0359 | 1200 | 0.0323 | 0.1083 |
0.0374 | 1250 | 0.2118 | - |
0.0389 | 1300 | 0.0018 | - |
0.0404 | 1350 | 0.0001 | - |
0.0419 | 1400 | 0.2381 | 0.0795 |
0.0434 | 1450 | 0.0004 | - |
0.0449 | 1500 | 0.0 | - |
0.0464 | 1550 | 0.0001 | - |
0.0479 | 1600 | 0.0003 | 0.0807 |
0.0494 | 1650 | 0.0017 | - |
0.0509 | 1700 | 0.0018 | - |
0.0524 | 1750 | 0.0017 | - |
0.0539 | 1800 | 0.0003 | 0.0962 |
0.0554 | 1850 | 0.3088 | - |
0.0569 | 1900 | 0.234 | - |
0.0584 | 1950 | 0.0015 | - |
0.0599 | 2000 | 0.0015 | 0.0872 |
0.0614 | 2050 | 0.0009 | - |
0.0629 | 2100 | 0.0003 | - |
0.0644 | 2150 | 0.0002 | - |
0.0659 | 2200 | 0.0058 | 0.0811 |
0.0674 | 2250 | 0.0001 | - |
0.0689 | 2300 | 0.122 | - |
0.0704 | 2350 | 0.2157 | - |
0.0719 | 2400 | 0.0001 | 0.0944 |
0.0734 | 2450 | 0.0 | - |
0.0749 | 2500 | 0.0002 | - |
0.0763 | 2550 | 0.0007 | - |
0.0778 | 2600 | 0.0002 | 0.0965 |
0.0793 | 2650 | 0.0001 | - |
0.0808 | 2700 | 0.0002 | - |
0.0823 | 2750 | 0.0008 | - |
0.0838 | 2800 | 0.0 | 0.0954 |
0.0853 | 2850 | 0.0126 | - |
0.0868 | 2900 | 0.0541 | - |
0.0883 | 2950 | 0.0002 | - |
0.0898 | 3000 | 0.0005 | 0.0841 |
0.0913 | 3050 | 0.0001 | - |
0.0928 | 3100 | 0.1914 | - |
0.0943 | 3150 | 0.0001 | - |
0.0958 | 3200 | 0.0001 | 0.0815 |
0.0973 | 3250 | 0.0051 | - |
0.0988 | 3300 | 0.0002 | - |
0.1003 | 3350 | 0.0 | - |
0.1018 | 3400 | 0.0001 | 0.0876 |
0.1033 | 3450 | 0.0 | - |
0.1048 | 3500 | 0.0 | - |
0.1063 | 3550 | 0.2448 | - |
0.1078 | 3600 | 0.0 | 0.0893 |
0.1093 | 3650 | 0.0 | - |
0.1108 | 3700 | 0.0001 | - |
0.1123 | 3750 | 0.0001 | - |
0.1138 | 3800 | 0.0 | 0.0883 |
0.1153 | 3850 | 0.0149 | - |
0.1168 | 3900 | 0.0006 | - |
0.1183 | 3950 | 0.0009 | - |
0.1198 | 4000 | 0.0021 | 0.0963 |
0.1213 | 4050 | 0.0002 | - |
0.1228 | 4100 | 0.0 | - |
0.1243 | 4150 | 0.0 | - |
0.1257 | 4200 | 0.0013 | 0.1065 |
0.1272 | 4250 | 0.0026 | - |
0.1287 | 4300 | 0.0001 | - |
0.1302 | 4350 | 0.0001 | - |
0.1317 | 4400 | 0.0 | 0.0845 |
0.1332 | 4450 | 0.0 | - |
0.1347 | 4500 | 0.0008 | - |
0.1362 | 4550 | 0.0003 | - |
0.1377 | 4600 | 0.0006 | 0.0934 |
0.1392 | 4650 | 0.0005 | - |
0.1407 | 4700 | 0.0006 | - |
0.1422 | 4750 | 0.0001 | - |
0.1437 | 4800 | 0.0 | 0.1055 |
0.1452 | 4850 | 0.0 | - |
0.1467 | 4900 | 0.0 | - |
0.1482 | 4950 | 0.0 | - |
0.1497 | 5000 | 0.0001 | 0.097 |
0.1512 | 5050 | 0.0 | - |
0.1527 | 5100 | 0.0001 | - |
0.1542 | 5150 | 0.0 | - |
0.1557 | 5200 | 0.0 | 0.0961 |
0.1572 | 5250 | 0.2286 | - |
0.1587 | 5300 | 0.0 | - |
0.1602 | 5350 | 0.0008 | - |
0.1617 | 5400 | 0.0 | 0.0946 |
0.1632 | 5450 | 0.0012 | - |
0.1647 | 5500 | 0.0 | - |
0.1662 | 5550 | 0.0 | - |
0.1677 | 5600 | 0.0 | 0.0942 |
0.1692 | 5650 | 0.0 | - |
0.1707 | 5700 | 0.0001 | - |
0.1722 | 5750 | 0.0 | - |
0.1737 | 5800 | 0.0 | 0.0962 |
0.1751 | 5850 | 0.0 | - |
0.1766 | 5900 | 0.0 | - |
0.1781 | 5950 | 0.0 | - |
0.1796 | 6000 | 0.0 | 0.1079 |
0.1811 | 6050 | 0.0 | - |
0.1826 | 6100 | 0.0011 | - |
0.1841 | 6150 | 0.0 | - |
0.1856 | 6200 | 0.0 | 0.0939 |
0.1871 | 6250 | 0.0 | - |
0.1886 | 6300 | 0.0 | - |
0.1901 | 6350 | 0.0 | - |
0.1916 | 6400 | 0.0 | 0.1091 |
0.1931 | 6450 | 0.0017 | - |
0.1946 | 6500 | 0.001 | - |
0.1961 | 6550 | 0.0 | - |
0.1976 | 6600 | 0.0 | 0.0893 |
0.1991 | 6650 | 0.001 | - |
0.2006 | 6700 | 0.0 | - |
0.2021 | 6750 | 0.0 | - |
0.2036 | 6800 | 0.0004 | 0.0909 |
0.2051 | 6850 | 0.0019 | - |
0.2066 | 6900 | 0.0006 | - |
0.2081 | 6950 | 0.0 | - |
0.2096 | 7000 | 0.0 | 0.091 |
0.2111 | 7050 | 0.0 | - |
0.2126 | 7100 | 0.0 | - |
0.2141 | 7150 | 0.0001 | - |
0.2156 | 7200 | 0.0 | 0.1216 |
0.2171 | 7250 | 0.0 | - |
0.2186 | 7300 | 0.0 | - |
0.2201 | 7350 | 0.0 | - |
0.2216 | 7400 | 0.0 | 0.0885 |
0.2231 | 7450 | 0.0 | - |
0.2246 | 7500 | 0.0 | - |
0.2260 | 7550 | 0.0 | - |
0.2275 | 7600 | 0.0 | 0.0921 |
0.2290 | 7650 | 0.0 | - |
0.2305 | 7700 | 0.0 | - |
0.2320 | 7750 | 0.0005 | - |
0.2335 | 7800 | 0.0 | 0.0933 |
0.2350 | 7850 | 0.0 | - |
0.2365 | 7900 | 0.0 | - |
0.2380 | 7950 | 0.0 | - |
0.2395 | 8000 | 0.0 | 0.0908 |
0.2410 | 8050 | 0.0 | - |
0.2425 | 8100 | 0.0 | - |
0.2440 | 8150 | 0.0006 | - |
0.2455 | 8200 | 0.0 | 0.0891 |
0.2470 | 8250 | 0.0 | - |
0.2485 | 8300 | 0.0 | - |
0.25 | 8350 | 0.0 | - |
0.2515 | 8400 | 0.0001 | 0.0918 |
0.2530 | 8450 | 0.0 | - |
0.2545 | 8500 | 0.0 | - |
0.2560 | 8550 | 0.0 | - |
0.2575 | 8600 | 0.0 | 0.0797 |
0.2590 | 8650 | 0.0 | - |
0.2605 | 8700 | 0.0 | - |
0.2620 | 8750 | 0.0 | - |
0.2635 | 8800 | 0.0 | 0.0843 |
0.2650 | 8850 | 0.0 | - |
0.2665 | 8900 | 0.0 | - |
0.2680 | 8950 | 0.0 | - |
0.2695 | 9000 | 0.0 | 0.0811 |
0.2710 | 9050 | 0.0 | - |
0.2725 | 9100 | 0.0 | - |
0.2740 | 9150 | 0.0 | - |
0.2754 | 9200 | 0.091 | 0.0858 |
0.2769 | 9250 | 0.0 | - |
0.2784 | 9300 | 0.0 | - |
0.2799 | 9350 | 0.0 | - |
0.2814 | 9400 | 0.0 | 0.0886 |
0.2829 | 9450 | 0.0 | - |
0.2844 | 9500 | 0.0 | - |
0.2859 | 9550 | 0.0 | - |
0.2874 | 9600 | 0.0 | 0.09 |
0.2889 | 9650 | 0.0 | - |
0.2904 | 9700 | 0.0 | - |
0.2919 | 9750 | 0.0 | - |
0.2934 | 9800 | 0.0 | 0.0887 |
0.2949 | 9850 | 0.0 | - |
0.2964 | 9900 | 0.0001 | - |
0.2979 | 9950 | 0.0 | - |
0.2994 | 10000 | 0.0 | 0.103 |
0.3009 | 10050 | 0.0 | - |
0.3024 | 10100 | 0.0 | - |
0.3039 | 10150 | 0.0 | - |
0.3054 | 10200 | 0.0 | 0.106 |
0.3069 | 10250 | 0.0 | - |
0.3084 | 10300 | 0.0 | - |
0.3099 | 10350 | 0.0 | - |
0.3114 | 10400 | 0.0 | 0.0861 |
0.3129 | 10450 | 0.0 | - |
0.3144 | 10500 | 0.0 | - |
0.3159 | 10550 | 0.2242 | - |
0.3174 | 10600 | 0.0 | 0.0972 |
0.3189 | 10650 | 0.0 | - |
0.3204 | 10700 | 0.0 | - |
0.3219 | 10750 | 0.0 | - |
0.3234 | 10800 | 0.0008 | 0.0966 |
0.3249 | 10850 | 0.0 | - |
0.3263 | 10900 | 0.0 | - |
0.3278 | 10950 | 0.0 | - |
0.3293 | 11000 | 0.0 | 0.0924 |
0.3308 | 11050 | 0.0 | - |
0.3323 | 11100 | 0.0 | - |
0.3338 | 11150 | 0.0 | - |
0.3353 | 11200 | 0.0 | 0.0988 |
0.3368 | 11250 | 0.0 | - |
0.3383 | 11300 | 0.0 | - |
0.3398 | 11350 | 0.0 | - |
0.3413 | 11400 | 0.0 | 0.096 |
0.3428 | 11450 | 0.0 | - |
0.3443 | 11500 | 0.0 | - |
0.3458 | 11550 | 0.0 | - |
0.3473 | 11600 | 0.0 | 0.1044 |
0.3488 | 11650 | 0.0 | - |
0.3503 | 11700 | 0.0 | - |
0.3518 | 11750 | 0.0 | - |
0.3533 | 11800 | 0.0 | 0.093 |
0.3548 | 11850 | 0.0 | - |
0.3563 | 11900 | 0.0 | - |
0.3578 | 11950 | 0.0 | - |
0.3593 | 12000 | 0.0 | 0.0926 |
0.3608 | 12050 | 0.0 | - |
0.3623 | 12100 | 0.0 | - |
0.3638 | 12150 | 0.0 | - |
0.3653 | 12200 | 0.0 | 0.092 |
0.3668 | 12250 | 0.0 | - |
0.3683 | 12300 | 0.0 | - |
0.3698 | 12350 | 0.0 | - |
0.3713 | 12400 | 0.0 | 0.0913 |
0.3728 | 12450 | 0.0 | - |
0.3743 | 12500 | 0.0 | - |
0.3757 | 12550 | 0.0 | - |
0.3772 | 12600 | 0.0 | 0.092 |
0.3787 | 12650 | 0.0 | - |
0.3802 | 12700 | 0.0 | - |
0.3817 | 12750 | 0.0 | - |
0.3832 | 12800 | 0.0 | 0.0932 |
0.3847 | 12850 | 0.0 | - |
0.3862 | 12900 | 0.0004 | - |
0.3877 | 12950 | 0.0 | - |
0.3892 | 13000 | 0.0 | 0.0946 |
0.3907 | 13050 | 0.0 | - |
0.3922 | 13100 | 0.0 | - |
0.3937 | 13150 | 0.0 | - |
0.3952 | 13200 | 0.0 | 0.0934 |
0.3967 | 13250 | 0.0 | - |
0.3982 | 13300 | 0.0 | - |
0.3997 | 13350 | 0.0 | - |
0.4012 | 13400 | 0.0 | 0.0926 |
0.4027 | 13450 | 0.0 | - |
0.4042 | 13500 | 0.0 | - |
0.4057 | 13550 | 0.0 | - |
0.4072 | 13600 | 0.0 | 0.0928 |
0.4087 | 13650 | 0.0 | - |
0.4102 | 13700 | 0.0 | - |
0.4117 | 13750 | 0.0 | - |
0.4132 | 13800 | 0.0 | 0.0932 |
0.4147 | 13850 | 0.0 | - |
0.4162 | 13900 | 0.0 | - |
0.4177 | 13950 | 0.0 | - |
0.4192 | 14000 | 0.0 | 0.0929 |
0.4207 | 14050 | 0.0 | - |
0.4222 | 14100 | 0.0 | - |
0.4237 | 14150 | 0.0 | - |
0.4251 | 14200 | 0.0 | 0.09 |
0.4266 | 14250 | 0.0 | - |
0.4281 | 14300 | 0.0 | - |
0.4296 | 14350 | 0.0 | - |
0.4311 | 14400 | 0.0 | 0.0891 |
0.4326 | 14450 | 0.0 | - |
0.4341 | 14500 | 0.0 | - |
0.4356 | 14550 | 0.0 | - |
0.4371 | 14600 | 0.0 | 0.0933 |
0.4386 | 14650 | 0.0 | - |
0.4401 | 14700 | 0.0 | - |
0.4416 | 14750 | 0.0 | - |
0.4431 | 14800 | 0.0 | 0.0923 |
0.4446 | 14850 | 0.0 | - |
0.4461 | 14900 | 0.0 | - |
0.4476 | 14950 | 0.0 | - |
0.4491 | 15000 | 0.0 | 0.0929 |
0.4506 | 15050 | 0.0 | - |
0.4521 | 15100 | 0.0012 | - |
0.4536 | 15150 | 0.0 | - |
0.4551 | 15200 | 0.0 | 0.0913 |
0.4566 | 15250 | 0.0 | - |
0.4581 | 15300 | 0.0 | - |
0.4596 | 15350 | 0.0 | - |
0.4611 | 15400 | 0.0 | 0.1148 |
0.4626 | 15450 | 0.0 | - |
0.4641 | 15500 | 0.0 | - |
0.4656 | 15550 | 0.0 | - |
0.4671 | 15600 | 0.0 | 0.1061 |
0.4686 | 15650 | 0.0 | - |
0.4701 | 15700 | 0.0 | - |
0.4716 | 15750 | 0.0 | - |
0.4731 | 15800 | 0.0 | 0.1166 |
0.4746 | 15850 | 0.0 | - |
0.4760 | 15900 | 0.0 | - |
0.4775 | 15950 | 0.0 | - |
0.4790 | 16000 | 0.0 | 0.094 |
0.4805 | 16050 | 0.0 | - |
0.4820 | 16100 | 0.0 | - |
0.4835 | 16150 | 0.0 | - |
0.4850 | 16200 | 0.0 | 0.0963 |
0.4865 | 16250 | 0.0027 | - |
0.4880 | 16300 | 0.0 | - |
0.4895 | 16350 | 0.0 | - |
0.4910 | 16400 | 0.0002 | 0.0946 |
0.4925 | 16450 | 0.0 | - |
0.4940 | 16500 | 0.0 | - |
0.4955 | 16550 | 0.0 | - |
0.4970 | 16600 | 0.0 | 0.0896 |
0.4985 | 16650 | 0.0 | - |
0.5 | 16700 | 0.0 | - |
0.5015 | 16750 | 0.0 | - |
0.5030 | 16800 | 0.0 | 0.0884 |
0.5045 | 16850 | 0.0 | - |
0.5060 | 16900 | 0.0 | - |
0.5075 | 16950 | 0.0 | - |
0.5090 | 17000 | 0.0 | - |
Framework Versions
- Python: 3.9.18
- SetFit: 1.1.0.dev0
- Sentence Transformers: 2.7.0
- spaCy: 3.7.4
- Transformers: 4.40.0
- PyTorch: 1.12.0
- Datasets: 2.19.1
- Tokenizers: 0.19.1
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
- 4