-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
38 lines (28 loc) · 925 Bytes
/
main.py
File metadata and controls
38 lines (28 loc) · 925 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import configure
import postprocess
import preprocess
import relation_extractor
import attribute_extractor
import save_json
import entity_extraction
# retrieve the directory path and file paths
resource_path = configure.RESOURCE_PATH
data_file = configure.DATA_FILE
quickUMLS_file = configure.QUICKUMLS_FILE
# Press the green button in the gutter to run the script.
if __name__ == '__main__':
# configure the spacy
nlp = configure.spacy_config()
# preprocess
snippets = preprocess.run(data_file, nlp)
# extract treatment entities
entity_extraction.run(snippets, nlp)
# extract entity relationships
print('-' * 25 + 'extracting relationship' + '-' * 25)
relation_extractor.run(snippets)
# attribute extraction and association
attribute_extractor.run(snippets, nlp)
# postprocess
snippets = postprocess.run(snippets)
# save, outputs
save_json.run(snippets)