本文整理汇总了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());
}
示例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()));
}
示例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());
}
示例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());
}