Giter VIP home page Giter VIP logo

Comments (4)

reckart avatar reckart commented on June 11, 2024

The following cases are possible:

  • CAS contains exactly one org.apache.uima.jcas.tcas.DocumentAnnotation annotation
  • CAS contains more than one org.apache.uima.jcas.tcas.DocumentAnnotation annotation (in DKPro Core, this would be considered a bug, but there is nothing in UIMA Core preventing this scenario)
  • first or second case, just that it is actually a subclass of DocumentAnnotation (DKPro Core actually uses a subclass, namely DocumentMetaData)

The document annotation is often the first one created in the CAS, but I wouldn't rely on that. E.g. when a user creates a CAS via uimaFIT in a DKPro Core context and sets the document string, first a DocumentAnnotation is created. This can later be removed and replaced with a DocumentMetaData. I would expect this scenario to have an effect on the ID.

org.apache.uima.jcas.tcas.DocumentAnnotation is "predefined", but contrary to all other predefined types, it is not in UIMA Core. It is defined in a separate JAR and a user could decide to redefine the type as well as use their own custom JCas class with additional fields. DocumentMetaData is not "predefined" - it is a part of the DKPro Core typesystem.

The (J)CAS APIs assume that there is always some document-level annotation of type DocumentAnnotation (or compatible like DocumentMetaData) and return this when CAS.getDocumentAnnotation() is called. Furthermore, they assume that there is a field language in the document annotation which can be accessed via the shorthand CAS.get/setDocumentLanguage() (equiv. to CAS.getDocumentAnnotation().get/setLanguage())

from dkpro-cassis.

jcklie avatar jcklie commented on June 11, 2024

Right now, I do not serialize it at all which is not so good.

from dkpro-cassis.

jcklie avatar jcklie commented on June 11, 2024

@Br0ce I made it so that we do not crash if a type system already defines custom DocumentAnnotation. Can you try out the master?

from dkpro-cassis.

Br0ce avatar Br0ce commented on June 11, 2024

@jcklie tested with and without DocumentAnnotation. Looks good to me.

from dkpro-cassis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.