当前位置: 首页>>代码示例>>Java>>正文


Java AnnotationStatistics.addAll方法代码示例

本文整理汇总了Java中org.cleartk.eval.AnnotationStatistics.addAll方法的典型用法代码示例。如果您正苦于以下问题:Java AnnotationStatistics.addAll方法的具体用法?Java AnnotationStatistics.addAll怎么用?Java AnnotationStatistics.addAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.cleartk.eval.AnnotationStatistics的用法示例。


在下文中一共展示了AnnotationStatistics.addAll方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: main

import org.cleartk.eval.AnnotationStatistics; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
  Options options = CliFactory.parseArguments(Options.class, args);

  List<File> trainFiles = getFilesFromDirectory(options.getTrainDirectory());
  List<File> testFiles = getFilesFromDirectory(options.getTestDirectory());

  QuestionCategoryEvaluation evaluation =
      new QuestionCategoryEvaluation(options.getModelsDirectory(), options.getTrainingArguments());

  // Run Cross Validation
  List<AnnotationStatistics<String>> foldStats = evaluation.crossValidation(trainFiles, 2);
  AnnotationStatistics<String> crossValidationStats = AnnotationStatistics.addAll(foldStats);

  System.err.println("Cross Validation Results:");
  System.err.print(crossValidationStats);
  System.err.println();
  System.err.println(crossValidationStats.confusions());
  System.err.println();

  // Run Holdout Set
  AnnotationStatistics<String> holdoutStats = evaluation.trainAndTest(trainFiles, testFiles);
  System.err.println("Holdout Set Results:");
  System.err.print(holdoutStats);
  System.err.println();
  System.err.println(holdoutStats.confusions());
}
 
开发者ID:utk4rsh,项目名称:question-classifier,代码行数:27,代码来源:QuestionCategoryEvaluation.java

示例2: main

import org.cleartk.eval.AnnotationStatistics; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
	Options options = CliFactory.parseArguments(Options.class, args);

	// find training files
	List<File> allFiles = Arrays.asList(options.getTrainDirectory().listFiles(new FilenameFilter() {

		@Override
		public boolean accept(File dir, String name) {
			return name.endsWith("xmi");
		}
	}));

	AbstractEvaluation evaluator = new Evaluation(options.getModelsDirectory());
	List<AnnotationStatistics<String>> crossValidationStatsList = evaluator.crossValidation(allFiles, 5); // .trainAndTest(trainFiles,
	AnnotationStatistics<String> crossValidationStats = AnnotationStatistics.addAll(crossValidationStatsList);

	System.out.println(crossValidationStats);
	System.out.println(ClearTkUtil.toCmdLine(crossValidationStats.confusions()));
}
 
开发者ID:quadrama,项目名称:DramaNLP,代码行数:20,代码来源:Evaluation.java

示例3: main

import org.cleartk.eval.AnnotationStatistics; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
  Options options = CliFactory.parseArguments(Options.class, args);

  // find training files
  List<File> trainFiles = new ArrayList<File>(FileUtils.listFiles(
      options.getTrainDirectory(),
      new MascTextFileFilter(),
      FileFilterUtils.falseFileFilter()));

  // run cross validation
  EvaluateNamedEntityChunker evaluator = new EvaluateNamedEntityChunker(
      options.getModelsDirectory());
  List<AnnotationStatistics<String>> foldStats = evaluator.crossValidation(trainFiles, 2);
  AnnotationStatistics<String> crossValidationStats = AnnotationStatistics.addAll(foldStats);

  System.err.println("Cross Validation Results:");
  System.err.print(crossValidationStats);
  System.err.println();
  System.err.println(crossValidationStats.confusions());
  System.err.println();

  // train and save a model using all the data
  evaluator.trainAndTest(trainFiles, Collections.<File> emptyList());
}
 
开发者ID:ClearTK,项目名称:cleartk,代码行数:25,代码来源:EvaluateNamedEntityChunker.java

示例4: main

import org.cleartk.eval.AnnotationStatistics; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
  Options options = CliFactory.parseArguments(Options.class, args);

  List<File> trainFiles = getFilesFromDirectory(options.getTrainDirectory());
  List<File> testFiles = getFilesFromDirectory(options.getTestDirectory());

  DocumentClassificationEvaluation evaluation = new DocumentClassificationEvaluation(
      options.getModelsDirectory(),
      options.getTrainingArguments());

  // Run Cross Validation
  List<AnnotationStatistics<String>> foldStats = evaluation.crossValidation(trainFiles, 2);
  AnnotationStatistics<String> crossValidationStats = AnnotationStatistics.addAll(foldStats);

  System.err.println("Cross Validation Results:");
  System.err.print(crossValidationStats);
  System.err.println();
  System.err.println(crossValidationStats.confusions());
  System.err.println();

  // Run Holdout Set
  AnnotationStatistics<String> holdoutStats = evaluation.trainAndTest(trainFiles, testFiles);
  System.err.println("Holdout Set Results:");
  System.err.print(holdoutStats);
  System.err.println();
  System.err.println(holdoutStats.confusions());
}
 
开发者ID:ClearTK,项目名称:cleartk,代码行数:28,代码来源:DocumentClassificationEvaluation.java


注:本文中的org.cleartk.eval.AnnotationStatistics.addAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。