forked from SystemsLab-Sapienza/TGDataset
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathselect_script.py
More file actions
27 lines (18 loc) · 763 Bytes
/
Copy pathselect_script.py
File metadata and controls
27 lines (18 loc) · 763 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
import cmd
from language_detection import perform_language_detection
from topic_modeling_LDA import perform_topic_modeling
class TGDatasetShell(cmd.Cmd):
intro = "Welcome to the TGDataset script explorer! Type help or ? to list commands."
prompt = '(TGDataset)'
def do_language_detection(self, arg):
'Starting language detection on the TGDataset'
perform_language_detection(*parse(arg))
def do_topic_modeling(self, arg):
'Starting Topic Modeling on the TGDataset'
perform_topic_modeling(*parse(arg))
return True
def parse(arg):
'Convert a series of zero or more numbers to an argument tuple'
return tuple(map(int, arg.split()))
if __name__ == '__main__':
TGDatasetShell().cmdloop()