Package opennlp.tools.chunker

Examples of opennlp.tools.chunker.ChunkerME.chunk()


          System.err.println("Invalid format:");
          System.err.println(line);
          continue;
        }
       
        String[] chunks = chunker.chunk(posSample.getSentence(),
            posSample.getTags());
       
        System.out.println(new ChunkSample(posSample.getSentence(),
            posSample.getTags(), chunks).nicePrint());
       
View Full Code Here


            System.err.println("Invalid format:");
            System.err.println(line);
            continue;
          }

          String[] chunks = chunker.chunk(posSample.getSentence(),
              posSample.getTags());

          System.out.println(new ChunkSample(posSample.getSentence(),
              posSample.getTags(), chunks).nicePrint());
View Full Code Here

                tokenTextList.clear(); //free memory
                posList.clear(); //free memory
               
                // (2) Chunk the sentence
               
                String[] chunkTags = chunker.chunk(tokenStrings, tokenPos);
                double[] chunkProb = chunker.probs();
                if(log.isTraceEnabled()){
                    log.trace("Chunks: {}"+Arrays.toString(chunkTags));
                }
                tokenStrings = null; //free memory
View Full Code Here

    return posTagger.tag(tokens);
  }

  private String[] chunk(String[] tokens, String[] posTags) {
    ChunkerME chunker = new ChunkerME(chunkerModel);
    return chunker.chunk(tokens, posTags);
  }

  private List<ChunkTaggedToken> getTokensWithTokenReadings(List<AnalyzedTokenReadings> tokenReadings, String[] tokens, String[] chunkTags) {
    List<ChunkTaggedToken> result = new ArrayList<>();
    int i = 0;
View Full Code Here

                tokenTextList.clear(); //free memory
                posList.clear(); //free memory
               
                // (2) Chunk the sentence
               
                String[] chunkTags = chunker.chunk(tokenStrings, tokenPos);
                double[] chunkProb = chunker.probs();
                if(log.isTraceEnabled()){
                    log.trace("Chunks: {}"+Arrays.toString(chunkTags));
                }
                tokenStrings = null; //free memory
View Full Code Here

            System.err.println("Invalid format:");
            System.err.println(line);
            continue;
          }

          String[] chunks = chunker.chunk(posSample.getSentence(),
                  posSample.getTags());

          System.out.println(new ChunkSample(posSample.getSentence(),
                  posSample.getTags(), chunks).nicePrint());
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.