medkit.core.attribute
medkit.core.attribute#
Classes:
|
Medkit attribute, to be added to an annotation |
- class Attribute(label, value=None, metadata=None, uid=None)[source]#
Medkit attribute, to be added to an annotation
- Variables
label (str) – The attribute label
value (Optional[Any]) – The value of the attribute. Should be either simple built-in types (int, float, bool, str) or collections of these types (list, dict, tuple). If you need structured complex data you should create a subclass of Attribute.
metadata (Dict[str, Any]) – The metadata of the attribute
uid (str) – The identifier of the attribute
Methods:
copy()Create a new attribute that is a copy of the current instance, but with a new identifier
from_dict(attribute_dict)Creates an Attribute from a dict
to_brat()Return a value compatible with the brat format
to_spacy()Return a value compatible with spaCy