Skip to main content

The openmind-datasets is a product which allows you to use datasets in modelers community.

Project description

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/目录下。

公网地址声明

本代码仓包含公网地址,公开性声明请参考《公网地址声明》

参与贡献

  1. Fork 本仓库
  2. 新建 Feat_xxx 分支
  3. 提交代码
  4. 新建 Pull Request

特技

  1. 使用 Readme_XXX.md 来支持不同的语言,例如 Readme_en.md, Readme_zh.md
  2. Gitee 官方博客 blog.gitee.com
  3. 你可以 https://gitee.com/explore 这个地址来了解 Gitee 上的优秀开源项目
  4. GVP 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
  5. Gitee 官方提供的使用手册 https://gitee.com/help
  6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 https://gitee.com/gitee-stars/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openmind_datasets-0.7.1-py3-none-any.whl (23.9 kB view details)

Uploaded Python 3

File details

Details for the file openmind_datasets-0.7.1-py3-none-any.whl.

File metadata

File hashes

Hashes for openmind_datasets-0.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6c6b056c19c0de68d4f565392bdff549c56bd9fe089b73698e73fc47cc95086b
MD5 c2da32339e62d48ee38f71b34dec01d1
BLAKE2b-256 7954ebaef67752ece1ffb084d954be0c205555a98757d425db88563365196421

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page