Datalabs
Project description
DataLab
Installation
Install
pip install --upgrade pip
pip install datalabs
or
# This is suitable for SDK developers
pip install --upgrade pip
git clone git@github.com:ExpressAI/DataLab.git
cd Datalab
pip install .
Dataset Operation
# pip install datalabs
from datalabs import operations, load_dataset
from featurize import *
dataset = load_dataset("ag_news")
# print(task schema)
print(dataset['test']._info.task_templates)
# data operators
res = dataset["test"].apply(get_text_length)
print(next(res))
# get entity
res = dataset["test"].apply(get_entities_spacy)
print(next(res))
# get postag
res = dataset["test"].apply(get_postag_spacy)
print(next(res))
from edit import *
# add typos
res = dataset["test"].apply(add_typo)
print(next(res))
# change person name
res = dataset["test"].apply(change_person_name)
print(next(res))
Task Schema
-
text-classification
text
:strlabel
:ClassLabel
-
text-matching
text1
:strtext2
:strlabel
:ClassLabel
-
summarization
text
:strsummary
:str
-
sequence-labeling
tokens
:List[str]tags
:List[ClassLabel]
-
question-answering-extractive
:context
:strquestion
:stranswers
:List[{"text":"","answer_start":""}]
one can use dataset[SPLIT]._info.task_templates
to get more useful task-dependent information, where
SPLIT
could be train
or validation
or test
.
Supported Datasets
Acknowledgment
DataLab originated from a fork of the awesome Huggingface Datasets and TensorFlow Datasets. We highly thank the Huggingface/TensorFlow Datasets for building this amazing library. More details on the differences between DataLab and them can be found in the section
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
datalabs-0.1.3.dev0.tar.gz
(293.8 kB
view hashes)
Built Distribution
Close
Hashes for datalabs-0.1.3.dev0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6553fec2376d414db93c1809d2843fc131dc983ebd312334dd747fc51f46e03 |
|
MD5 | ee9a6429484502030dc3ed473f060552 |
|
BLAKE2b-256 | d317fcec6a3981a53443090703c4da1efd91e90b2dfe41fe5288fd404fb819b9 |