Package: pyabsa
PyABSA - Open Framework for Aspect-based Sentiment Analysis (paper)Hi, there!Please star this repo if it helps you! Each Star helps PyABSA go further, many thanks. PyABSA is a free
and open-source tool for everyone, but please do not forget to attach the (informal or formal) author
information and project address in your works, products and publications, etc.Try our demos on Huggingface SpaceApart from thepaper, there are two new features in PyABSA: Aspect sentiment triplet
extraction and Aspect quadruple extraction.
We have deployed the demos on Huggingface Space, you can try them online.Aspect sentiment quadruple extraction(English) New featureAspect sentiment triplet extraction(English) New feature(Gradio) Aspect term extraction & sentiment classification(
English, Chinese, Arabic, Dutch, French, Russian, Spanish, Turkish, etc.)(Prototype) Aspect term extraction & sentiment classification(
English,
Chinese, Arabic, Dutch, French, Russian, Spanish, Turkish, etc.)方面术语提取和情感分类（中文, etc.）Aspect-based sentiment classification (Multilingual)（English,
Chinese, etc.）Usage ExamplesWe have prepared many examples for different tasks. Please refer toExamplesfor more usage examples.Installationinstall via pipTo use PyABSA, install the latest version from pip or source code:pipinstall-Upyabsainstall via sourcegitclonehttps://github.com/yangheng95/PyABSA--depth=1cdPyABSApythonsetup.pyinstallQuick-StartExtract aspect terms and classify sentimentsfrompyabsaimportAspectTermExtractionasATEPC,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 CPUcal_perplexity=True,)# instance inferenceaspect_extractor.predict(['I love this movie, it is so great!'],save_result=True,print_result=True,# print the resultignore_error=True,# ignore the error when the model cannot predict the input)inference_source=ATEPC.ATEPCDatasetList.Restaurant16atepc_result=aspect_extractor.batch_predict(target_file=inference_source,#save_result=True,print_result=True,# print the resultpred_sentiment=True,# Predict the sentiment of extracted aspect terms)print(atepc_result)Aspect-based sentiment analysisfrompyabsaimportAspectPolarityClassificationasAPC,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 CPUcal_perplexity=True,)# instance inferenceclassifier.predict(['I love this movie, it is so great!'],save_result=True,print_result=True,# print the resultignore_error=True,# ignore the error when the model cannot predict the input)inference_source=APC.APCDatasetList.Laptop14apc_result=classifier.batch_predict(target_file=inference_source,#save_result=True,print_result=True,# print the resultpred_sentiment=True,# Predict the sentiment of extracted aspect terms)print(apc_result)Dataset Annotation and Model Trainingplease refer to the documentation:PyABSA Documentation.
If you have any questions about the docs, please feel free to raise an issue. Also, you can join to improve the docs.NoticeThis repository is based on our papers for ABSA research. Here are the papers that you can cite or refer to for your
implementations:Aspect sentiment polarity classification modelsBack to Reality: Leveraging Pattern-driven Modeling to Enable Affordable Sentiment Dependency Learning(
e.g., Fast-LSA, 2020)Learning for target-dependent sentiment based on local context-aware embedding(
e.g., LCA-Net, 2020)LCF: A Local Context Focus Mechanism for Aspect-Based Sentiment Classification(
e.g., LCF-BERT, 2019)Aspect sentiment polarity classification & Aspect term extraction modelsA multi-task learning model for Chinese-oriented aspect polarity classification and aspect term extraction] (
e.g., Fast-LCF-ATEPC, 2020)(Arxiv) A multi-task learning model for Chinese-oriented aspect polarity classification and aspect term extractionIf you are looking for the original proposal of local context focus, here are some introduction athere.Citation@article{YangL22,author={Heng Yang andKe Li},title={PyABSA: Open Framework for Aspect-based Sentiment Analysis},journal={CoRR},volume={abs/2208.01368},year={2022},url={https://doi.org/10.48550/arXiv.2208.01368},doi={10.48550/arXiv.2208.01368},eprinttype={arXiv},eprint={2208.01368},timestamp={Tue, 08 Nov 2022 21:46:32 +0100},biburl={https://dblp.org/rec/journals/corr/abs-2208-01368.bib},bibsource={dblp computer science bibliography, https://dblp.org}}ContributionThis repository is developed and maintained by HENG YANG (yangheng95@GitHub),
with great contribution from community researchers.
We expect that you can help us improve this project, and your contributions are welcome. You can make a contribution in
many ways, including:Share your custom dataset in PyABSA andABSADatasetsIntegrates your models in PyABSA. (You can share your models whether it is or not based on PyABSA. if you are
interested, we will help you)Raise a bug report while you use PyABSA or review the code (PyABSA is a individual project driven by enthusiasm so
your help is needed)Give us some advice about feature design/refactor (You can advise to improve some feature)Correct/Rewrite some error-messages or code comment (The comments are not written by native english speaker, you can
help us improve documents)Create an example script in a particular situation (Such as specify a SpaCy model, pretrained-bert type, some
hyper-parameters)Star this repository to keep it activeLicensePyABSA is released under MIT licence, please cite this repo (or papers) or attach the author information in your work
(repository, blog, product, etc.)