CoolFace
Modelpublic

Funnyworld1412/ABSA_Roberta-large_MiniLM-L6-aspect

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

SetFit Aspect Model with sentence-transformers/all-MiniLM-L6-v2

This is a SetFit model that can be used for Aspect Based Sentiment Analysis (ABSA). This SetFit model uses sentence-transformers/all-MiniLM-L6-v2 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:

  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 this SetFit model to filter these possible aspect span candidates.
  3. 3.Use a SetFit model to classify the filtered aspect span candidates.

Model Details

Model Description

Model Sources

Model Labels

LabelExamples
aspect<ul><li>'pencarian lawan:kapada supercell game nya bagus seru tolong diperbaiki pencarian lawan bermain ketemu player trophy mahkotanya jaraknya dapet berpengaruh peleton akun perbedaan level'</li><li>'game: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: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>
no aspect<ul><li>'player trophy mahkotanya jaraknya:kapada supercell game nya bagus seru tolong diperbaiki pencarian lawan bermain ketemu player trophy mahkotanya jaraknya dapet berpengaruh peleton akun perbedaan level'</li><li>'peleton akun perbedaan level:kapada supercell game nya bagus seru tolong diperbaiki pencarian lawan bermain ketemu player trophy mahkotanya jaraknya dapet berpengaruh peleton akun perbedaan level'</li><li>'y coc cr: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>

Evaluation

Metrics

LabelAccuracy
all0.8307

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_Roberta-large_MiniLM-L6-aspect",
    "Funnyworld1412/ABSA_Roberta-large_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 count229.935780
