CoolFace
Modelpublic

pahri/setfit-indo-resto-RM-ibu-imas-aspect

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

SetFit Aspect 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 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
no aspect<ul><li>'ambel leuncanya:ambel leuncanya enak terus pedesss'</li><li>'Warung Sunda:Warung Sunda murah meriah dan makanannya enak. Favorit selada air krispi dan ayam bakar'</li><li>'makanannya:Warung Sunda murah meriah dan makanannya enak. Favorit selada air krispi dan ayam bakar'</li></ul>
aspect<ul><li>'ayam bakar:Warung Sunda murah meriah dan makanannya enak. Favorit selada air krispi dan ayam bakar'</li><li>'Ayam bakar:Ayam bakar,sambel leunca sambel terasi merah enak banget 9/10, perkedel jagung 8/10 makan pakai sambel mantap. Makan berdua sekitar 77k'</li><li>'sambel terasi merah:Ayam bakar,sambel leunca sambel terasi merah enak banget 9/10, perkedel jagung 8/10 makan pakai sambel mantap. Makan berdua sekitar 77k'</li></ul>

Evaluation

Metrics

LabelAccuracy
all0.8063

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(
    "pahri/setfit-indo-resto-RM-ibu-imas-aspect",
    "pahri/setfit-indo-resto-RM-ibu-imas-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 count437.718093
LabelTraining Sample Count
no aspect371
aspect51

Training Hyperparameters

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

Training Results

EpochStepTraining LossValidation Loss
0.000010.4225-
0.0021500.2528-
0.00431000.3611-
0.00641500.2989-
0.00852000.2907-
0.01072500.1609-
0.01283000.3534-
0.01493500.1294-
0.01714000.2797-
0.01924500.3119-
0.02135000.004-
0.02355500.1057-
0.02566000.1049-
0.02776500.1601-
0.02997000.151-
0.03207500.1034-
0.03418000.2356-
0.03638500.1335-
0.03849000.0559-
0.04059500.0028-
0.042710000.1307-
0.044810500.0049-
0.046911000.1348-
0.049111500.0392-
0.051212000.054-
0.053312500.0016-
0.055513000.0012-
0.057613500.0414-
0.059714000.1087-
0.061814500.0464-
0.064015000.0095-
0.066115500.0011-
0.068216000.0002-
0.070416500.1047-
0.072517000.001-
0.074617500.0965-
0.076818000.0002-
0.078918500.1436-
0.081019000.0011-
0.083219500.001-
0.085320000.1765-
0.087420500.1401-
0.089621000.0199-
0.091721500.0-
0.093822000.0023-
0.096022500.0034-
0.098123000.0001-
0.100223500.0948-
0.102424000.1634-
0.104524500.0-
0.106625000.0005-
0.108825500.0695-
0.110926000.0-
0.113026500.0067-
0.115227000.0025-
0.117327500.0013-
0.119428000.1426-
0.121628500.0001-
0.123729000.0-
0.125829500.0-
0.128030000.0001-
0.130130500.0001-
0.132231000.0122-
0.134431500.0-
0.136532000.0001-
0.138632500.0041-
0.140833000.2549-
0.142933500.0062-
0.145034000.0154-
0.147234500.1776-
0.149335000.0039-
0.151435500.0183-
0.153636000.0045-
0.155736500.1108-
0.157837000.0002-
0.160037500.01-
0.162138000.0002-
0.164238500.0001-
0.166439000.1612-
0.168539500.0107-
0.170640000.0548-
0.172840500.0001-
0.174941000.0162-
0.177041500.1294-
0.179242000.0-
0.181342500.0032-
0.183443000.0051-
0.185543500.0-
0.187744000.0151-
0.189844500.0097-
0.191945000.0002-
0.194145500.0045-
0.196246000.0001-
0.198346500.0001-
0.200547000.0227-
0.202647500.0018-
0.204748000.0-
0.206948500.0001-
0.209049000.0-
0.211149500.0-
0.213350000.0-
0.215450500.0002-
0.217551000.0002-
0.219751500.0038-
0.221852000.0-
0.223952500.0-
0.226153000.0-
0.228253500.0028-
0.230354000.0-
0.232554500.1146-
0.234655000.0-
0.236755500.0073-
0.238956000.0467-
0.241056500.0092-
0.243157000.0196-
0.245357500.0002-
0.247458000.0043-
0.249558500.0378-
0.251759000.0049-
0.253859500.0054-
0.255960000.1757-
0.258160500.0-
0.260261000.0001-
0.262361500.1327-
0.264562000.0-
0.266662500.0-
0.268763000.0-
0.270963500.0134-
0.273064000.0001-
0.275164500.0112-
0.277365000.0864-
0.279465500.0-
0.281566000.0094-
0.283766500.1358-
0.285867000.0155-
0.287967500.0025-
0.290168000.0002-
0.292268500.0001-
0.294369000.2809-
0.296569500.0-
0.298670000.0242-
0.300770500.0015-
0.302871000.0-
0.305071500.1064-
0.307172000.1636-
0.309272500.267-
0.311473000.1656-
0.313573500.0943-
0.315674000.189-
0.317874500.0055-
0.319975000.1286-
0.322075500.1062-
0.324276000.1275-
0.326376500.0101-
0.328477000.0162-
0.330677500.0001-
0.332778000.0001-
0.334878500.0003-
0.337079000.0-
0.339179500.135-
0.341280000.0-
0.343480500.0125-
0.345581000.0004-
0.347681500.0-
0.349882000.2229-
0.351982500.0-
0.354083000.0051-
0.356283500.0-
0.358384000.0001-
0.360484500.0-
0.362685000.1261-
0.364785500.0054-
0.366886000.1636-
0.369086500.0036-
0.371187000.0-
0.373287500.0027-
0.375488000.0-
0.377588500.1422-
0.379689000.1314-
0.381889500.003-
0.383990000.0-
0.386090500.0092-
0.388291000.0129-
0.390391500.0-
0.392492000.0-
0.394692500.1659-
0.396793000.0-
0.398893500.0-
0.401094000.0085-
0.403194500.0-
0.405295000.0-
0.407495500.0-
0.409596000.0112-
0.411696500.0-
0.413897000.0154-
0.415997500.0011-
0.418098000.0077-
0.420298500.0064-
0.422399000.0-
0.424499500.0-
0.4265100000.0121-
0.4287100500.0-
0.4308101000.0-
0.4329101500.0076-
0.4351102000.0039-
0.4372102500.2153-
0.4393103000.0-
0.4415103500.1218-
0.4436104000.0077-
0.4457104500.1311-
0.4479105000.0-
0.4500105500.0-
0.4521106000.0-
0.4543106500.0041-
0.4564107000.0073-
0.4585107500.0051-
0.4607108000.0-
0.4628108500.0-
0.4649109000.0-
0.4671109500.0001-
0.4692110000.0-
0.4713110500.1696-
0.4735111000.0-
0.4756111500.1243-
0.4777112000.0-
0.4799112500.0-
0.4820113000.0003-
0.4841113500.0707-
0.4863114000.166-
0.4884114500.4964-
0.4905115000.0023-
0.4927115500.0-
0.4948116000.0-
0.4969116500.173-
0.4991117000.0-
0.5012117500.0004-
0.5033118000.0-
0.5055118500.125-
0.5076119000.0042-
0.5097119500.012-
0.5119120000.0046-
0.5140120500.0001-
0.5161121000.0062-
0.5183121500.0-
0.5204122000.017-
0.5225122500.2668-
0.5247123000.0986-
0.5268123500.0071-
0.5289124000.0055-
0.5311124500.006-
0.5332125000.0057-
0.5353125500.0044-
0.5375126000.0039-
0.5396126500.1685-
0.5417127000.125-
0.5438127500.0026-
0.5460128000.0-
0.5481128500.0-
0.5502129000.1024-
0.5524129500.0-
0.5545130000.0-
0.5566130500.0083-
0.5588131000.0-
0.5609131500.0001-
0.5630132000.0-
0.5652132500.095-
0.5673133000.0001-
0.5694133500.0026-
0.5716134000.0-
0.5737134500.0041-
0.5758135000.1654-
0.5780135500.0003-
0.5801136000.0056-
0.5822136500.0-
0.5844137000.1012-
0.5865137500.0-
0.5886138000.0001-
0.5908138500.0042-
0.5929139000.0122-
0.5950139500.1047-
0.5972140000.0-
0.5993140500.0121-
0.6014141000.0-
0.6036141500.0-
0.6057142000.0-
0.6078142500.0105-
0.6100143000.0-
0.6121143500.011-
0.6142144000.0329-
0.6164144500.0942-
0.6185145000.0173-
0.6206145500.0-
0.6228146000.1032-
0.6249146500.016-
0.6270147000.0079-
0.6292147500.0-
0.6313148000.1088-
0.6334148500.0091-
0.6356149000.0039-
0.6377149500.0-
0.6398150000.0-
0.6420150500.0-
0.6441151000.1654-
0.6462151500.0-
0.6484152000.0002-
0.6505152500.0-
0.6526153000.1745-
0.6548153500.0-
0.6569154000.156-
0.6590154500.0-
0.6611155000.0-
0.6633155500.1755-
0.6654156000.008-
0.6675156500.0-
0.6697157000.0-
0.6718157500.0041-
0.6739158000.0037-
0.6761158500.0-
0.6782159000.0-
0.6803159500.0092-
0.6825160000.0071-
0.6846160500.0053-
0.6867161000.0-
0.6889161500.004-
0.6910162000.0036-
0.6931162500.0-
0.6953163000.0-
0.6974163500.184-
0.6995164000.0-
0.7017164500.0133-
0.7038165000.0-
0.7059165500.174-
0.7081166000.0-
0.7102166500.0233-
0.7123167000.0117-
0.7145167500.0272-
0.7166168000.0095-
0.7187168500.0-
0.7209169000.1656-
0.7230169500.0055-
0.7251170000.0-
0.7273170500.1716-
0.7294171000.0-
0.7315171500.0-
0.7337172000.1035-
0.7358172500.0694-
0.7379173000.1733-
0.7401173500.0092-
0.7422174000.1656-
0.7443174500.0-
0.7465175000.1655-
0.7486175500.0059-
0.7507176000.1116-
0.7529176500.0-
0.7550177000.0068-
0.7571177500.0053-
0.7593178000.0-
0.7614178500.0062-
0.7635179000.0104-
0.7657179500.1727-
0.7678180000.0-
0.7699180500.0-
0.7721181000.0-
0.7742181500.0714-
0.7763182000.0-
0.7785182500.0-
0.7806183000.0002-
0.7827183500.0-
0.7848184000.0-
0.7870184500.0996-
0.7891185000.0-
0.7912185500.0-
0.7934186000.0139-
0.7955186500.0-
0.7976187000.1701-
0.7998187500.0-
0.8019188000.0001-
0.8040188500.0-
0.8062189000.0-
0.8083189500.0-
0.8104190000.0-
0.8126190500.0-
0.8147191000.1093-
0.8168191500.0-
0.8190192000.0-
0.8211192500.0075-
0.8232193000.1079-
0.8254193500.0112-
0.8275194000.1655-
0.8296194500.0152-
0.8318195000.1152-
0.8339195500.0-
0.8360196000.0-
0.8382196500.0079-
0.8403197000.0-
0.8424197500.0-
0.8446198000.0-
0.8467198500.0-
0.8488199000.1161-
0.8510199500.0057-
0.8531200000.0-
0.8552200500.0046-
0.8574201000.0-
0.8595201500.0068-
0.8616202000.0-
0.8638202500.0-
0.8659203000.0-
0.8680203500.0-
0.8702204000.0141-
0.8723204500.0001-
0.8744205000.0-
0.8766205500.0-
0.8787206000.0171-
0.8808206500.0-
0.8830207000.0-
0.8851207500.0077-
0.8872208000.0-
0.8894208500.0-
0.8915209000.0-
0.8936209500.0-
0.8958210000.0-
0.8979210500.0-
0.9000211000.0-
0.9021211500.0-
0.9043212000.0-
0.9064212500.1048-
0.9085213000.006-
0.9107213500.0-
0.9128214000.0-
0.9149214500.005-
0.9171215000.0-
0.9192215500.0325-
0.9213216000.0136-
0.9235216500.0-
0.9256217000.0062-
0.9277217500.1656-
0.9299218000.1648-
0.9320218500.0-
0.9341219000.0-
0.9363219500.0-
0.9384220000.2844-
0.9405220500.0-
0.9427221000.0-
0.9448221500.0-
0.9469222000.0-
0.9491222500.0-
0.9512223000.2096-
0.9533223500.0073-
0.9555224000.006-
0.9576224500.0-
0.9597225000.0079-
0.9619225500.0071-
0.9640226000.0-
0.9661226500.006-
0.9683227000.1048-
0.9704227500.007-
0.9725228000.0-
0.9747228500.0-
0.9768229000.007-
0.9789229500.0-
0.9811230000.1049-
0.9832230500.0069-
0.9853231000.0-
0.9875231500.0-
0.9896232000.0-
0.9917232500.0-
0.9939233000.007-
0.9960233500.0147-
0.9981234000.0-

Framework Versions

  • —Python: 3.10.13
  • —SetFit: 1.0.3
  • —Sentence Transformers: 2.7.0
  • —spaCy: 3.7.4
  • —Transformers: 4.36.2
  • —PyTorch: 2.1.2
  • —Datasets: 2.18.0
  • —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. -->