Views
No views yet
deberta-v3-base-absa-v1.1 delivers state-of-the-art accuracy for fine-grained sentiment analysis with the speed, efficiency, and simplicity of a classic encoder model. It represents a paradigm shift in production-ready AI: maximum performance with minimum operational burden.DeBERTa-v3 architecture and fine-tuned with advanced, context-aware methods from PyABSA, this model achieves top-tier accuracy on complex sentiment tasks.pipeline for a zero-effort implementation.1classifier = pipeline("text-classification", model="yangheng/deberta-v3-base-absa-v1.1")
2sentence = "The food was exceptional, although the service was a bit slow."1result_food = classifier(sentence, text_pair="food")
2result_food ->
3{
4 'Negative': 0.989
5 'Neutral': 0.008
6 'Positive': 0.003
7}1result_service = classifier("这部手机的性能差劲", text_pair="性能")
2result_service = classifier("这台汽车的引擎推力强劲", text_pair="引擎")pip install pyabsa1from pyabsa import AspectTermExtraction as ATEPC, available_checkpoints
2
3# Load the model directly from Hugging Face Hub
4aspect_extractor = ATEPC.AspectExtractor(
5 'multilingual', # Can be replaced with a specific checkpoint name or a local file path
6 auto_device=True, # Use GPU/CPU or Auto
7 cal_perplexity=True # Calculate text perplexity
8)
9texts = [
10 "这家餐厅的牛排很好吃,但是服务很慢。",
11 "The battery life is terrible but the camera is excellent."
12]
13# Perform end-to-end aspect-based sentiment analysis
14result = aspect_extractor.predict(
15 texts,
16 print_result=True, # Console Printing
17 save_result=False, # Save results into a json file
18 ignore_error=True, # Exception handling for error cases
19 pred_sentiment=True # Predict sentiment for extracted aspects
20)
21
22# The output automatically identifies aspects and their corresponding sentiments:
23# {
24# "text": "The user interface is brilliant, but the documentation is a total mess.",
25# "aspect": ["user interface", "documentation"],
26# "position": [[4, 19], [41, 54]],
27# "sentiment": ["Positive", "Negative"],
28# "probability": [[1e-05, 0.0001, 0.9998], [0.9998, 0.0001, 1e-05]],
29# "confidence": [0.9997, 0.9997]
30# }microsoft/deberta-v3-base, a highly optimized encoder known for its disentangled attention mechanism, which improves efficiency and performance over original BERT/RoBERTa models.1@inproceedings{YangCL23PyABSA,
2 author = {Heng Yang and Chen Zhang and Ke Li},
3 title = {PyABSA: {A} Modularized Framework for Reproducible Aspect-based Sentiment Analysis},
4 booktitle = {Proceedings of the 32nd {ACM} International Conference on Information and Knowledge Management, {CIKM} 2023},
5 pages = {5117--5122},
6 publisher = {{ACM}},
7 year = {2023},
8 doi = {10.1145/3583780.3614752}
9}
10
11@inproceedings{YangL24LCF/LCA,
12 author = {Heng Yang and
13 Ke Li},
14 editor = {Yvette Graham and
15 Matthew Purver},
16 title = {Modeling Aspect Sentiment Coherency via Local Sentiment Aggregation},
17 booktitle = {Findings of the Association for Computational Linguistics: {EACL}
18 2024, St. Julian's, Malta, March 17-22, 2024},
19 pages = {182--195},
20 publisher = {Association for Computational Linguistics},
21 year = {2024},
22 url = {https://aclanthology.org/2024.findings-eacl.13},
23 timestamp = {Tue, 23 Jul 2024 08:21:59 +0200},
24 biburl = {https://dblp.org/rec/conf/eacl/YangL24.bib},
25 bibsource = {dblp computer science bibliography, https://dblp.org}
26}