Improving Implicit Sentiment Learning via Local Sentiment Aggregation
Paper • 2110.08604 • Published • 1
ONNX export of yangheng/deberta-v3-large-absa-v1.1 — a state-of-the-art aspect-based sentiment analysis model built on microsoft/deberta-v3-large and fine-tuned with the PyABSA framework.
Same weights, exported to ONNX for faster CPU inference and easier deployment without a PyTorch dependency.
from optimum.onnxruntime import ORTModelForSequenceClassification
from transformers import AutoTokenizer, pipeline
onnxModelDirectory = "./onnx"
tokenizer = AutoTokenizer.from_pretrained(onnxModelDirectory)
onnxModel = ORTModelForSequenceClassification.from_pretrained(onnxModelDirectory)
absa_classifier = pipeline("text-classification", model=onnxModel, tokenizer=tokenizer)
sentence = "The food was exceptional, although the service was a bit slow."
foodSentiment = absa_classifier(sentence, text_pair="food")
serviceSentiment = absa_classifier(sentence, text_pair="service")
print(foodSentiment) # Positive
print(serviceSentiment) # Negative
| Label | Description |
|---|---|
| Positive | Positive sentiment toward the aspect |
| Neutral | Neutral sentiment toward the aspect |
| Negative | Negative sentiment toward the aspect |
MIT — see LICENSE.
Original work by Heng Yang. Copyright notice must be retained in all copies or substantial portions of the model/software.
@inproceedings{DBLP:conf/cikm/0008ZL23,
author = {Heng Yang and Chen Zhang and Ke Li},
title = {PyABSA: A Modularized Framework for Reproducible Aspect-based Sentiment Analysis},
booktitle = {Proceedings of the 32nd ACM International Conference on Information and Knowledge Management, CIKM 2023},
pages = {5117--5122},
publisher = {ACM},
year = {2023},
doi = {10.1145/3583780.3614752}
}
@article{YangZMT21,
author = {Heng Yang and Biqing Zeng and Mayi Xu and Tianxing Wang},
title = {Back to Reality: Leveraging Pattern-driven Modeling to Enable Affordable Sentiment Dependency Learning},
journal = {CoRR},
volume = {abs/2110.08604},
year = {2021},
url = {https://arxiv.org/abs/2110.08604}
}
Base model
yangheng/deberta-v3-large-absa-v1.1