yangheng95 / PyABSA

Sentiment Analysis, Text Classification, Text Augmentation, Text Adversarial defense, etc.;
https://pyabsa.readthedocs.io
MIT License
909 stars 153 forks source link

AttributeError: type object 'ATEPCCheckpointManager' has no attribute 'get_aspect_extractor' #51

Closed hitz02 closed 2 years ago

hitz02 commented 2 years ago

While trying to run ATEPCC example encountered this error.

Tried running the code in following sequence -

import pyabsa from pyabsa import ATEPCCheckpointManager

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 !' ]

sentiment_map = {0: 'Negative', 1: "Neutral", 2: 'Positive', -999: ''}

aspect_extractor = ATEPCCheckpointManager.get_aspect_extractor(checkpoint='lcf_atepc_cdw_apcacc_95.2_apcf1_94.28_atef1_90.49.zip', auto_device=True # False means load model on CPU )

Failed here - the ATEPCCheckpointManager doesn't have get_aspect_extractor attribute it says.

Let me know if I have missed anything here.

Version - 0.9.2.1

yangheng95 commented 2 years ago

Sorry to make this mistake, I should push the RC version into another branch, the examples available for 0.9.2.1 are in here

hitz02 commented 2 years ago

Thanks! this works