Sshanu / Relation-Classification-using-Bidirectional-LSTM-Tree

TensorFlow Implementation of the paper "End-to-End Relation Extraction using LSTMs on Sequences and Tree Structures" and "Classifying Relations via Long Short Term Memory Networks along Shortest Dependency Paths" for classifying relations
MIT License
185 stars 41 forks source link

NLTK with corenlp #5

Closed LokiMask closed 6 years ago

LokiMask commented 6 years ago

hello when i use the path_extractor method in your code ,I catch a error with NLTK which says "NLTK was unable to find stanford-parser-(\d+)(.(\d+))+-models.jar!".However I set the corenlp jar to classpath before use it. The configuration of my environment is python 3.6, nltk 2.4 corenlp 3.8. I think there may be a mistake when i configure my environment, but i do not fix it. i hope you could give me some advise

Sshanu commented 6 years ago

Yeah, I got the same error after setting the path for the jar in my environment. So I set the path of the jar in path_to_jar.

from nltk.tokenize.stanford import StanfordTokenizer
path_to_jar = "/home/shanu/nltk/jars/stanford-postagger.jar"
tokenizer = StanfordTokenizer(path_to_jar)
LokiMask commented 6 years ago

thanks a lot