我的主程序如下所示:

    public static void main(String args[]) throws UIMAException, IOException{
    //TypeSystemDescription tsd = TypeSystemDescriptionFactory.createTypeSystemDescription(Question.class);

    AggregateBuilder builder = new AggregateBuilder();
    //builder.add(SentenceAnnotator.getDescription());
    builder.add(AnalysisEngineFactory.createPrimitiveDescription(POSAnnotator1.class,
            ExampleComponents.TYPE_SYSTEM_DESCRIPTION,
            GenericJarClassifierFactory.PARAM_CLASSIFIER_JAR_PATH, outputDirectory + File.separator + "model.jar",
            CleartkAnnotator.PARAM_IS_TRAINING, true,
            DefaultDataWriterFactory.PARAM_DATA_WRITER_CLASS_NAME, InstanceDataWriter.class.getName(),
            DirectoryDataWriterFactory.PARAM_OUTPUT_DIRECTORY, new File(outputDirectory)));

    JCas jcas = JCasFactory.createJCas();
    jcas.setDocumentText(testData);

    SimplePipeline.runPipeline(jcas, builder.createAggregateDescription());

}


谁能解释这个错误?


  引起原因:java.lang.IllegalArgumentException:初始化[class org.cleartk.classifier.jar.DefaultSequenceDataWriterFactory]时出错
  字段“ dataWriterClassName”为必填项


我试图用其他数据编写器替换InstanceDataWriter,但是它们不起作用。

最佳答案

POS注释器使用序列数据编写器编写示例。您可以从DefaultDataWriterFactory.PARAM_DATA_WRITER_CLASS_NAME设置DataWriter类名Parameter。对于序列数据写入器,它应该是DefaultSequenceDataWriterFactory.PARAM_DATA_WRITER_CLASS_NAME。序列意味着在cas(许多POS标签)中有超过1个标签,而“普通”分类器则为整个文档仅提供1个标签。

http://cleartk.googlecode.com/svn-history/r4142/tags/cleartk-release-1.2.0/apidocs/org/cleartk/classifier/jar/DefaultSequenceDataWriterFactory.html

关于machine-learning - Cleartk:初始化[class org.cleartk.classifier.jar.DefaultSequenceDataWriterFactory]时出错,必填字段'dataWriterClassName',我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/14433641/

10-10 19:59