やあ!それがあなたに役立つならば、このレポを主演させてください!それぞれの星は、Pyabsaがさらに進むのを助けます。 Pyabsaは、すべての人にとって無料でオープンソースツールですが、作品、製品、出版物などに(非公式または正式な)著者情報とプロジェクトアドレスを添付することを忘れないでください。
論文とは別に、Pyabsaには2つの新機能があります。アスペクトセンチメントトリプレット抽出とアスペクト四重抽出です。 Huggingfaceスペースにデモを展開しました。オンラインで試すことができます。
さまざまなタスクの多くの例を用意しています。より多くの使用例については、例を参照してください。
Pyabsaを使用するには、PIPまたはソースコードから最新バージョンをインストールします。
pip install -U pyabsagit clone https://github.com/yangheng95/PyABSA --depth=1
cd PyABSA
python setup.py install from pyabsa import AspectTermExtraction as ATEPC , available_checkpoints
# you can view all available checkpoints by calling available_checkpoints()
checkpoint_map = available_checkpoints ()
aspect_extractor = ATEPC . AspectExtractor ( 'multilingual' ,
auto_device = True , # False means load model on CPU
cal_perplexity = True ,
)
# instance inference
aspect_extractor . predict ([ 'I love this movie, it is so great!' ],
save_result = True ,
print_result = True , # print the result
ignore_error = True , # ignore the error when the model cannot predict the input
)
inference_source = ATEPC . ATEPCDatasetList . Restaurant16
atepc_result = aspect_extractor . batch_predict ( target_file = inference_source , #
save_result = True ,
print_result = True , # print the result
pred_sentiment = True , # Predict the sentiment of extracted aspect terms
)
print ( atepc_result )
from pyabsa import AspectPolarityClassification as APC , available_checkpoints
# you can view all available checkpoints by calling available_checkpoints()
checkpoint_map = available_checkpoints ( show_ckpts = True )
classifier = APC . SentimentClassifier ( 'multilingual' ,
auto_device = True , # False means load model on CPU
cal_perplexity = True ,
)
# instance inference
classifier . predict ([ 'I love this movie, it is so great!' ],
save_result = True ,
print_result = True , # print the result
ignore_error = True , # ignore the error when the model cannot predict the input
)
inference_source = APC . APCDatasetList . Laptop14
apc_result = classifier . batch_predict ( target_file = inference_source , #
save_result = True ,
print_result = True , # print the result
pred_sentiment = True , # Predict the sentiment of extracted aspect terms
)
print ( apc_result )ドキュメントを参照してください:pyabsaドキュメント。ドキュメントについて質問がある場合は、お気軽に問題を提起してください。また、ドキュメントを改善するために参加できます。
このリポジトリは、ABSA研究の論文に基づいています。実装のために引用または参照できる論文は次のとおりです。
ローカルコンテキストフォーカスの元の提案を探している場合は、ここにいくつかの紹介があります。
@inproceedings { YangZL23 ,
author = { Heng Yang and
Chen Zhang and
Ke Li } ,
editor = { Ingo Frommholz and
Frank Hopfgartner and
Mark Lee and
Michael Oakes and
Mounia Lalmas and
Min Zhang and
Rodrygo L. T. Santos } ,
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, Birmingham, United Kingdom,
October 21-25, 2023 } ,
pages = { 5117--5122 } ,
publisher = { {ACM} } ,
year = { 2023 } ,
url = { https://doi.org/10.1145/3583780.3614752 } ,
doi = { 10.1145/3583780.3614752 } ,
timestamp = { Thu, 23 Nov 2023 13:25:05 +0100 } ,
biburl = { https://dblp.org/rec/conf/cikm/0008ZL23.bib } ,
bibsource = { dblp computer science bibliography, https://dblp.org }
}このリポジトリは、Heng Yang(Yangheng95@Github)によって開発および維持されており、コミュニティの研究者から大きな貢献をしています。このプロジェクトの改善を支援できることを期待しており、貢献を歓迎します。以下を含む、さまざまな方法で貢献できます。
PyabsaはMITライセンスに基づいてリリースされます。このリポジトリ(または論文)を引用するか、作業(リポジトリ、ブログ、製品など)に著者情報を添付してください。