Examples of JCasIterable


Examples of org.uimafit.pipeline.JCasIterable

        XMIReader.PARAM_XMI_DIRECTORY,
        options.getXMIDirectory()));

    int totalDocTimeRels = 0;
    int totalInconsistentDocTimeRels = 0;
    for (JCas jCas : new JCasIterable(reader, aggregateBuilder.createAggregate())) {
      String text = jCas.getDocumentText();
      JCas goldView = jCas.getView("GoldView");

      // group events by their narrative container
      Multimap<Annotation, EventMention> containers = HashMultimap.create();
View Full Code Here

Examples of org.uimafit.pipeline.JCasIterable

        options.getXMIDirectory()));

    String grammarPath = "/org/apache/ctakes/temporal/timenorm.en.grammar";
    URL grammarURL = PrintFailedTimeNormalizations.class.getResource(grammarPath);
    TemporalExpressionParser parser = new TemporalExpressionParser(grammarURL);
    for (JCas jCas : new JCasIterable(reader, aggregateBuilder.createAggregate())) {
      JCas goldView = jCas.getView("GoldView");

      Matcher matcher = DOC_TIME_PATTERN.matcher(goldView.getDocumentText());
      if (!matcher.find()) {
        System.err.println(goldView.getDocumentText());
View Full Code Here

Examples of org.uimafit.pipeline.JCasIterable

        options.getXMIDirectory()));
    AnalysisEngine ae = aggregateBuilder.createAggregate();
    int numMentions=0;
    int numMatches=0;
   
    for(JCas jCas : new JCasIterable(reader, ae)){
      //      String docId = DocumentIDAnnotationUtil.getDocumentID(jCas);
      //      String docId = jCas.
      //      System.out.println("Document: " + docId);
      for(Segment segment : JCasUtil.select(jCas, Segment.class)){
        if(THYMEData.SEGMENTS_TO_SKIP.contains(segment.getId())) continue;
View Full Code Here

Examples of org.uimafit.pipeline.JCasIterable

    {
      map.put("historyOf", historyStats);
    }

    // run on existing output that has both system (or instance gathering) and gold
    for (JCas jCas : new JCasIterable(collectionReader, aggregate)) {
     
//      printViewNames("Views found by JCasIterable:", jCas);
     
      JCas goldView;
      try {
View Full Code Here

Examples of org.uimafit.pipeline.JCasIterable

    this.outputDir = outputDir;
    this.classOfT = getClassOfT();
  }
 
  public void process() throws UIMAException, IOException{
    JCasIterable casIter = new JCasIterable(reader, ae);
    while(casIter.hasNext()){
      JCas jcas = casIter.next();
      String docId = DocumentIDAnnotationUtil.getDocumentID(jcas);
     
      // extract info from cas
      processCas(jcas, outputDir + File.separator + docId);
    }
View Full Code Here

Examples of org.uimafit.pipeline.JCasIterable

      CollectionReader reader = CollectionReaderFactory.createCollectionReader(
              XMIReader.class,
              XMIReader.PARAM_FILES,
              paths);
        
      JCasIterable casIter = new JCasIterable(reader);
      while(casIter.hasNext()){
        JCas jcas = casIter.next();
        processDocument(jcas);
      }
      out.close();
  }
View Full Code Here

Examples of org.uimafit.pipeline.JCasIterable

    {
      map.put("historyOf", historyStats);
    }

    // run on existing output that has both system (or instance gathering) and gold
    for (JCas jCas : new JCasIterable(collectionReader, aggregate)) {
     
//      printViewNames("Views found by JCasIterable:", jCas);
     
      JCas goldView;
      try {
View Full Code Here

Examples of org.uimafit.pipeline.JCasIterable

        args[0]);
    PrintWriter out = new PrintWriter(args[1]);
    AnalysisEngine ae = AnalysisEngineFactory.createPrimitive(ParserEvaluationAnnotator.class, new Object[]{});
   
    JCas jcas = null;
    JCasIterable casIter = new JCasIterable(reader, ae);
    while(casIter.hasNext()){
      jcas = casIter.next();
      Collection<TopTreebankNode> nodes = JCasUtil.select(jcas, TopTreebankNode.class);
      for(TopTreebankNode tree : nodes){
        out.println(tree.getTreebankParse());
      }
    }
View Full Code Here

Examples of org.uimafit.pipeline.JCasIterable

    Function<BinaryTextRelation, String> getOutcome =
        AnnotationStatistics.annotationToFeatureValue("category");

    // calculate statistics, iterating over the results of the classifier
    AnalysisEngine engine = builder.createAggregate();
    for (JCas jCas : new JCasIterable(collectionReader, engine)) {

      // get the gold view
      JCas goldView;
      try {
        goldView = jCas.getView(SHARPXMI.GOLD_VIEW_NAME);
View Full Code Here

Examples of org.uimafit.pipeline.JCasIterable

        AnalysisEngineFactory.createPrimitive(ModifierExtractorAnnotator.getDescription(
            GenericJarClassifierFactory.PARAM_CLASSIFIER_JAR_PATH,
            JarClassifierBuilder.getModelJarFile(directory)));

    AnnotationStatistics<String> stats = new AnnotationStatistics<String>();
    for (JCas jCas : new JCasIterable(collectionReader, classifierAnnotator)) {
      JCas goldView;
      try {
        goldView = jCas.getView(SHARPXMI.GOLD_VIEW_NAME);
      } catch (CASException e) {
        throw new AnalysisEngineProcessException(e);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.