这个类型的话直接用git更方便点,参考如下操作方式:
参考数据集示例: https://modelscope.cn/datasets/wangxingjun778/yelpzip/files
- git clone https://www.modelscope.cn/datasets/jimmyliu12345/yelpzip.git
- 拷贝csv文件到yelpzip路径中
- 修改数据集同名json文件
- git lfs track *.csv
- git add/commit/push操作
- 验证:
from modelscope import MsDataset
ds = MsDataset.load('jimmyliu12345/yelpzip', split='train')
print(next(iter(ds)))
加载结果: {'Unnamed: 0': 0, 'user_id': 5044, 'prod_id': 0, 'rating': 1.0, 'label': -1, 'date': '2014-11-16', 'text': 'Drinks were bad, the hot chocolate was watered down and the latte had a burnt taste to it. The food was also poor quality, but the service was the worst part, their cashier was very rude.', 'tag': 'fake'} 此回答整理自钉群“魔搭ModelScope开发者联盟群 ①”