flair.data.Relation#

class flair.data.Relation(first, second)View on GitHub#

Bases: _PartOfSentence

__init__(first, second)View on GitHub#

Methods

__init__(first, second)

add_label(typename, value[, score])

Adds a label to the DataPoint by internally creating a Label 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])

to_dict([tag_type])

Attributes

embedding

end_position

labels

score

start_position

tag

text

unlabeled_identifier

property tag#
property text#
property unlabeled_identifier: str#
property start_position: int#
property end_position: int#
property embedding#
to_dict(tag_type=None)View on GitHub#