Package org.apache.ctakes.ytex.kernel.tree

Examples of org.apache.ctakes.ytex.kernel.tree.InstanceTreeBuilder


    String contextName = "kernelApplicationContext";
    ApplicationContext appCtx = (ApplicationContext) ContextSingletonBeanFactoryLocator
        .getInstance(beanRefContext)
        .useBeanFactory(contextName).getFactory();
    ApplicationContext appCtxSource = appCtx;
    InstanceTreeBuilder builder = appCtxSource.getBean(
        "instanceTreeBuilder", InstanceTreeBuilder.class);
    Map<Long, Node> instanceMap = builder.loadInstanceTrees(args[0]);
    for(Node node : instanceMap.values())
      printTree(node, 0);
  }
View Full Code Here


    }
  }

  private static void evalKernel(ApplicationContext appCtxSource,
      CommandLine line) throws Exception {
    InstanceTreeBuilder builder = appCtxSource
        .getBean(InstanceTreeBuilder.class);
    CorpusKernelEvaluator corpusEvaluator = appCtxSource
        .getBean(CorpusKernelEvaluator.class);
    String loadInstanceMap = line.getOptionValue("loadInstanceMap");
    String strMod = line.getOptionValue("mod");
    String strSlice = line.getOptionValue("slice");
    boolean evalTest = "yes".equalsIgnoreCase(line.getOptionValue(
        "evalTest", "no"))
        || "true".equalsIgnoreCase(line
            .getOptionValue("evalTest", "no"));
    int nMod = strMod != null ? Integer.parseInt(strMod) : 0;
    Integer nSlice = null;
    if (nMod == 0) {
      nSlice = 0;
    } else if (strSlice != null) {
      nSlice = Integer.parseInt(strSlice);
    }
    Map<Long, Node> instanceMap = null;
    if (loadInstanceMap != null) {
      instanceMap = builder.loadInstanceTrees(loadInstanceMap);
    } else {
      instanceMap = builder.loadInstanceTrees(appCtxSource
          .getBean(TreeMappingInfo.class));
    }
    if (nSlice != null) {
      corpusEvaluator.evaluateKernelOnCorpus(instanceMap, nMod, nSlice,
          evalTest);
View Full Code Here

//    }
//  }

  private static void storeInstanceMap(ApplicationContext appCtxSource,
      String storeInstanceMap, CommandLine line) throws Exception {
    InstanceTreeBuilder builder = appCtxSource.getBean(
        "instanceTreeBuilder", InstanceTreeBuilder.class);
    builder.serializeInstanceTrees(
        appCtxSource.getBean("treeMappingInfo", TreeMappingInfo.class),
        storeInstanceMap);
  }
View Full Code Here

TOP

Related Classes of org.apache.ctakes.ytex.kernel.tree.InstanceTreeBuilder

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.