From 1f7e313b99ed5a7d9121debcc7c28a3d9343e54f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Di=C3=A9go=20Antolinos-Basso?= Date: Mon, 9 Nov 2015 15:53:42 +0100 Subject: [PATCH 1/2] Corrected parse_xml_output path error when looking for tmp output files --- corenlp/corenlp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/corenlp/corenlp.py b/corenlp/corenlp.py index f2c9a16..e28ed63 100644 --- a/corenlp/corenlp.py +++ b/corenlp/corenlp.py @@ -284,7 +284,7 @@ def parse_xml_output(input_dir, corenlp_path=DIRECTORY, memory="3g", raw_output= # result = [] try: for output_file in os.listdir(xml_dir): - with open(os.path.join(xml_dir + output_file), 'r') as xml: + with open(os.path.join(xml_dir, output_file), 'r') as xml: # parsed = xml.read() file_name = re.sub('.xml$', '', os.path.basename(output_file)) # result.append(parse_parser_xml_results(xml.read(), file_name, From ba4d04b08575dacb5dc3dee771d814cbc0728b39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Di=C3=A9go=20Antolinos-Basso?= Date: Mon, 9 Nov 2015 15:55:52 +0100 Subject: [PATCH 2/2] Supressed progress bar when loading modules in server (issue #11) --- corenlp/corenlp.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/corenlp/corenlp.py b/corenlp/corenlp.py index e28ed63..15738a1 100644 --- a/corenlp/corenlp.py +++ b/corenlp/corenlp.py @@ -314,22 +314,22 @@ def _spawn_corenlp(self): self.corenlp = pexpect.spawn(self.start_corenlp, maxread=8192, searchwindowsize=80) - # show progress bar while loading the models - if VERBOSE: - widgets = ['Loading Models: ', Fraction()] - pbar = ProgressBar(widgets=widgets, maxval=5, force_update=True).start() - # Model timeouts: - # pos tagger model (~5sec) - # NER-all classifier (~33sec) - # NER-muc classifier (~60sec) - # CoNLL classifier (~50sec) - # PCFG (~3sec) - timeouts = [20, 200, 600, 600, 20] - for i in xrange(5): - self.corenlp.expect("done.", timeout=timeouts[i]) # Load model - pbar.update(i + 1) - self.corenlp.expect("Entering interactive shell.") - pbar.finish() + # # show progress bar while loading the models + # if VERBOSE: + # widgets = ['Loading Models: ', Fraction()] + # pbar = ProgressBar(widgets=widgets, maxval=5, force_update=True).start() + # # Model timeouts: + # # pos tagger model (~5sec) + # # NER-all classifier (~33sec) + # # NER-muc classifier (~60sec) + # # CoNLL classifier (~50sec) + # # PCFG (~3sec) + # timeouts = [20, 200, 600, 600, 20] + # for i in xrange(5): + # self.corenlp.expect("done.", timeout=timeouts[i]) # Load model + # pbar.update(i + 1) + # self.corenlp.expect("Entering interactive shell.") + # pbar.finish() # interactive shell self.corenlp.expect("\nNLP> ")