def evaluate(self): """ Display all tweets collected for training """ self.process_tweets() cli = Cli() cli.training_title() for t in self.tweets: print "@%s say:" % t['user'] print "\n" print t['original'] cli.training() evaluation = cli.waiting_input() t['evaluation'] = evaluation[0] if t['evaluation'] != 4: self.tuples.append(t) cli.divider() cli.clear_terminal() cli.dashboard() return self.tuples
def training(): data = Storage('collected').load() tweets = Training(data).evaluate() Storage('trained').save(tweets) def prediction(): collect_files = Storage('collected').load() trained_files = Storage('trained').load() Mining(collect_files, trained_files).start() if __name__ == '__main__': """ Human-Machine Interface """ cli = Cli() start(cli) while cli.option != 'x': if cli.option == 'h': display_help(cli) elif cli.option == 'c' or cli.option == "collect": collect(cli) elif cli.option == 't' or cli.option == "training": training() elif cli.option == 'p' or cli.option == "prediction": prediction() elif cli.option == 'tweets': data = Storage('collected').load() cli.tweets_colleted(data) elif cli.option == 'tweets trained':
tweets = Training(data).evaluate() Storage('trained').save(tweets) def prediction(): collect_files = Storage('collected').load() trained_files = Storage('trained').load() Mining(collect_files, trained_files).start() if __name__ == '__main__': """ Human-Machine Interface """ cli = Cli() start(cli) while cli.option != 'x': if cli.option == 'h': display_help(cli) elif cli.option == 'c' or cli.option == "collect": collect(cli) elif cli.option == 't' or cli.option == "training": training() elif cli.option == 'p' or cli.option == "prediction": prediction() elif cli.option == 'tweets': data = Storage('collected').load() cli.tweets_colleted(data) elif cli.option == 'tweets trained':