-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
40 lines (32 loc) · 1.17 KB
/
main.py
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
39
40
import asyncio
import argparse
from crawl import crawl
from extract import extract
from cluster import cluster
from create import create
async def async_main(project_name, topic, sample_queries_file):
context = {
"project_name": project_name,
"topic": topic,
"sample_queries_file": sample_queries_file
}
print(context)
print("Started Crawling")
context = await crawl(context)
print("Started Extracting")
context = await extract(context)
print("Started Clustering")
context = await cluster(context)
print("Started Creating")
context = await create(context)
print("Successfully Created JSON")
print(context)
def main():
parser = argparse.ArgumentParser(description="Process some inputs.")
parser.add_argument("project_name", type=str, help="Name of the project")
parser.add_argument("topic", type=str, help="Topic of the project")
parser.add_argument("--sample_queries_file", type=str, help="Optional file containing sample queries")
args = parser.parse_args()
asyncio.run(async_main(args.project_name, args.topic, args.sample_queries_file))
if __name__ == "__main__":
main()