section
autocorpus.section
¤
Handles section processing for Auto-CORPus.
Modules used: - re: regular expression searching/replacing. - nltk: string tokenization - fuzzywuzzy: string-in-string ratio
Attributes¤
Classes¤
Functions¤
get_iao_term_mapping(section_heading)
¤
Get the IAO term mapping for a given section heading.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
section_heading
|
str
|
The name of the section heading. |
required |
Returns:
Type | Description |
---|---|
list[dict[str, str]]
|
The IAO term mapping for the section heading. |
Source code in autocorpus/section.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
|
get_iao_term_to_id_mapping(iao_term)
¤
Map IAO terms to IAO IDs.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
iao_term
|
str
|
IAO term to map to an IAO ID. |
required |
Returns:
Type | Description |
---|---|
dict[str, str]
|
A dictionary containing the IAO term and its corresponding ID |
Source code in autocorpus/section.py
120 121 122 123 124 125 126 127 128 129 130 131 |
|
get_section(config, section_dict)
¤
Identifies a section using the provided configuration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config
|
dict[str, dict[str, Any]]
|
AC configuration object. |
required |
section_dict
|
dict[str, Any]
|
Article section dictionary. |
required |
Source code in autocorpus/section.py
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 |
|
read_iao_term_to_id_file()
cached
¤
Parses the IAO_term_to_ID.txt file.
Returns:
Type | Description |
---|---|
dict[str, str]
|
Parsed IAO ids as a dictionary |
Source code in autocorpus/section.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
|
read_mapping_file()
cached
¤
Reads the IAO mapping file and parses it into a dictionary.
Returns:
Type | Description |
---|---|
dict[str, list[str]]
|
The parsed IAO mappings |
Source code in autocorpus/section.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
|