flair.data.DataPair#
- class flair.data.DataPair(first, second)View on GitHub#
Bases:
DataPoint
,Generic
[DT
,DT2
]- __init__(first, second)View on GitHub#
Methods
__init__
(first, second)add_label
(typename, value[, score])Adds a label to the
DataPoint
by internally creating aLabel
object.add_metadata
(key, value)clear_embeddings
([embedding_names])get_each_embedding
([embedding_names])get_embedding
([names])get_label
([label_type, zero_tag_value])get_labels
([typename])Returns all labels of this datapoint belonging to a specific annotation layer.
get_metadata
(key)has_label
(type)has_metadata
(key)remove_labels
(typename)set_embedding
(name, vector)set_label
(typename, value[, score])to
(device[, pin_memory])Attributes
labels
score
tag
- to(device, pin_memory=False)View on GitHub#
- clear_embeddings(embedding_names=None)View on GitHub#
- property embedding#
- property unlabeled_identifier#
- property start_position: int#
- property end_position: int#
- property text#