Hi Richard,

Nailed it. The pipeline with DKPro's StanfordNamedEntityRecognizer does work 
with uimafit-core:jar:2.0.0 and uimaj-core:jar:2.4.2 but it does not work with 
uimafit-core:jar:2.1.0 and uimaj-core:jar:2.6.0. It runs with 
uimafit-core:2.0.0 aund uimaj-core:2.6.0, too.

Thanks a lot,
Armin


-----Ursprüngliche Nachricht-----
Von: Richard Eckart de Castilho [mailto:r...@apache.org] 
Gesendet: Donnerstag, 24. Juli 2014 18:46
An: user@uima.apache.org
Betreff: Re: DKpro StanfordNamedEntityRecognizer ClassCastException

Hi Armin,

I have absolutely no idea. I have rarely encountered this problem. Actually the 
only source of this that I remember is the use of the (de)serialization based 
on CASSerializer and/or CASCompleteSerializer (via CASImpl.reinit(...)).

Nothing related to this should have changed from uimaFIT 2.0.0 to 2.1.0. Does 
it work if you switch back to 2.0.0 (if you can)?

What kind of reader are you using?

Cheers,

-- Richard

On 24.07.2014, at 17:05, armin.weg...@bka.bund.de wrote:

> Hi Richard!
> 
> It looks like your absolutely right. I have changed all JCas stuff in the 
> consumer's resource to pure CAS and it works.
> 
> But why is JCas support not initialized? The reader calls an annotator for 
> document meta data that uses JCas. It says "new 
> DocumentMetaData(cas.getJCas())" and actually is annotated in the CAS.
> 
> All annotator's descriptions are build with 
> AnalysisEngineFactory.createEngineDescription or read from an XML file. They 
> are added to an AggregateBuilder. The aggregate description is given as 
> second argument to SimplePipeline.runPipeline(). The first argument is the 
> reader's descriptions. One of the ae's is the cas.getJCas() one you mentioned 
> earlier. What am I missing? Has anything changed from uimaFit 2.0.0 to 2.1.0?
> 
> Cheers
> Armin
> 
> 
> 
> -----Ursprüngliche Nachricht-----
> Von: Richard Eckart de Castilho [mailto:r...@apache.org]
> Gesendet: Donnerstag, 24. Juli 2014 15:59
> An: user@uima.apache.org
> Betreff: Re: DKpro StanfordNamedEntityRecognizer ClassCastException
> 
> Hi Armin,
> 
> the underlying problem is that you get a simple 
> org.apache.uima.cas.impl.AnnotationImpl instead of a JCas class like 
> de.tudarmstadt.ukp.dkpro.core.api.ner.type.NamedEntity. Normally a CAS that 
> has its JCas support initialized always returns JCas classes. But is is 
> possible to work entirely without JCas classes and without initializing JCas 
> support. In such a case, all AnnotationFS feature structures are returned as 
> AnnotationImpl.
> 
> I don't think this has anything to do with chaining resources. I'm pretty 
> sure it is related to how CASes are created, (de)serialized, and/or passed 
> through your pipeline (possibly through multipliers).
> 
> If you find out that this is not related to CAS creation/propagation, I'll be 
> very curious to hear about it!
> 
> Cheers,
> 
> -- Richard
> 
> On 24.07.2014, at 15:27, armin.weg...@bka.bund.de wrote:
> 
>> Hello Richard!
>> 
>> Your fix doesn't change anything. So I tried to narrow down the problem. At 
>> least, I can tell that it is not a problem specific to DKPro. I have the 
>> same kind of exception when not using DKPro at all. My guess now is that it 
>> maybe has something to do with chaining resources. I tried some simple aes. 
>> They run fine. When I try to run components with resources of resources, 
>> they fail. That's all for now. I will try to find out more and report again.
>> 
>> Cheers,
>> Armin
> 

Attachment: pgpTEzCnD2Y2D.pgp
Description: PGP signature

Reply via email to