stanfordnlp / CoreNLP

CoreNLP: A Java suite of core NLP tools for tokenization, sentence segmentation, NER, parsing, coreference, sentiment analysis, etc.
http://stanfordnlp.github.io/CoreNLP/
GNU General Public License v3.0
9.72k stars 2.7k forks source link

Stanford online NER tool vs stanford-ner-2016-10-31 cli tool #407

Closed dandelionred closed 7 years ago

dandelionred commented 7 years ago

I wonder why results at http://nlp.stanford.edu:8080/ner/ differ from those by the stanford-ner-2016-10-31 cli tool?

For example test string=HAHAHAHAHA

The online tool detects nothing with the 3-class classifier while the cli tool detects something

stanford-ner-2016-10-31$ ./ner.sh <(echo HAHAHAHAHA)
Invoked on Mon Apr 10 00:02:59 EEST 2017 with arguments: -loadClassifier ./classifiers/english.all.3class.distsim.crf.ser.gz -textFile /dev/fd/63
loadClassifier=./classifiers/english.all.3class.distsim.crf.ser.gz
textFile=/dev/fd/63
Loading classifier from ./classifiers/english.all.3class.distsim.crf.ser.gz ... done [1.5 sec].
HAHAHAHAHA/PERSON 
CRFClassifier tagged 1 words in 1 documents at 13.70 words per second.

Trying different samples I see the online tool performs better than the cli one.

Is it because the online tool's english.all.3class.distsim.crf.ser.gz model differs from the one bundled with stanford-ner-2016-10-31?

J38 commented 7 years ago

Yes the online demo is using an older model. At some point I should probably disable all of these older online demos from the past, because the real online demo is at: http://corenlp.run

As for the new model's error on this example, we are working on a new ner system which will hopefully not perform incorrectly on an example like this.

manning commented 7 years ago

In general we believe the newer model is more accurate. For example, here's a headline that the new model gets right that the old model didn't:

Star nurse Sue nominated for top accolade

But neither model is always going to be correct, and this tagging of "HAHAHAHAHA" is clearly unfortunateā€¦.