Currently I am working on PartOfSpeech(POS) tagging in Python using Stanford POStagger. I have set the java home
java_path = "Path to java bin"
os.environ['JAVAHOME'] = java_path
Below is my code
def getPOSandSentiment(sentence):
path_to_model = 'Path/to/Tagger/wsj-0-18-left3words-distsim.tagger'
path_to_jar = "path/to/stanford-postagger.jar"
tagger=StanfordPOSTagger(path_to_model, path_to_jar)
tagger.java_options='-mx2048m'
posWords = tagger.tag(sentence.split())
for words,pos in posWords:
print('Word : ',words)
print('POS :', pos)
Everytime I pass a sentence, The java.exe command prompt gets popped up. Is there any way to hide that command prompt? I am using Anaconda3 and spyder IDE for python. Is there any way to set Java_Home in Spyder or Anaconda? Thanks