CogComp / cogcomp-nlp

CogComp's Natural Language Processing Libraries and Demos: Modules include lemmatizer, ner, pos, prep-srl, quantifier, question type, relation-extraction, similarity, temporal normalizer, tokenizer, transliteration, verb-sense, and more.
http://nlp.cogcomp.org/
Other
473 stars 142 forks source link

remove TextAnnotation.sentences #406

Open mssammon opened 7 years ago

mssammon commented 7 years ago

We have an explicit sentence view: make sure it is written out when serialized, and that it is read when deserialized. Remove TextAnnotation.sentences as Sentence data structure creates potential inconsistencies due to having its own views, in spite of holding a reference to a TextAnnotation object

danyaljj commented 7 years ago

I found a relatively good usage for Sentence datastructure:
https://gitlab-beta.engr.illinois.edu/cogcomp/illinois-comma-srl/blob/master/src/main/lbj/CommaClassifier.lbj#L199-282

mssammon commented 6 years ago

modified to separate the two issues. The sentences field still bothers me as it has created problems when end users accessed .sentences instead of the containing TextAnnotation, but maybe this is more a documentation issue.

mssammon commented 6 years ago

Just reasserting my vote to remove this duplicative field: changing the Sentence view requires an explicit call to TextAnnotation.setSentences() to update the .sentences field; if you forget, the TextAnnotation has inconsistent state between the view and the .sentences field. This affects e.g. the TextAnnotation.equals() behavior.