Skip to content

Commit

Permalink
Merge pull request PaddlePaddle#187 from Steffy-zxf/fix-dataset
Browse files Browse the repository at this point in the history
relocation chnsenticorp & lcqmc dataset
  • Loading branch information
smallv0221 authored Mar 24, 2021
2 parents 37259f2 + bba70b7 commit d84c2bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions paddlenlp/datasets/experimental/chnsenticorp.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,12 @@ class ChnSentiCorp(DatasetBuilder):

def _get_data(self, mode, **kwargs):
"""Downloads dataset."""
default_root = DATA_HOME
default_root = os.path.join(DATA_HOME, self.__class__.__name__)
filename, data_hash = self.SPLITS[mode]
fullname = os.path.join(default_root, filename)
if not os.path.exists(fullname) or (data_hash and
not md5file(fullname) == data_hash):
path = get_path_from_url(self.URL, default_root, self.MD5)
fullname = os.path.join(default_root, filename)
get_path_from_url(self.URL, default_root, self.MD5)

return fullname

Expand Down
5 changes: 2 additions & 3 deletions paddlenlp/datasets/experimental/lcqmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,12 @@ class LCQMC(DatasetBuilder):
}

def _get_data(self, mode, **kwargs):
default_root = DATA_HOME
default_root = os.path.join(DATA_HOME, self.__class__.__name__)
filename, data_hash = self.SPLITS[mode]
fullname = os.path.join(default_root, filename)
if not os.path.exists(fullname) or (data_hash and
not md5file(fullname) == data_hash):
path = get_path_from_url(self.URL, default_root, self.MD5)
fullname = os.path.join(default_root, filename)
get_path_from_url(self.URL, default_root, self.MD5)

return fullname

Expand Down

0 comments on commit d84c2bb

Please sign in to comment.