CogComp / cogcomp-nlpy

CogComp's light-weight Python NLP annotators
http://nlp.cogcomp.org/
Other
116 stars 26 forks source link

KeyError: VIEW_NAME #76

Open nitishgupta opened 7 years ago

nitishgupta commented 7 years ago

Example: When a doc doesn't contain any Named Entity, the view_dictionary doesn't contain the key: NER_CONLL.

I think the key should still be present, but the cons_list should be empty.

In both cases, the user will need a check (check for key VS. check for empty list) and I not sure which is more standard. IMO, returning an empty list is more intuitive.

What ever you think is correct. @danyaljj

danyaljj commented 7 years ago

Returning an empty list sounds more standard to me too.

danyaljj commented 7 years ago

Do you want to send a PR with the fix?

nitishgupta commented 7 years ago

Sure. Let me do it and send a PR.

On Wed, Sep 6, 2017 at 2:00 PM, Daniel Khashabi notifications@github.com wrote:

Do you want to send a PR with the fix?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/CogComp/cogcomp-nlpy/issues/76#issuecomment-327564964, or mute the thread https://github.com/notifications/unsubscribe-auth/AF71bU6d1WpISiLAXlPR9AiB2FE8zh5vks5sft2rgaJpZM4POjON .

nitishgupta commented 6 years ago

@danyaljj @mssammon -- I checked and having a view with an empty constituent list gives error in Java. I guess we'll have to stick to this paradigm. I'll add a note in the REAMDE for cogcomp-nlpy to expect this behaviour and close this issue then. On a second thought, it is weird to not populate a view if a certain annotator is called. In current scenario, there would be no way to find out if there are no NERs in the text, or the NER_view was never tried to be populated.

danyaljj commented 6 years ago

Agreed with adding a note to the README and closing it.