gatelfdata.targetnominal module

Module for the TargetNominal class

class gatelfdata.targetnominal.TargetNominal(meta, vocabs, targets_need_padding=False)[source]

Bases: object

idx2label(idx)[source]
set_as_onehot(flag=False)[source]

Influence hot the original class label is converted. If the flag is False, then the string is converted to the corresponding string index, otherwise, to the corresponding onehot vector.

zero_onehotvec()[source]

Returns a zero vector with as many 0 as the one-hot representation would have.