SetFit Polarity 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 classifying aspect polarities.
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 a SetFit model to filter these possible aspect span candidates.
- Use this 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: 8192 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 |
---|---|
Negative |
|
Positive |
|
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 | 11 | 39.7490 | 94 |
Label | Training Sample Count |
---|---|
konflik | 0 |
negatif | 0 |
netral | 0 |
positif | 0 |
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.0004 | 1 | 0.1468 | - |
0.0198 | 50 | 0.2275 | - |
0.0395 | 100 | 0.1824 | - |
0.0593 | 150 | 0.1943 | - |
0.0791 | 200 | 0.0063 | - |
0.0988 | 250 | 0.2251 | - |
0.1186 | 300 | 0.0068 | - |
0.1383 | 350 | 0.0046 | - |
0.1581 | 400 | 0.0015 | - |
0.1779 | 450 | 0.0014 | - |
0.1976 | 500 | 0.0018 | - |
0.2174 | 550 | 0.2301 | - |
0.2372 | 600 | 0.0011 | - |
0.2569 | 650 | 0.0051 | - |
0.2767 | 700 | 0.0015 | - |
0.2964 | 750 | 0.0016 | - |
0.3162 | 800 | 0.0007 | - |
0.3360 | 850 | 0.0027 | - |
0.3557 | 900 | 0.0014 | - |
0.3755 | 950 | 0.0077 | - |
0.3953 | 1000 | 0.001 | - |
0.4150 | 1050 | 0.0006 | - |
0.4348 | 1100 | 0.0009 | - |
0.4545 | 1150 | 0.1986 | - |
0.4743 | 1200 | 0.0004 | - |
0.4941 | 1250 | 0.0008 | - |
0.5138 | 1300 | 0.0008 | - |
0.5336 | 1350 | 0.0011 | - |
0.5534 | 1400 | 0.0088 | - |
0.5731 | 1450 | 0.001 | - |
0.5929 | 1500 | 0.0025 | - |
0.6126 | 1550 | 0.0006 | - |
0.6324 | 1600 | 0.0005 | - |
0.6522 | 1650 | 0.0006 | - |
0.6719 | 1700 | 0.0024 | - |
0.6917 | 1750 | 0.0725 | - |
0.7115 | 1800 | 0.1236 | - |
0.7312 | 1850 | 0.0006 | - |
0.7510 | 1900 | 0.001 | - |
0.7708 | 1950 | 0.0003 | - |
0.7905 | 2000 | 0.0003 | - |
0.8103 | 2050 | 0.0004 | - |
0.8300 | 2100 | 0.0004 | - |
0.8498 | 2150 | 0.0005 | - |
0.8696 | 2200 | 0.0003 | - |
0.8893 | 2250 | 0.0005 | - |
0.9091 | 2300 | 0.0003 | - |
0.9289 | 2350 | 0.0004 | - |
0.9486 | 2400 | 0.0005 | - |
0.9684 | 2450 | 0.0006 | - |
0.9881 | 2500 | 0.0007 | - |
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 Providers
NEW
This model is not currently available via any of the supported third-party Inference Providers, and
HF Inference API has been turned off for this model.