timoschick / pet

This repository contains the code for "Exploiting Cloze Questions for Few-Shot Text Classification and Natural Language Inference"
https://arxiv.org/abs/2001.07676
Apache License 2.0
1.62k stars 285 forks source link

load_dataset function missing #73

Open YerongLi opened 2 years ago

YerongLi commented 2 years ago

Hi I am trying to run the generative model on CNN-dailymail, however I find this file is missing: datasets.py and in the tasks.py file we need load_dataset() function

# from datasets import load_dataset
class AeslcProcessor(GenerativeDataProcessor):
@staticmethod
def load_and_split_dataset(dataset_name: Union[str, Tuple[str]]):
    if isinstance(dataset_name, tuple):
        ds = load_dataset(*dataset_name)
    elif isinstance(dataset_name, dict):
        ds = load_dataset(**dataset_name)
    else:
        ds = load_dataset(dataset_name)

Anyone knows how to bypass this? where I can find the file datasets.py?

andreazaninello commented 2 years ago

Hi, I have the exact same issue while trying to reproduce the experiments for GenPET, as the 'datasets' module is missing. @timoschick could you help us with this? Thanks a lot

File "/home/azaninello/pet-feature-genpet/cli.py", line 24, in <module>
    import pet.config
  File "/home/azaninello/pet-feature-genpet/pet/__init__.py", line 1, in <module>
    from pet.modeling import *
  File "/home/azaninello/pet-feature-genpet/pet/modeling.py", line 25, in <module>
    from datasets import load_metric
ModuleNotFoundError: No module named 'datasets'
andreazaninello commented 2 years ago

Hi, I have the exact same issue while trying to reproduce the experiments for GenPET, as the 'datasets' module is missing. @timoschick could you help us with this? Thanks a lot

File "/home/azaninello/pet-feature-genpet/cli.py", line 24, in <module>
    import pet.config
  File "/home/azaninello/pet-feature-genpet/pet/__init__.py", line 1, in <module>
    from pet.modeling import *
  File "/home/azaninello/pet-feature-genpet/pet/modeling.py", line 25, in <module>
    from datasets import load_metric
ModuleNotFoundError: No module named 'datasets'

In fact, I realized that datasets is a Python library from Huggingface https://pypi.org/project/datasets/

If requirements.txt are correctly installed it should work fine. I realized that I had to set an environment with Python 3.6 to get the right versions of the required libraries.

Hope this helps