flair.datasets.biomedical.Entity#
- class flair.datasets.biomedical.Entity(char_span, entity_type)View on GitHub#
Bases:
object
Internal class to represent entities while converting biomedical NER corpora to a standardized format.
Each entity consists of the char span it addresses in the original text as well as the type of entity (e.g. Chemical, Gene, and so on).
- __init__(char_span, entity_type)View on GitHub#
Methods
__init__
(char_span, entity_type)contains
(other_entity)Checks whether the given entity is fully contained in this entity.
is_before
(other_entity)Checks whether this entity is located before the given one.
overlaps
(other_entity)Checks whether this and the given entity overlap.
- is_before(other_entity)View on GitHub#
Checks whether this entity is located before the given one.
- Parameters:
other_entity – Entity to check
- Return type:
bool
- contains(other_entity)View on GitHub#
Checks whether the given entity is fully contained in this entity.
- Parameters:
other_entity – Entity to check
- Return type:
bool
- overlaps(other_entity)View on GitHub#
Checks whether this and the given entity overlap.
- Parameters:
other_entity – Entity to check
- Return type:
bool