forked from dice-group/Ontolearn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathontolearn_app.py
30 lines (24 loc) · 985 Bytes
/
ontolearn_app.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
"""
@TODO:CD: we should introduce ontolearn keyword to learn OWL Class expression from the command line.
"""
from ontolearn.model_adapter import execute
from main import get_default_arguments
# pyinstaller --onefile --collect-all owlready2 --exclude-module gradio --copy-metadata rich --recursive-copy-metadata transformers ontolearn_app.py
def exe(cmd):
print("\n---------------result---------------\n")
args_list = cmd.split()
execute(get_default_arguments(args_list))
print("\n------------------------------------\n")
command = input("\nEnter the arguments. E.g: --model celoe --knowledge_base_path some/path/to/kb \n\n"
"arguments: ")
exe(command)
while True:
command = input("\nEnter arguments again? [Y/n]\n")
if command is "Y":
command = input("\narguments: ")
exe(command)
elif command is "n":
print("\nterminating...")
break
else:
print("\nInvalid input. Please type 'Y' or 'n'\n")