-
Notifications
You must be signed in to change notification settings - Fork 1
/
NutShell.py
41 lines (30 loc) · 1.25 KB
/
NutShell.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
#===================================================================================================
# Tafadzwa Pasipanodya
# SYE
# The user interface for my summarization applications.
#===================================================================================================
import MMR_Summarizer
import LexRankSummarizer
import UserInputs
if __name__=='__main__':
mmr = MMR_Summarizer.MMR_Summarizer()
lexRank = LexRankSummarizer.LexRankSummarizer()
user = UserInputs.UserInputs()
print "Hello!\nEnter q to quit.\n"
while(True):
# get file path from user
path = user.getUserText(user.directory_path)
summary_length = user.getUserInt(user.summary_length)
# get a summarizer option
print user.summarizer_options
summarizer_option = user.getUserInt(user.option)
summary = []
if summarizer_option == 1:
query_length = user.getUserInt(user.query_length)
summary = mmr.main(query_length, summary_length, path)
elif summarizer_option ==2:
summary = lexRank.main(summary_length, path)
else:
print "Invalid option!"
for sent in summary:
print "\n", sent.getOGwords(), "\n"