Aspect–Opinion–Sentiment (AOS) Triplet Prediction Model
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:
- Aspect (a ∈ 𝒜): the entity attribute or feature under discussion (e.g.,
room amenities) - Opinion (o ∈ 𝒪): the descriptive term or evaluative expression associated with the aspect (e.g.,
no) - Sentiment (s ∈ {−1, 0, 1}): the polarity of the opinion (negative, neutral, or positive)
For example:
Input: "No in-room coffeemakers or mini-fridges."
Output: [["room amenities", "no", "negative"]]
🚀 Colab Demo
Try the model interactively in Colab:
👉 Open the Colab Notebook
The demo notebook provides:
- Model loading & setup (via
transformers) - Simple inference function
- End-to-end examples for single and multi-triplet extraction
🧠 Usage
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)
✍️ Example Predictions
| 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"]] |
📌 Task: AOS Triplet Extraction
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:
- Aspect-based sentiment analysis
- Opinion summarization and retrieval
- Structuring noisy user-generated content into machine-readable triples
- Fine-grained evaluation pipelines for review summarization
These capabilities make it well-suited for opinion mining, sentiment analysis, aspect-based summarization, and downstream applications such as explainable review analysis.
🔸 Model Description
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:
- Aspect Relevance (AR) – checks whether key aspects in the evidence are preserved.
- Sentiment Factuality (SF) – verifies sentiment polarity alignment between evidence and generated text.
- Opinion Faithfulness (OF) – measures the semantic match between expressed opinions.
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.
⚠️ Limitations
- Predictions may sometimes merge or split phrases inconsistently for highly complex sentences.
- Neutral sentiment detection is supported but may be less frequent in typical review corpora.
- Domain transfer outside hotel/review language may require additional fine-tuning.
📎 Resources and Links
- Homepage: Website
- Paper: OpinioRAG: Towards Generating User-Centric Opinion Highlights from Large-scale Online Reviews - COLM 2025
- Demo: Colab Demo
📜 Citation
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},
}
- Downloads last month
- 193
Model tree for tafseer-nayeem/aspect-opinion-sentiment_AOS-triplet
Base model
allenai/tk-instruct-base-def-pos