いくつかの変更と異なるデータセットを使用してドキュメントを分類するための導入用の cleartk の例を実行しようとしています。次のエラーが表示されます。
Exception in thread "main" java.lang.NoSuchMethodError: org.uimafit.util.JCasUtil.selectCovered(Lorg/apache/uima/jcas/JCas;Ljava/lang/Class;
Lorg/apache/uima/cas/text/AnnotationFS;)Ljava/util/List;
at org.cleartk.classifier.feature.extractor.CleartkExtractor$Covered.extract(CleartkExtractor.java:543)
at org.cleartk.classifier.feature.extractor.CleartkExtractor$Count.extract(CleartkExtractor.java:744)
at org.cleartk.classifier.feature.extractor.CleartkExtractor.extract(CleartkExtractor.java:128)
at org.cleartk.classifier.feature.extractor.CleartkExtractor.extract(CleartkExtractor.java:92)
at org.cleartk.classifier.feature.transform.extractor.TfidfExtractor.extract(TfidfExtractor.java:98)
at org.cleartk.classifier.feature.extractor.simple.CombinedExtractor.extract(CombinedExtractor.java:72)
at com.mesh.classification.tests.DocumentClassificationAnnotator.process(DocumentClassificationAnnotator.java:233)
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:377)
at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.processAndOutputNewCASes(PrimitiveAnalysisEngine_impl.java:295)
at org.apache.uima.analysis_engine.asb.impl.ASB_impl$AggregateCasIterator.processUntilNextOutputCas(ASB_impl.java:567)
at org.apache.uima.analysis_engine.asb.impl.ASB_impl$AggregateCasIterator.<init>(ASB_impl.java:409)
at org.apache.uima.analysis_engine.asb.impl.ASB_impl.process(ASB_impl.java:342)
at org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.processAndOutputNewCASes(AggregateAnalysisEngine_impl.java:267)
at org.apache.uima.analysis_engine.asb.impl.ASB_impl$AggregateCasIterator.processUntilNextOutputCas(ASB_impl.java:567)
at org.apache.uima.analysis_engine.asb.impl.ASB_impl$AggregateCasIterator.<init>(ASB_impl.java:409)
at org.apache.uima.analysis_engine.asb.impl.ASB_impl.process(ASB_impl.java:342)
at org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.processAndOutputNewCASes(AggregateAnalysisEngine_impl.java:267)
at org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase.process(AnalysisEngineImplBase.java:267)
at org.uimafit.pipeline.SimplePipeline.runPipeline(SimplePipeline.java:98)
at com.mesh.classification.tests.DocumentClassificationEvaluation.train(DocumentClassificationEvaluation.java:193)
at com.mesh.classification.tests.TrainModel.main(TrainModel.java:75)
明らかに次の行が原因です。
public void process(JCas jCas) throws AnalysisEngineProcessException {
DocumentAnnotation doc = (DocumentAnnotation) jCas.getDocumentAnnotationFs();
Instance<String> instance = new Instance<String>();
instance.addAll(this.extractor.extract(jCas, doc));
if (isTraining()) {
Question question = JCasUtil.selectSingle(jCas, Question.class);
instance.setOutcome(question.getCategory());
this.dataWriter.write(instance);
} else {
// This is classification, so classify and create UsenetDocument annotation
String result = this.classifier.classify(instance.getFeatures());
Question question = new Question(jCas, 0, jCas.getDocumentText().length());
question.setCategory(result);
question.addToIndexes();
// System.out.println("classified " + ViewURIUtil.getURI(jCas) + " as " + result + ".");
}
より具体的には:
instance.addAll(this.extractor.extract(jCas, doc));
Annotation Question.xml は次のように定義されます。
<?xml version="1.0" encoding="UTF-8"?>
<typeSystemDescription xmlns="http://uima.apache.org/resourceSpecifier">
<name>Question</name>
<version>1.0</version>
<vendor>All Rights Reserved.</vendor>
<types>
<typeDescription>
<name>com.mesh.classification.tests.type.Question</name>
<description/>
<supertypeName>uima.tcas.Annotation</supertypeName>
<features>
<featureDescription>
<name>category</name>
<description>The category label for the question (ABBREVIATION, ENTITY, DESCRIPTION, HUMAN, LOCATION)</description>
<rangeTypeName>uima.cas.String</rangeTypeName>
</featureDescription>
</features>
</typeDescription>
</types>
</typeSystemDescription>
手がかりはありますか?多少関連している可能性のあるこの問題を見つけました