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

Why two ViewNames in json files? #578

Open danyaljj opened 7 years ago

danyaljj commented 7 years ago

Why there are two "ViewName"s in jsons? Seems redundant ...

screen shot 2017-10-30 at 7 51 01 pm
schen149 commented 6 years ago

The first (outer level) viewName is generated from here. https://github.com/CogComp/cogcomp-nlp/blob/4f12708d08acf743dd17a2973f6b1a9fb05b2bd3/core-utilities/src/main/java/edu/illinois/cs/cogcomp/core/utilities/JsonSerializer.java#L437-L448

The second viewName is generated here. https://github.com/CogComp/cogcomp-nlp/blob/4f12708d08acf743dd17a2973f6b1a9fb05b2bd3/core-utilities/src/main/java/edu/illinois/cs/cogcomp/core/utilities/JsonSerializer.java#L62-L65

I think we should remove the second viewName? Because the readView function only uses the first viewName.

danyaljj commented 6 years ago

If we change it, will it be backward compatible? (i.e. will we be able to read jsons serialized previously?)

mssammon commented 6 years ago

should be OK: amended json deserializer would simply ignore the additional value. Note that this json redundancy directly reflects a redundancy in the TextAnnotation/View data structures.