yangheng95 / LCF-ATEPC

codes for paper A Multi-task Learning Model for Chinese-oriented Aspect Polarity Classification and Aspect Term Extraction
MIT License
186 stars 45 forks source link

关于数据转换。 #33

Closed xu-2019 closed 3 years ago

xu-2019 commented 3 years ago

您好,我想做方面术语提取任务、想知道您的atepc- dataset格式是怎么转换的,应该看哪个py文件呢

yangheng95 commented 3 years ago

请参见我在PyABSA种的封装 https://github.com/yangheng95/PyABSA/blob/release/examples/aspect_term_extraction/basic_usage.py

xu-2019 commented 3 years ago

谢谢您,还有一个问题,我在谷歌云中上传整个文件后,pip install pyabsa,之后运行aspect_term_extraction/extract_aspects.py文件,出现错误如下: Traceback (most recent call last): File "examples/aspect_term_extraction/extract_aspects.py", line 8, in from pyabsa import load_aspect_extractor File "/usr/local/lib/python3.7/dist-packages/pyabsa/init.py", line 8, in from .functional import train_apc, load_sentiment_classifier File "/usr/local/lib/python3.7/dist-packages/pyabsa/functional.py", line 14, in from pyabsa.apc.inferring.sentiment_classifier import SentimentClassifier File "/usr/local/lib/python3.7/dist-packages/pyabsa/apc/inferring/sentiment_classifier.py", line 18, in from pyabsa.apc.models.lcf_bert import LCF_BERT File "/usr/local/lib/python3.7/dist-packages/pyabsa/apc/models/lcf_bert.py", line 11, in from pyabsa.encoder.sa_encoder import Encoder ModuleNotFoundError: No module named 'pyabsa.encoder'

尝试了安装该模块也不行,请问接下来怎么弄呀?

yangheng95 commented 3 years ago

感谢您的反馈,刚刚修复了这个问题,请更新版本pip install pyabsa==0.6.6.1

yangheng95 commented 3 years ago

我没有在谷歌云上测试过,如果遇到了其他问题欢迎反馈,感谢

xu-2019 commented 3 years ago

您好,刚才那个py文件还是不能正常运行,出现错误如下: Traceback (most recent call last): File "examples/aspect_term_extraction/extract_aspects.py", line 36, in auto_device=True # False means load model on CPU File "/usr/local/lib/python3.7/dist-packages/pyabsa/functional.py", line 136, in load_aspect_extractor raise RuntimeError('Not a valid model path!') RuntimeError: Not a valid model path!

我运行笔记本是GPU类型的

yangheng95 commented 3 years ago

您好,刚才那个py文件还是不能正常运行,出现错误如下: Traceback (most recent call last): File "examples/aspect_term_extraction/extract_aspects.py", line 36, in auto_device=True # False means load model on CPU File "/usr/local/lib/python3.7/dist-packages/pyabsa/functional.py", line 136, in load_aspect_extractor raise RuntimeError('Not a valid model path!') RuntimeError: Not a valid model path!

我运行笔记本是GPU类型的

请问您是否从Google Drive上下载了最新的模型并修改代码中模型的路径? https://drive.google.com/drive/folders/19DxUn0ahL6e8VB7bcJ-z_eFH3Pw_Jnn2

xu-2019 commented 3 years ago

我没有从Google Drive中下载,是刚从您github中下载封装的PyABSA,解压然后上传到从Google Drive中的,运行路径是examples/aspect_term_extraction/extract_aspects.py,您分享在Google Drive中的不是运行日志结果吗?

yangheng95 commented 3 years ago

我没有从Google Drive中下载,是刚从您github中下载封装的PyABSA,解压然后上传到从Google Drive中的,运行路径是examples/aspect_term_extraction/extract_aspects.py,您分享在Google Drive中的不是运行日志结果吗?

你运行的是抽取方面的脚本,需要加载已经训练的模型,我在Google drive上传了已训练了的模型。如果你准备训练模型请使用train开头的脚本。

yangheng95 commented 3 years ago

我没有从Google Drive中下载,是刚从您github中下载封装的PyABSA,解压然后上传到从Google Drive中的,运行路径是examples/aspect_term_extraction/extract_aspects.py,您分享在Google Drive中的不是运行日志结果吗?

image

yangheng95 commented 3 years ago

我没有从Google Drive中下载,是刚从您github中下载封装的PyABSA,解压然后上传到从Google Drive中的,运行路径是examples/aspect_term_extraction/extract_aspects.py,您分享在Google Drive中的不是运行日志结果吗?

image

训练模型请使用这几个示例脚本 image

xu-2019 commented 3 years ago

好的,谢谢您的耐心解答。

yangheng95 commented 3 years ago

好的,谢谢您的耐心解答。

不用谢,有反馈才能有改进,祝研究顺利!