CoolFace
Modelpublic

Funnyworld1412/ABSA_mpnet_MiniLM-L6-aspect

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes5downloads
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.8317

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_mpnet_MiniLM-L6-aspect",
    "Funnyworld1412/ABSA_mpnet_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.2801-
0.0039500.2365-
0.00781000.1068-
0.01181500.3401-
0.01572000.2112-
0.01962500.3529-
0.02353000.2338-
0.02753500.2039-
0.03144000.2006-
0.03534500.2939-
0.03925000.2053-
0.04315500.2036-
0.04716000.2229-
0.05106500.105-
0.05497000.2222-
0.05887500.1815-
0.06278000.2915-
0.06678500.276-
0.07069000.1682-
0.07459500.2328-
0.078410000.2422-
0.082410500.2753-
0.086311000.2292-
0.090211500.0791-
0.094112000.3849-
0.098012500.0964-
0.102013000.1612-
0.105913500.2755-
0.109814000.1133-
0.113714500.038-
0.117615000.3195-
0.121615500.0091-
0.125516000.3148-
0.129416500.1693-
0.133317000.2411-
0.137317500.2463-
0.141218000.2807-
0.145118500.112-
0.149019000.2623-
0.152919500.2465-
0.156920000.4591-
0.160820500.0556-
0.164721000.0962-
0.168621500.4525-
0.172522000.2674-
0.176522500.1513-
0.180423000.3457-
0.184323500.1415-
0.188224000.0454-
0.192224500.0156-
0.196125000.2741-
0.225500.1334-
0.203926000.1838-
0.207826500.1346-
0.211827000.1022-
0.215727500.3999-
0.219628000.0953-
0.223528500.1201-
0.227529000.111-
0.231429500.1081-
0.235330000.1926-
0.239230500.1047-
0.243131000.2367-
0.247131500.2034-
0.251032000.0824-
0.254932500.0338-
0.258833000.2468-
0.262733500.0082-
0.266734000.0023-
0.270634500.1106-
0.274535000.1315-
0.278435500.004-
0.282436000.0836-
0.286336500.2716-
0.290237000.1873-
0.294137500.4066-
0.298038000.1448-
0.302038500.0137-
0.305939000.3471-
0.309839500.1144-
0.313740000.0596-
0.317640500.0377-
0.321641000.3316-
0.325541500.0709-
0.329442000.0515-
0.333342500.2029-
0.337343000.1191-
0.341243500.2397-
0.345144000.492-
0.349044500.1178-
0.352945000.3647-
0.356945500.0098-
0.360846000.2114-
0.364746500.2392-
0.368647000.2194-
0.372547500.0578-
0.376548000.0771-
0.380448500.1582-
0.384349000.0643-
0.388249500.1372-
0.392250000.0308-
0.396150500.1247-
0.451000.3076-
0.403951500.1152-
0.407852000.2112-
0.411852500.0042-
0.415753000.0869-
0.419653500.0196-
0.423554000.2406-
0.427554500.3306-
0.431455000.2328-
0.435355500.008-
0.439256000.0388-
0.443156500.3812-
0.447157000.6268-
0.451057500.4426-
0.454958000.1407-
0.458858500.297-
0.462759000.2657-
0.466759500.1767-
0.470660000.0152-
0.474560500.2344-
0.478461000.0447-
0.482461500.0675-
0.486362000.3086-
0.490262500.5258-
0.494163000.0826-
0.498063500.0079-
0.502064000.1817-
0.505964500.0767-
0.509865000.0221-
0.513765500.0419-
0.517666000.2452-
0.521666500.0232-
0.525567000.0804-
0.529467500.1752-
0.533368000.0127-
0.537368500.0454-
0.541269000.1759-
0.545169500.0435-
0.549070000.0109-
0.552970500.0162-
0.556971000.0133-
0.560871500.2363-
0.564772000.4987-
0.568672500.1149-
0.572573000.4613-
0.576573500.3837-
0.580474000.2439-
0.584374500.0014-
0.588275000.0177-
0.592275500.0051-
0.596176000.0418-
0.676500.0061-
0.603977000.2205-
0.607877500.1769-
0.611878000.0071-
0.615778500.2271-
0.619679000.3049-
0.623579500.0016-
0.627580000.2263-
0.631480500.0057-
0.635381000.1408-
0.639281500.0303-
0.643182000.0026-
0.647182500.1743-
0.651083000.2078-
0.654983500.1764-
0.658884000.0127-
0.662784500.2435-
0.666785000.0527-
0.670685500.247-
0.674586000.002-
0.678486500.0087-
0.682487000.1866-
0.686387500.0087-
0.690288000.1589-
0.694188500.1848-
0.698089000.0298-
0.702089500.0081-
0.705990000.3057-
0.709890500.2059-
0.713791000.2154-
0.717691500.0013-
0.721692000.1961-
0.725592500.0129-
0.729493000.0021-
0.733393500.2106-
0.737394000.0008-
0.741294500.1261-
0.745195000.1948-
0.749095500.013-
0.752996000.208-
0.756996500.2382-
0.760897000.0054-
0.764797500.1869-
0.768698000.0334-
0.772598500.0197-
0.776599000.0057-
0.780499500.0056-
0.7843100000.0043-
0.7882100500.0025-
0.7922101000.6808-
0.7961101500.043-
0.8102000.0536-
0.8039102500.2435-
0.8078103000.0051-
0.8118103500.0653-
0.8157104000.017-
0.8196104500.0036-
0.8235105000.1561-
0.8275105500.001-
0.8314106000.1975-
0.8353106500.2378-
0.8392107000.1276-
0.8431107500.0719-
0.8471108000.1951-
0.8510108500.0446-
0.8549109000.2045-
0.8588109500.0598-
0.8627110000.0094-
0.8667110500.1117-
0.8706111000.0528-
0.8745111500.0047-
0.8784112000.1492-
0.8824112500.2204-
0.8863113000.0089-
0.8902113500.0709-
0.8941114000.1111-
0.8980114500.0048-
0.9020115000.0173-
0.9059115500.2862-
0.9098116000.2745-
0.9137116500.0054-
0.9176117000.0074-
0.9216117500.0036-
0.9255118000.0869-
0.9294118500.2333-
0.9333119000.15-
0.9373119500.066-
0.9412120000.1742-
0.9451120500.0009-
0.9490121000.1246-
0.9529121500.1674-
0.9569122000.1937-
0.9608122500.0724-
0.9647123000.0044-
0.9686123500.0013-
0.9725124000.0313-
0.9765124500.0925-
0.9804125000.1742-
0.9843125500.2294-
0.9882126000.1073-
0.9922126500.038-
0.9961127000.1866-
1.0127500.01410.2274

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