LabelTraining Sample Count
no aspect3834
aspect1266

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.000110.2715-
0.0039500.2364-
0.00781000.1076-
0.01181500.3431-
0.01572000.2411-
0.01962500.361-
0.02353000.2227-
0.02753500.2087-
0.03144000.1956-
0.03534500.2815-
0.03925000.1844-
0.04315500.2053-
0.04716000.2884-
0.05106500.1043-
0.05497000.2074-
0.05887500.1627-
0.06278000.3-
0.06678500.1658-
0.07069000.1582-
0.07459500.2692-
0.078410000.1823-
0.082410500.4098-
0.086311000.1992-
0.090211500.0793-
0.094112000.3924-
0.098012500.0339-
0.102013000.2236-
0.105913500.2262-
0.109814000.111-
0.113714500.0223-
0.117615000.3994-
0.121615500.0417-
0.125516000.3319-
0.129416500.3223-
0.133317000.2943-
0.137317500.1273-
0.141218000.2863-
0.145118500.0988-
0.149019000.1593-
0.152919500.2209-
0.156920000.5017-
0.160820500.1392-
0.164721000.1372-
0.168621500.3491-
0.172522000.2693-
0.176522500.1988-
0.180423000.2765-
0.184323500.238-
0.188224000.0577-
0.192224500.2253-
0.196125000.16-
0.225500.0262-
0.203926000.0099-
0.207826500.0132-
0.211827000.2356-
0.215727500.2975-
0.219628000.154-
0.223528500.0308-
0.227529000.0497-
0.231429500.0523-
0.235330000.158-
0.239230500.0473-
0.243131000.208-
0.247131500.2126-
0.251032000.081-
0.254932500.0134-
0.258833000.1107-
0.262733500.0249-
0.266734000.0259-
0.270634500.1008-
0.274535000.0335-
0.278435500.0119-
0.282436000.2982-
0.286336500.1516-
0.290237000.1217-
0.294137500.1558-
0.298038000.0359-
0.302038500.0215-
0.305939000.2906-
0.309839500.0599-
0.313740000.1528-
0.317640500.0144-
0.321641000.298-
0.325541500.0174-
0.329442000.0093-
0.333342500.0329-
0.337343000.1795-
0.341243500.0712-
0.345144000.3703-
0.349044500.0873-
0.352945000.3223-
0.356945500.0045-
0.360846000.2188-
0.364746500.0085-
0.368647000.2089-
0.372547500.0052-
0.376548000.1459-
0.380448500.0711-
0.384349000.4268-
0.388249500.1842-
0.392250000.1661-
0.396150500.1028-
0.451000.067-
0.403951500.1708-
0.407852000.1001-
0.411852500.065-
0.415753000.0279-
0.419653500.1101-
0.423554000.1923-
0.427554500.5491-
0.431455000.0726-
0.435355500.0085-
0.439256000.194-
0.443156500.2527-
0.447157000.7134-
0.451057500.4542-
0.454958000.2779-
0.458858500.1024-
0.462759000.2483-
0.466759500.0163-
0.470660000.0095-
0.474560500.2902-
0.478461000.0111-
0.482461500.0296-
0.486362000.3792-
0.490262500.4387-
0.494163000.1547-
0.498063500.0617-
0.502064000.1384-
0.505964500.0677-
0.509865000.0454-
0.513765500.0074-
0.517666000.1994-
0.521666500.0168-
0.525567000.0416-
0.529467500.1898-
0.533368000.0207-
0.537368500.1046-
0.541269000.1994-
0.545169500.0435-
0.549070000.0149-
0.552970500.0067-
0.556971000.0122-
0.560871500.2406-
0.564772000.4473-
0.568672500.0469-
0.572573000.1782-
0.576573500.3386-
0.580474000.2804-
0.584374500.0072-
0.588275000.0451-
0.592275500.0188-
0.596176000.01-
0.676500.0048-
0.603977000.2349-
0.607877500.2052-
0.611878000.0838-
0.615778500.3052-
0.619679000.3667-
0.623579500.0044-
0.627580000.3612-
0.631480500.2082-
0.635381000.3384-
0.639281500.022-
0.643182000.0764-
0.647182500.2879-
0.651083000.1827-
0.654983500.1104-
0.658884000.2096-
0.662784500.2103-
0.666785000.0742-
0.670685500.2186-
0.674586000.0109-
0.678486500.0326-
0.682487000.3056-
0.686387500.0941-
0.690288000.3731-
0.694188500.2185-
0.698089000.0228-
0.702089500.0141-
0.705990000.2242-
0.709890500.3303-
0.713791000.2383-
0.717691500.0026-
0.721692000.1718-
0.725592500.053-
0.729493000.0023-
0.733393500.221-
0.737394000.0021-
0.741294500.2333-
0.745195000.0565-
0.749095500.0271-
0.752996000.2156-
0.756996500.2349-
0.760897000.0047-
0.764797500.1273-
0.768698000.0139-
0.772598500.0231-
0.776599000.0048-
0.780499500.0022-
0.7843100000.0026-
0.7882100500.0223-
0.7922101000.5488-
0.7961101500.0281-
0.8102000.0999-
0.8039102500.2154-
0.8078103000.0109-
0.8118103500.0019-
0.8157104000.1264-
0.8196104500.0029-
0.8235105000.3785-
0.8275105500.0366-
0.8314106000.0527-
0.8353106500.2355-
0.8392107000.0833-
0.8431107500.1612-
0.8471108000.0071-
0.8510108500.1128-
0.8549109000.2521-
0.8588109500.0403-
0.8627110000.2196-
0.8667110500.1441-
0.8706111000.0295-
0.8745111500.0047-
0.8784112000.3089-
0.8824112500.1055-
0.8863113000.0064-
0.8902113500.2119-
0.8941114000.2145-
0.8980114500.0128-
0.9020115000.0086-
0.9059115500.1803-
0.9098116000.2277-
0.9137116500.0204-
0.9176117000.0105-
0.9216117500.005-
0.9255118000.0099-
0.9294118500.004-
0.9333119000.1824-
0.9373119500.0021-
0.9412120000.2231-
0.9451120500.0017-
0.9490121000.0752-
0.9529121500.0129-
0.9569122000.1644-
0.9608122500.0305-
0.9647123000.0133-
0.9686123500.0687-
0.9725124000.0039-
0.9765124500.1179-
0.9804125000.1867-
0.9843125500.0225-
0.9882126000.1914-
0.9922126500.0592-
0.9961127000.0059-
1.0127500.10160.2295

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