Entity
A labelled annotation over one or more spans (more than one = discontinuous).
Usage
Entity(
*, spans, label=None, id=None, concepts=(), attributes=None, metadata=None
)Equality and hashing use (label, spans) only: two entities over the same characters with the same label are the same entity, whatever their IDs, concepts or attributes.
Parameter Attributes
spans: Iterable[tuple[int, int]]label: str | None = Noneid: str | None = Noneconcepts: Iterable[Concept] = ()attributes: Mapping[str, str | bool] | None = Nonemetadata: Mapping[str, Any] | None = None
Attributes
| Name | Description |
|---|---|
| hull | The smallest single span covering all parts, gaps included. Not the extent. |
hull
The smallest single span covering all parts, gaps included. Not the extent.
hull: Span
Methods
| Name | Description |
|---|---|
| parts() | The covered text of each span. |
parts()
The covered text of each span.
Usage
parts(text)