PHP-Stanford-NLP icon indicating copy to clipboard operation
PHP-Stanford-NLP copied to clipboard

Empty Array Returned

Open saddy206 opened this issue 8 years ago • 6 comments

Hi, I am trying NERTagger and for that require_once 'StanfordNLP/Base.php'; require_once 'StanfordNLP/StanfordTagger.php'; require_once 'StanfordNLP/POSTagger.php'; require_once 'StanfordNLP/Exception.php'; require_once 'StanfordNLP/NERTagger.php'; $pos = new \StanfordNLP\NERTagger( '/var/www/html/api/stanford-ner-2015-12-09/classifiers/english.all.3class.distsim.crf.ser.gz', '/var/www/html/api/stanford-ner-2015-12-09/stanford-ner.jar' ); include('autoload.php'); $result = $pos->tag(explode(' ', "The Federal Reserve Bank of New York led by Timothy R. Geithner.")); var_dump($result); i wrote this much code but its returning me an empty array.

please help me with this issue.

saddy206 avatar Oct 12 '16 12:10 saddy206

Thanks the issue has been resolved by upgrading java version to "1.8.0_101"...........but now m getting Error: Could not find or load main class edu.stanford.nlp.ie.crf.CRFClassifier Can anybody plz help me with this issue?

saddy206 avatar Oct 13 '16 06:10 saddy206

saddy206: Try to use version of StanfordNLP 3.5.2 ( 2015-04-20)

NameIvan avatar Nov 01 '16 12:11 NameIvan

saddy206: How did you solve the empty array issue bc I have that problem!

Arya314 avatar May 16 '17 16:05 Arya314

You need to specify the full path to your models and jar files. Using a relative directory wont work.

Samshal avatar Mar 26 '18 09:03 Samshal

this should be an error not silent fail

yosun avatar Jun 22 '23 01:06 yosun

full path still does not work - empty array

yosun avatar Jun 22 '23 01:06 yosun