mmif.serialize module
mmif.serialize.model module
mmif.serialize.mmif module
mmif.serialize.view module
mmif.serialize.annotation module
The annotation
module contains the classes used to represent a
MMIF annotation as a live Python object.
In MMIF, annotations are created by apps in a pipeline as a part
of a view. For documentation on how views are represented, see
mmif.serialize.view
.
- class mmif.serialize.annotation.Annotation(anno_obj: bytes | str | dict | None = None)[source]
Bases:
FreezableMmifObject
MmifObject that represents an annotation in a MMIF view.
- add_property(name: str, value: str | int | float | bool | None | List[str | int | float | bool | None] | List[List[str | int | float | bool | None]]) None [source]
Adds a property to the annotation’s properties. :param name: the name of the property :param value: the property’s desired value :return: None
- class mmif.serialize.annotation.AnnotationProperties(mmif_obj: bytes | str | dict | None = None)[source]
Bases:
FreezableMmifObject
AnnotationProperties object that represents the
properties
object within a MMIF annotation.- Parameters:
mmif_obj – the JSON data that defines the properties
- class mmif.serialize.annotation.Document(doc_obj: bytes | str | dict | None = None)[source]
Bases:
Annotation
Document object that represents a single document in a MMIF file.
A document is identified by an ID, and contains certain attributes and potentially contains the contents of the document itself, metadata about how the document was created, and/or a list of subdocuments grouped together logically.
If
document_obj
is not provided, an empty Document will be generated.- Parameters:
document_obj – the JSON data that defines the document
- class mmif.serialize.annotation.DocumentProperties(mmif_obj: bytes | str | dict | None = None)[source]
Bases:
AnnotationProperties
DocumentProperties object that represents the
properties
object within a MMIF document.- Parameters:
mmif_obj – the JSON data that defines the properties