Closed PGDesolator closed 10 years ago
Holy moly, spent like 6 hours resolving this particular issue and finally was able to solve it. The problem was that the code needs specification of the model.jar file as well i.e. "stanford-parser-3.3.0-models.jar". Therefore I had to edit the code to this in Parser.php at line 89-91
$otherJar= "stanford-parser-3.3.0-models.jar";
$cmd = $this->getJavaPath() . " $options -cp " . $this->getJar()
.";$otherJar "
." edu.stanford.nlp.parser.lexparser.LexicalizedParser "
. "-outputFormat \"".$this->getOutputFormat()."\" "
."-outputFormatOptions \"nonCollapsedDependencies\" "
.$parser." "
.$tmpfname
;
Trying to find some time to incorporate these issue changes into the codebase. Will try to do it soon. Thanks!
Hi, I had simillar issues with the POS and NER but was able to resolve them using samkool suggestion in the other thread. However, the format for command for the Parser is different and I'm having difficulties setting up the path. This is the output im getting when running the following code
<? require './NER/StanfordNLP/Base.php'; require './NER/StanfordNLP/Exception.php'; require './NER/StanfordNLP/Parser.php'; require './NER/StanfordNLP/StanfordTagger.php'; require './NER/StanfordNLP/NERTagger.php';
?> Output
array (size=3) 'wordsAndTags' => array (size=0) empty 'penn' => array (size=2) 'parent' => null 'children' => array (size=0) empty 'typedDependencies' => array (size=0) empty
object(StanfordNLP\Parser)[1] public 'output_format' => string 'wordsAndTags,penn,typedDependencies' (length=35) public 'lexicalized_parser' => boolean false protected 'java_path' => string 'java' (length=4) protected 'jar' => string 'C:/somepath/stanford-parser-full-2013-11-12/stanford-parser.jar' (length=103) protected 'java_options' => array (size=1) 0 => string '-mx300m' (length=7) protected 'output' => null protected 'errors' => string 'Error: Could not find or load main class edu.stanford.nlp.parser.lexparser.LexicalizedParser ' (length=94)