Preventing Stanford Core NLP Server from outputting the text it receives -
i running stanford corenlp server:
java -mx4g -cp "*" edu.stanford.nlp.pipeline.stanfordcorenlpserver -port 9001 -timeout 50000
whenever receives text, outputs in shell running it. how prevent happening?
it matters, here code use pass data stanford core nlp server:
''' https://github.com/smilli/py-corenlp/blob/master/example.py ''' pycorenlp import stanfordcorenlp import pprint if __name__ == '__main__': nlp = stanfordcorenlp('http://localhost:9000') fp = open("long_text.txt") text = fp.read() output = nlp.annotate(text, properties={ 'annotators': 'tokenize,ssplit,pos,depparse,parse', 'outputformat': 'json' }) pp = pprint.prettyprinter(indent=4) pp.pprint(output)
there's not way this, you're second person that's asked. so, it's in github code, , make next release. future, should able set -quiet
flag, , server not write standard out.
Comments
Post a Comment