nlu.annotation.joint_bert.dataset

Dataset loading for training and evaluating the JointBERT model.

Module Contents

Classes

JointBERTDataset

Functions

load_yaml(→ Dict[str, List[str]])

Loads the YAML file at the given path.

parse_data(→ Generator[Tuple[str, str, List[str]], ...)

Parses the input data to extract intent, text, and slot annotations.

Attributes

DataPoint

nlu.annotation.joint_bert.dataset.DataPoint
nlu.annotation.joint_bert.dataset.load_yaml(path: str) Dict[str, List[str]]

Loads the YAML file at the given path.

Parameters:

path – The path to the YAML file.

Raises:

FileNotFoundError – If the file does not exist.

Returns:

The data in the YAML file.

nlu.annotation.joint_bert.dataset.parse_data(data: Dict[str, List[str]]) Generator[Tuple[str, str, List[str]], None, None]

Parses the input data to extract intent, text, and slot annotations.

Parameters:

data – The input data.

Yields:

A tuple of the intent, text, and slot annotations.

class nlu.annotation.joint_bert.dataset.JointBERTDataset(path: str, max_length: int = 32)

Bases: torch.utils.data.Dataset