ctakes-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chen, Pei" <Pei.C...@childrens.harvard.edu>
Subject Re: Feature not defined for type exception - need some help
Date Sun, 21 Apr 2013 20:05:27 GMT
Hi,
Could you also attach the desc xml file described below?
The error seems to suggest that the Type System is not being loaded/used correctly. Also,
could you also elaborate how the cTAKES jar/lib/classes are loaded into your project?
In particular
org.apache.ctakes.typesystem.type.textspan.Segment
Those classes should have a setId() method if I'm not mistaken.


Sent from my iPhone

On Apr 19, 2013, at 10:58 AM, "David Kincaid" <kincaid.dave@gmail.com<mailto:kincaid.dave@gmail.com>>
wrote:

I'm new to both cTakes and UIMA, so please excuse if this is a simple question. Can someone
help me understand why the following code produces the listed exception? The bolded line seems
to hold the key, but I don't understand what it's telling me.

public class MedicalNoteProcessor {

    private static final String AE_DESCRIPTOR = "/home/davek/src/medical-notes/AE/SimpleSegmentAnnotator.xml";

    private static final String TEST_TEXT = "Abnormal Remarks: rostral-most right nasal fold
and adjacent skin are swollen to about 1.5cm in width, spherical, with ulcerated surface near
nostril opening. No draining or appreciable pain associated. Mild mucoid to purulent discharge
in the nostril. Left side normalMouth/Teeth/Gum";

    public static void main(String[] args) throws IOException, InvalidXMLException, ResourceInitializationException,
AnalysisEngineProcessException {
        XMLInputSource xmlInputSource = new XMLInputSource(AE_DESCRIPTOR);

        ResourceSpecifier specifier = UIMAFramework.getXMLParser().parseResourceSpecifier(xmlInputSource);
        AnalysisEngine ae = UIMAFramework.produceAnalysisEngine(specifier);

        JCas jcas = ae.newJCas();

        //analyze a document
        jcas.setDocumentText(TEST_TEXT);
        ae.process(jcas);
        UIMAFramework.getLogger().log(Level.INFO, jcas.toString());

        jcas.reset();

        //done
        ae.destroy();
    }
}

Exception in thread "main" org.apache.uima.analysis_engine.AnalysisEngineProcessException:
Annotator processing failed.
at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:391)
at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.processAndOutputNewCASes(PrimitiveAnalysisEngine_impl.java:296)
at org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase.process(AnalysisEngineImplBase.java:267)
at org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase.process(AnalysisEngineImplBase.java:280)
at medical_notes.nlp.MedicalNoteProcessor.main(MedicalNoteProcessor.java:42)
Caused by: org.apache.uima.cas.CASRuntimeException: Feature "id" is not defined for type "org.apache.ctakes.typesystem.type.textspan.Segment".
at org.apache.uima.jcas.impl.JCasImpl.throwFeatMissing(JCasImpl.java:1018)
at org.apache.ctakes.typesystem.type.textspan.Segment.setId(Segment.java:80)
at org.apache.ctakes.core.ae.SimpleSegmentAnnotator.process(SimpleSegmentAnnotator.java:63)
at org.apache.uima.analysis_component.JCasAnnotator_ImplBase.process(JCasAnnotator_ImplBase.java:48)
at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:375)

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message