PyABSA 用于基于方面的情感分析

问题描述 投票:0回答:1

我正在研究基于方面的情感分析,并发现了这个不错的包 - PyABSA。 我发现版本 2 有问题,模型无法加载,所以我使用版本 1。

有一个小问题,它可以从 Google Drive 下载检查点。这意味着在多次通话后,Google 会阻止该 IP 地址拨打电话。可以选择下载检查点并手动使用它。

我不确定如何解决这个问题,或者手动下载时如何调用它,并且没有太多文档。只是想知道这里是否有人使用过并下载了检查点?

这是页面上的使用示例,展示了直接从网上下载时检查点的使用方式。

from pyabsa.functional import ATEPCCheckpointManager #actual line of code


examples = ['But the staff was so nice to us .',
            'But the staff was so horrible to us .',
            r'Not only was the food outstanding , but the little ` perks \' were great .',
            'It took half an hour to get our check , which was perfect since we could sit , have drinks and talk !',
            'It was pleasantly uncrowded , the service was delightful , the garden adorable , '
            'the food -LRB- from appetizers to entrees -RRB- was delectable .',
            'How pretentious and inappropriate for MJ Grill to claim that it provides power lunch and dinners !'
            ]

inference_source = ABSADatasetList.Restaurant14
aspect_extractor = ATEPCCheckpointManager.get_aspect_extractor(checkpoint='english')
atepc_result = aspect_extractor.extract_aspect(inference_source=inference_source,
                                               save_result=True,
                                               print_result=True,  # print the result
                                               pred_sentiment=True,  # Predict the sentiment of extracted aspect terms
                                               )
nlp huggingface-transformers sentiment-analysis
1个回答
0
投票

仅提供一个更新,说明这是由模型自动完成的。我遇到的问题似乎是无法创建一个允许模型在 Databricks 上正常运行的虚拟环境。

在本地 Jupyter 笔记本上运行模型可以自动下载检查点。

© www.soinside.com 2019 - 2024. All rights reserved.