Open wangying15 opened 1 year ago
我用的是最新2.3.3版本了,麻烦大佬看看是什么问题呢?
尝试了https://pyabsa.readthedocs.io/en/stable/6_tutorials/Aspect_Term_Extraction.html提供的: from pyabsa import ModelSaveOption, DeviceTypeOption import warnings
warnings.filterwarnings("ignore")
config.batch_size = 16 config.patience = 2 config.log_step = -1 config.seed = [1] config.verbose = False # If verbose == True, PyABSA will output the model strcture and seversal processed data examples config.notice = ( "This is an training example for aspect term extraction" # for memos usage )
NameError Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_22276\2525470414.py in
NameError: name 'config' is not defined
pyabsa.functional属于1.x 版本的用法,你可以查看新用法或者降级到1.x版本,例如 pip install pyabsa<2.0 -U
谢谢!请问这个问题也是同样的原因吗?
尝试了https://pyabsa.readthedocs.io/en/stable/6_tutorials/Aspect_Term_Extraction.html提供的: from pyabsa import ModelSaveOption, DeviceTypeOption import warnings
warnings.filterwarnings("ignore")
config.batch_size = 16 config.patience = 2 config.log_step = -1 config.seed = [1] config.verbose = False # If verbose == True, PyABSA will output the model strcture and seversal processed data examples config.notice = ( "This is an training example for aspect term extraction" # for memos usage )
trainer = ATEPC.ATEPCTrainer( config=config, dataset=dataset, from_checkpoint="english", # if you want to resume training from our pretrained checkpoints, you can pass the checkpoint name here auto_device=DeviceTypeOption.AUTO, # use cuda if available checkpoint_save_mode=ModelSaveOption.SAVE_MODEL_STATE_DICT, # save state dict only instead of the whole model load_aug=False, # there are some augmentation dataset for integrated datasets, you use them by setting load_aug=True to improve performance ) NameError Traceback (most recent call last) ~\AppData\Local\Temp\ipykernel_22276\2525470414.py in 4 warnings.filterwarnings("ignore") 5 ----> 6 config.batch_size = 16 7 config.patience = 2 8 config.log_step = -1
NameError: name 'config' is not defined
ModuleNotFoundError Traceback (most recent call last) ~\AppData\Local\Temp\ipykernel_22276\1578182218.py in
3 import findfile
4
----> 5 from pyabsa.functional import ATEPCModelList
6 from pyabsa.functional import Trainer, ATEPCTrainer
7 from pyabsa.functional import ABSADatasetList
ModuleNotFoundError: No module named 'pyabsa.functional'