Downloads · 30 days
54
1% of all-time downloads
tafseer-nayeem/aspect-opinion-sentiment_AOS-triplet
aspect-opinion-sentiment_AOS-triplet is a text generation model from tafseer-nayeem. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
This model performs Aspect–Opinion–Sentiment (AOS) triplet extraction from textual inputs. Given a sentence (e.g., a user review), it decomposes the text into aspect, opinion, and sentiment polarity components, enabli…
Downloads · 30 days
54
1% of all-time downloads
All-time downloads
4.3K
Public
Repo size
4 GB
Likes
0
Public
Click a slice to open those files.
.bin990 MB · 100%
From the Hugging Face model README
This model performs Aspect–Opinion–Sentiment (AOS) triplet extraction from textual inputs. Given a sentence (e.g., a user review), it decomposes the text into aspect, opinion, and sentiment polarity components, enabling fine-grained structured understanding of opinions.
Each triplet consists of:
room amenities)no)For example:
Input: "No in-room coffeemakers or mini-fridges."
Output: [["room amenities", "no", "negative"]]
Try the model interactively in Colab:
👉 Open the Colab Notebook
The demo notebook provides:
transformers)You can load the model using the transformers library:
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
model_name = "tafseer-nayeem/aspect-opinion-sentiment_AOS-triplet"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
instruction = (
"Definition: The output will be the aspects (both implicit and explicit), "
"the corresponding opinion/describing terms, and the sentiment polarity (positive, negative, neutral). "
"Use the format aspect:opinion:sentiment. \n\n"
"Example 1-\n"
"input: Free Wi-Fi throughout the hotel\n"
"output: wi-fi:free:positive\n\n"
"Now complete the following example-\ninput: "
)
text = "The gym is outdated and the rooms are dirty."
inputs = tokenizer([instruction + text + " \noutput:"], return_tensors="pt")
outputs = model.generate(inputs.input_ids, max_new_tokens=250)
decoded = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(decoded)
| Input Sentence | Predicted Triplets |
|---|---|
| High parking fee. | [["parking", "high fee", "negative"]] |
| No in-room coffeemakers or flat screen TVs. | [["room amenities", "no", "negative"]] |
| Air conditioning was broken on the first night. | [["air conditioning", "broken", "negative"]] |
| Great location near two subway lines. | [["location", "great", "positive"]] |
| Free breakfast with fresh pastries and good coffee. | [["breakfast", "free", "positive"], ["pastries", "fresh", "positive"], ["coffee", "good", "positive"]] |
| The gym is outdated and the rooms are dirty. | [["gym", "outdated", "negative"], ["rooms", "dirty", "negative"]] |
| Front desk service was quick, although the elevator was slow. | [["front desk service", "quick", "positive"], ["elevator", "slow", "negative"]] |
This model is designed for triplet-level structured prediction, going beyond traditional sentence-level classification. It extracts structured Aspect–Opinion–Sentiment (AOS) triplets, enabling fine-grained understanding and analysis of textual content.
The model is particularly useful for:
These capabilities make it well-suited for opinion mining, sentiment analysis, aspect-based summarization, and downstream applications such as explainable review analysis.
This model is a sequence-to-sequence Transformer fine-tuned to extract Aspect–Opinion–Sentiment (AOS) triplets from text. Each sentence is decomposed into structured components of the form:
aspect:opinion:sentiment
where aspects represent entity attributes, opinions are descriptive expressions, and sentiments indicate polarity (positive, negative, or neutral). The model can extract multiple triplets per sentence and handles both explicit and implicit aspects.
In our paper, we employed AOS triplets to systematically decompose both retrieved evidence and generated highlights into structured components, enabling fine-grained and interpretable factual alignment. Specifically, the extracted triplets were compared across three dimensions:
This structured extraction and alignment form the basis of our reference-free, modular verification framework, allowing for interpretable evaluation and easy substitution with improved triplet models in the future.
If you use this model in your research or it's relevant to your work, please cite our COLM 2025 paper.
@inproceedings{nayeem2025opiniorag,
title={Opinio{RAG}: Towards Generating User-Centric Opinion Highlights from Large-scale Online Reviews},
author={Mir Tafseer Nayeem and Davood Rafiei},
booktitle={Second Conference on Language Modeling},
year={2025},
url={https://openreview.net/forum?id=R94bCTckhV}
}
@misc{nayeem2025opiniorag,
title={OpinioRAG: Towards Generating User-Centric Opinion Highlights from Large-scale Online Reviews},
author={Mir Tafseer Nayeem and Davood Rafiei},
year={2025},
eprint={2509.00285},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2509.00285},
}