utterance
string
label
int64
test
0

Dream

This is a text classification dataset. It is intended for machine learning research and experimentation.

This dataset is obtained via formatting another publicly available data to be compatible with our AutoIntent Library.

Usage

It is intended to be used with our AutoIntent Library:

from autointent import Dataset

dream_ru = Dataset.from_datasets("AutoIntent/dream-ru")

Source

This dataset is taken from DeepPavlov Library's repository. It was formatted with our AutoIntent Library:

# define utils
import json
import requests
from autointent import Dataset

def load_json_from_github(github_file: str):
    raw_text = requests.get(github_file).text
    return json.loads(raw_text)

def convert_dream(dream_dict):
    intents = []
    for i, (intent_name, all_phrases) in enumerate(dream_dict["intent_phrases"].items()):
        intent_record = {
            "id": i,
            "name": intent_name,
            "tags": [],
            "regexp_full_match": all_phrases["phrases"],
            "regexp_partial_match": all_phrases.get("reg_phrases", []),
        }
        intents.append(intent_record)
    return Dataset.from_dict({"intents": intents, "train": [{"utterance": "test", "label": 0}]})

# load and format
github_file = "https://raw.githubusercontent.com/deeppavlov/dream/26ff1aaf1c9019c60b74468705bd6d9b7ebc5353/annotators/IntentCatcherTransformers/intent_phrases_RU.json"
dream = load_json_from_github(github_file)
dream_converted = convert_dream(dream)
Downloads last month
54