¡Hola! ¡Estrata este repositorio si te ayuda! Cada estrella ayuda a Pyabsa a ir más allá, muchas gracias. Pyabsa es una herramienta gratuita y de código abierto para todos, pero no olvide adjuntar la información (informal o formal) del autor y la dirección del proyecto en sus trabajos, productos y publicaciones, etc.
Además del documento, hay dos nuevas características en Pyabsa: extracción de triplete de sentimiento de aspecto y extracción cuádruple de aspecto. Hemos implementado las demostraciones en Huggingface Space, puede probarlas en línea.
Hemos preparado muchos ejemplos para diferentes tareas. Consulte ejemplos para obtener más ejemplos de uso.
Para usar Pyabsa, instale la última versión de PIP o código fuente:
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 )Consulte la documentación: documentación de Pyabsa. Si tiene alguna pregunta sobre los documentos, no dude en plantear un problema. Además, puede unirse para mejorar los documentos.
Este repositorio se basa en nuestros documentos para la investigación de ABSA. Estos son los documentos a los que puede citar o consultar para sus implementaciones:
Si está buscando la propuesta original de enfoque de contexto local, aquí hay alguna introducción aquí.
@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 }
}Este repositorio es desarrollado y mantenido por Heng Yang (Yangheng95@Github), con una gran contribución de los investigadores de la comunidad. Esperamos que pueda ayudarnos a mejorar este proyecto, y sus contribuciones son bienvenidas. Puede hacer una contribución de muchas maneras, incluyendo:
Pyabsa se publica bajo la licencia MIT, por favor cita este repositorio (o documentos) o adjunte la información del autor en su trabajo (repositorio, blog, producto, etc.)