flambe.field.label

Module Contents

class flambe.field.label.LabelField(one_hot: bool = False, multilabel_sep: Optional[str] = None)[source]

Bases: flambe.field.text.TextField

Featurizes input labels.

The class also handles multilabel inputs and one hot encoding.

process(self, example)[source]

Featurize a single example.

Parameters:example (str) – The input label
Returns:A list of integer tokens
Return type:torch.Tensor