flair.data.Image#

class flair.data.Image(data=None, imageURL=None)View on GitHub#

Bases: DataPoint

__init__(data=None, imageURL=None)View on GitHub#

Methods

__init__([data, imageURL])

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])

Attributes

embedding

end_position

labels

score

start_position

tag

text

unlabeled_identifier

property embedding#
property start_position: int#
property end_position: int#
property text: str#
property unlabeled_identifier: str#