CoolFace
Modelpublic

Funnyworld1412/ABSA_bert-base_MiniLM-L6-polarity

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes7downloads
Model Card

SetFit Polarity Model with sentence-transformers/bert-base-nli-mean-tokens

This is a SetFit model that can be used for Aspect Based Sentiment Analysis (ABSA). This SetFit model uses sentence-transformers/bert-base-nli-mean-tokens as the Sentence Transformer embedding model. 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:

  1. 1.Fine-tuning a Sentence Transformer with contrastive learning.
  2. 2.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:

  1. 1.Use a spaCy model to select possible aspect span candidates.
  2. 2.Use a SetFit model to filter these possible aspect span candidates.
  3. 3.Use this SetFit model to classify the filtered aspect span candidates.

Model Details

Model Description

Model Sources

Model Labels

LabelExamples
negatif<ul><li>'seru tolong diperbaiki pencarian lawan bermain ketemu player:kapada supercell game nya bagus seru tolong diperbaiki pencarian lawan bermain ketemu player trophy mahkotanya jaraknya dapet berpengaruh peleton akun perbedaan level'</li><li>'bugnya nakal banget y:bugnya nakal banget y coc cr aja sukanya ngebug pas match suka hitam match relog kalo udah relog lawan udah 1 2 mahkota kecewa sih bintang nya 1 aja bug nya diurus bintang lawannya kadang g setara levelnya dahlah gk suka banget kalo main 2 vs 2 temen suka banget afk coba fitur report'</li><li>'kadang g setara levelnya dahlah gk suka:bugnya nakal banget y coc cr aja sukanya ngebug pas match suka hitam match relog kalo udah relog lawan udah 1 2 mahkota kecewa sih bintang nya 1 aja bug nya diurus bintang lawannya kadang g setara levelnya dahlah gk suka banget kalo main 2 vs 2 temen suka banget afk coba fitur report'</li></ul>
positif<ul><li>'kapada supercell game nya bagus seru:kapada supercell game nya bagus seru tolong diperbaiki pencarian lawan bermain ketemu player trophy mahkotanya jaraknya dapet berpengaruh peleton akun perbedaan level'</li><li>'fairrrr mending uninstall gamenya maen game yg:overall gamenya bagus pencarian match dikasih musuh yg levelnya levelku yg pertandingan fair menganggu kenyamanan pemainnya kalo nyariin musuh gapapa nyarinya kasih yg fair levelnya gaush buru buru ngasih yg gak fairrrr pas arena 4 udh dikasih musuh yg pletonnya 2 yg level 11 gak fairrrr mending uninstall gamenya maen game yg yg org gak fairr'</li><li>'gameplay menyenangkan pemain afk:gameplay menyenangkan pemain afk pertengahan menyerah 2vs2 mode mengganggu tolong tambahkan fitur lapor pemain'</li></ul>

Evaluation

Metrics

LabelAccuracy
all0.8478

Uses

Direct Use for Inference

First install the SetFit library:

bash
pip install setfit

Then you can load this model and run inference.

python
from setfit import AbsaModel

# Download from the 🤗 Hub
model = AbsaModel.from_pretrained(
    "Funnyworld1412/ABSA_bert-base_MiniLM-L6-aspect",
    "Funnyworld1412/ABSA_bert-base_MiniLM-L6-polarity",
)
# Run inference
preds = model("The food was great, but the venue is just way too busy.")

<!--

Downstream Use

List how someone could finetune this model on their own dataset. -->

<!--

Out-of-Scope Use

List how the model may foreseeably be misused and address what users ought not to do with the model. -->

<!--

Bias, Risks and Limitations

What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model. -->

<!--

Recommendations

What are recommendations with respect to the foreseeable issues? For example, filtering explicit content. -->

Training Details

Training Set Metrics

Training setMinMedianMax
Word count328.362683
LabelTraining Sample Count
negatif738
positif528

Training Hyperparameters

  • batch_size: (4, 4)
  • num_epochs: (1, 1)
  • max_steps: -1
  • sampling_strategy: oversampling
  • num_iterations: 5
  • bodylearningrate: (2e-05, 1e-05)
  • headlearningrate: 0.01
  • loss: CosineSimilarityLoss
  • distancemetric: cosinedistance
  • margin: 0.25
  • endtoend: False
  • use_amp: False
  • warmup_proportion: 0.1
  • seed: 42
  • evalmaxsteps: -1
  • loadbestmodelatend: False

Training Results

EpochStepTraining LossValidation Loss
0.000310.3075-
0.0158500.1854-
0.03161000.4431-
0.04741500.3251-
0.06322000.2486-
0.07902500.2371-
0.09483000.3149-
0.11063500.1397-
0.12644000.1131-
0.14224500.2388-
0.15805000.1256-
0.17385500.157-
0.18966000.3768-
0.20546500.022-
0.22127000.221-
0.23707500.122-
0.25288000.028-
0.26868500.102-
0.28449000.2231-
0.30029500.1853-
0.316010000.2167-
0.331810500.0054-
0.347611000.027-
0.363311500.0189-
0.379112000.0033-
0.394912500.2548-
0.410713000.0043-
0.426513500.0033-
0.442314000.0012-
0.458114500.1973-
0.473915000.0006-
0.489715500.001-
0.505516000.0002-
0.521316500.2304-
0.537117000.0005-
0.552917500.0025-
0.568718000.0185-
0.584518500.0023-
0.600319000.185-
0.616119500.0004-
0.631920000.0003-
0.647720500.0005-
0.663521000.0126-
0.679321500.0004-
0.695122000.0103-
0.710922500.0009-
0.726723000.0019-
0.742523500.0018-
0.758324000.1837-
0.774124500.002-
0.789925000.0003-
0.805725500.0006-
0.821526000.2006-
0.837326500.0003-
0.853127000.0006-
0.868927500.0003-
0.884728000.0001-
0.900528500.0002-
0.916329000.0003-
0.932129500.0002-
0.947930000.0003-
0.963730500.001-
0.979531000.0002-
0.995331500.0007-
1.03165-0.2256

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

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}
}

<!--

Glossary

Clearly define terms in order to be accessible across audiences. -->

<!--

Model Card Authors

Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction. -->

<!--

Model Card Contact

Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors. -->