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.69k stars 2.7k forks source link

Null Pointer Exception in CustomNER #937

Closed MakonDev closed 5 years ago

MakonDev commented 5 years ago

I'm working on upgrading from 3.7.0 to 3.9.2, but after upgrading, I've been receiving a Null Pointer Exception that's throwing an error. However, after debugging, I've identified this line https://github.com/stanfordnlp/CoreNLP/blob/eddd12c73a7d77ea723c44c3513dab350dc11175/src/edu/stanford/nlp/pipeline/EntityMentionsAnnotator.java#L330 as causing the null pointer. This is code decompiled from the CoreNLP jar files, but for some reason when I remove this line, the null pointer ceases to be an issue, although I'm not sure why the language check would cause a null pointer, but it's a blocker for now.

Any guidance on how to overcome this null pointer or why it could exist? Thanks!

AngledLuffa commented 5 years ago

FWIW this should already be fixed in the next version.

On Tue, Aug 20, 2019 at 6:08 AM Nick Sadler notifications@github.com wrote:

I'm working on upgrading from 3.7.0 to 3.9.2, but after upgrading, I've been receiving a Null Pointer Exception that's throwing an error. However, after debugging, I've identified this line ( https://github.com/stanfordnlp/CoreNLP/blob/eddd12c73a7d77ea723c44c3513dab350dc11175/src/edu/stanford/nlp/pipeline/EntityMentionsAnnotator.java#L330) as causing the null pointer. This is code decompiled from the CoreNLP jar files, but for some reason when I remove this line, the null pointer ceases to be an issue, although I'm not sure why the language check would cause a null pointer, but it's a blocker for now.

Any guidance on how to overcome this null pointer?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/stanfordnlp/CoreNLP/issues/937?email_source=notifications&email_token=AA2AYWIPN7SWXO5R2EHKBBTQFPUFXA5CNFSM4INWIKD2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HGHW6CA, or mute the thread https://github.com/notifications/unsubscribe-auth/AA2AYWKBDEBJM56GK2AOEE3QFPUFXANCNFSM4INWIKDQ .

AngledLuffa commented 5 years ago

If you don't want to recompile and/or wait for the new version, you can specify the language you are working on and it will not crash there.

ElliottYan commented 4 years ago

Hi @AngledLuffa , can you tell a bit more about how to specify language in command line? I met the same error when using ner for chinese in v3.9.2

AngledLuffa commented 4 years ago

Did you try these steps?

https://stanfordnlp.github.io/CoreNLP/human-languages.html

A new version should be released in a few days which includes the bugfixes I mentioned.

On Tue, Mar 17, 2020 at 1:27 AM ElliottYan notifications@github.com wrote:

Hi @AngledLuffa https://github.com/AngledLuffa , can you tell a bit more about how to specify language in command line? I met the same error when using ner for chinese in v3.9.2

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/stanfordnlp/CoreNLP/issues/937#issuecomment-599941306, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2AYWN7CSXE3AHO6L6UDULRH4YAJANCNFSM4INWIKDQ .