document
autocorpus.ac_bioc.document
¤
This module defines the BioCDocument class.
BioCDocument objects include a list of BioCPassage objects and provide a method to convert the document to a dictionary representation.
Classes¤
BioCDocument(id=str(), inputfile=str(), infons=dict(), passages=list(), relations=list(), annotations=list())
dataclass
¤
Bases: DataClassJsonMixin
Represents a BioC document containing passages, annotations, and relations.
Functions¤
from_xml(elem)
classmethod
¤
Create a BioCDocument instance from an XML element.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
elem
|
Element
|
An XML element representing the document. |
required |
Returns:
Name | Type | Description |
---|---|---|
BioCDocument |
BioCDocument
|
An instance of BioCDocument created from the XML element. |
Source code in autocorpus/ac_bioc/document.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
|
to_xml()
¤
Convert the BioCDocument instance to an XML element.
Returns:
Type | Description |
---|---|
Element
|
ET.Element: An XML element representing the document. |
Source code in autocorpus/ac_bioc/document.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
|