yangheng95 / PyABSA

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

RuntimeError: ['laptop14', 'restaurant14', 'restaurant16'] is not an integrated dataset, and it is not a path containing datasets! #62

Closed kunalverma75 closed 3 years ago

kunalverma75 commented 3 years ago

Running the PyABSA/examples/aspect_polarity_classification/train_apc.py on Google colab

Error on running: ------------

laptop14 dataset is not found locally, search at https://github.com/yangheng95/ABSADatasets restaurant14 dataset is not found locally, search at https://github.com/yangheng95/ABSADatasets restaurant16 dataset is not found locally, search at https://github.com/yangheng95/ABSADatasets Traceback (most recent call last): File "/content/PyABSA/examples/aspect_polarity_classification/train_apc.py", line 35, in auto_device=True # automatic choose CUDA or CPU File "/usr/local/lib/python3.7/dist-packages/pyabsa/functional/trainer/trainer.py", line 80, in init self.dataset_file = detect_dataset(dataset, task=self.task) File "/usr/local/lib/python3.7/dist-packages/pyabsa/utils/dataset_utils.py", line 68, in detect_dataset raise RuntimeError('{} is not an integrated dataset, and it is not a path containing datasets!'.format(dataset_path)) RuntimeError: ['laptop14', 'restaurant14', 'restaurant16'] is not an integrated dataset, and it is not a path containing datasets!

yangheng95 commented 3 years ago

Did the code download the datasets? i.e., does there exist the datasets cloned from https://github.com/yangheng95/ABSADatasets ? And when you run the example make sure the "dataset" dir name is not occupied in the current working path, which will prevent the downloading of the datasets.

To avoid some potential problem, please update the new version of related package if avaliable, using

pip install -U pyabsa
kunalverma75 commented 3 years ago

What is the path I should look if the code downloaded the dataset or not. I used pip install -U pyabsa on colab itself I'll try locally if this works or not

yangheng95 commented 3 years ago

That is the path where your training script is.

---Original--- From: @.> Date: Sat, Aug 21, 2021 20:16 PM To: @.>; Cc: @.**@.>; Subject: Re: [yangheng95/PyABSA] RuntimeError: ['laptop14', 'restaurant14', 'restaurant16'] is not an integrated dataset, and it is not a path containing datasets! (#62)

What is the path I should look if the code downloaded the dataset or not.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

kunalverma75 commented 3 years ago

Screenshot from 2021-08-21 18-14-27 This is the list of files where I am running the code. Should the dataset be downloaded here through the script or am I missing something? Sorry for the spam.

yangheng95 commented 3 years ago

Yes, the datasets should be downloaded automaticly in this folder. However, you can download the datasets manually here.

i.e., clone https://github.com/yangheng95/ABSADatasets into here

XuMayi commented 3 years ago

Hello, the possible cause of your problem is that there was a problem when downloading the dataset. You can restart the colab, and the environment of the colab will be reseted. Then you can reinstall the PyABSA by pip install -U pyabsa. When you train the models in PyABSA, our code will automatically download the dataset. Please ensure your dataset name as follow:

SemEval

Laptop14 = 'Laptop14'
Restaurant14 = 'Restaurant14'
Restaurant15 = 'Restaurant15'
Restaurant16 = 'Restaurant16'

# Twitter
ACL_Twitter = 'Twitter'

# Chinese
Phone = 'Phone'
Car = 'Car'
Notebook = 'Notebook'
Camera = 'Camera'
MAMS = 'MAMS'

# @R Mukherjee et al.
Television = 'Television'
TShirt = 'TShirt'

# assembled dataset_utils
Chinese = ['Chinese']
SemEval = ['laptop14', 'restaurant14', 'restaurant16']  
Restaurant = ['restaurant14', 'restaurant16']
Multilingual = 'Multilingual'
XuMayi commented 3 years ago

Attention please, You don't need to upload the pyabsa source code to Colab, only install the pyabsa by pip install -U pyabsa and use the scrip in examples.

XuMayi commented 3 years ago

Do not connect Colab to Google Drive, this may cause some problems.

kunalverma75 commented 3 years ago

Yes Dismounting the Google Drive Solved the problem. Datasets are now being downloaded correctly.