-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
25 lines (20 loc) · 822 Bytes
/
main.py
File metadata and controls
25 lines (20 loc) · 822 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
from src.clinical_trials_preprocessing import preprocess_trials
from src.drugs_preprocessing import preprocess_drugs
from src.pubmed_preprocessing import preprocess_pubmed
from src.graph_creation import graph_creation
import json
def main():
# We preprocess the data
print("Preprocessing the data...")
trials_df = preprocess_trials("data/clinical_trials.csv")
drugs_df = preprocess_drugs("data/drugs.csv")
pubmed_df = preprocess_pubmed("Data/pubmed.csv", "Data/pubmed.json")
# We create the graph
print("Creating the graph...")
output_graph = graph_creation(drugs_df, trials_df, pubmed_df)
# We save the graph
with open("Data/graph.json", "w") as outfile:
json.dump(output_graph, outfile)
print("Pipeline execution finished.")
if __name__ == "__main__":
main()