openmind_datasets
介绍
openmind_datasets是一个基于datasets的轻量级数据集套件,提供了两个主要功能:
单行数据加载,适用于许多公共数据集:一行程序来下载和预处理主流的公共数据集(图片数据集、音频数据集、467种语言和方言的文本数据集等)。
高效数据预处理:为公共数据集以及本地数据集(CSV、JSON、文本、PNG、JPEG、WAV、MP3、Parquet等格式)提供简单、快速和可复制的数据预处理。
软件架构
软件架构说明
安装教程
pip install datasets==2.18.0
git clone https://gitee.com/openmind-ai/openmind-hub.git
cd openmind-hub
pip install -e .
cd ..
pip install openmind_datasets-*-py3-none-any.whl
使用说明
从hub下载数据集
from datasets import load_dataset
import openmind_datasets
# 直接加载
ds = load_dataset("AI_Connect/squad")
# 加载特定配置类
ds = load_dataset("AI_Connect/glue", "ax")
# 加载特定子集
ds = load_dataset("AI_Connect/wiki_qa", split="train")
加载方式与datasets保持一致。
上传数据集到hub
import datasets
import openmind_datasets
# 上传数据集到私人仓库
ds.push_to_hub("{user}/{dataset}", token="xxx")
其中user为用户id,dataset为数据集名称,token参数为openMind社区中用户登录后申请的访问令牌,令牌权限应包含Write权限。
适配mindspore
import datasets
import openmind_datasets
# 创建datasets.Dataset数据集对象
ds = ...
# 数据类型转为mindspore.Tensor
ds = ds.with_format("mindspore") # 支持别名ms
# 转为mindspore.dataset.Dataset对象
ms_ds = ds.to_ms_dataset(
columns=["inputs"], # columns需要根据实际数据集内容修改
label_cols=["labels"], # label_cols需要根据实际数据集内容修改
batch_size=2,
shuffle=True
)
ms_ds为ms.dataset.Dataset子类,可以直接传给mindspore模型训练。
Metrics
暂不支持,请使用openmind_evaluate。
其他功能
其余功能使用方式与开源Datasets使用一致,详情参考Datasets说明文档。
从源码构建
pip install build
python -m build
制品在dist/目录下。
公网地址声明
本代码仓包含公网地址,公开性声明请参考《公网地址声明》。
参与贡献
- Fork 本仓库
- 新建 Feat_xxx 分支
- 提交代码
- 新建 Pull Request
特技
- 使用 Readme_XXX.md 来支持不同的语言,例如 Readme_en.md, Readme_zh.md
- Gitee 官方博客 blog.gitee.com
- 你可以 https://gitee.com/explore 这个地址来了解 Gitee 上的优秀开源项目
- GVP 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
- Gitee 官方提供的使用手册 https://gitee.com/help
- Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 https://gitee.com/gitee-stars/
Metadata
Release files for openmind-datasets 0.7.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| openmind_datasets-0.7.1-py3-none-any.whl | Python 3 | none | any | Details |
Release files / openmind_datasets-0.7.1-py3-none-any.whl
| Download URL | openmind_datasets-0.7.1-py3-none-any.whl |
|---|---|
| Size | 23.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6c6b056c19c0de68d4f565392bdff549c56bd9fe089b73698e73fc47cc95086b
|
|
BLAKE2b-256 checksum How to use checksums |
7954ebaef67752ece1ffb084d954be0c205555a98757d425db88563365196421
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.3
|