Package org.apache.ctakes.relationextractor.eval

Examples of org.apache.ctakes.relationextractor.eval.ModifierExtractorEvaluation


 
  public static AnalysisEngineDescription trainModifierExtractor(
      File modelsDir,
      List<File> trainFiles) throws Exception {
         
    ModifierExtractorEvaluation evaluation = new ModifierExtractorEvaluation(
        modelsDir,
        "-t", "0",   // svm kernel index
        "-c", "1000" // svm cost
        );
    CollectionReader collectionReader = evaluation.getCollectionReader(trainFiles);
    evaluation.train(collectionReader, modelsDir);
   
    // create the description
    AnalysisEngineDescription modifierExtractorDescription = AnalysisEngineFactory.createPrimitiveDescription(
        ModifierExtractorAnnotator.class,
        GenericJarClassifierFactory.PARAM_CLASSIFIER_JAR_PATH,
View Full Code Here


    String locationOfModelPath = modelPathPrefix + "location_of";

    // create the modifier extractor
    System.err.println("Training modifier extractor");
    File modifierTrainDirectory = new File(resourcesDirectory, modifierModelPath);
    ModifierExtractorEvaluation evaluation =
        new ModifierExtractorEvaluation(
            modifierTrainDirectory,
            ModifierExtractorEvaluation.BEST_PARAMETERS);
    evaluation.train(evaluation.getCollectionReader(trainFiles), modifierTrainDirectory);
    AnalysisEngineDescription modifierExtractorDesc =
        AnalysisEngineFactory.createPrimitiveDescription(
            ModifierExtractorAnnotator.class,
            GenericJarClassifierFactory.PARAM_CLASSIFIER_JAR_PATH,
            "/" + modifierModelPath + "/model.jar");
View Full Code Here

TOP

Related Classes of org.apache.ctakes.relationextractor.eval.ModifierExtractorEvaluation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.