Package opennlp.tools.chunker

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


                //posProbs = tagger.probs();
                if(chunker != null){
                    //we still need the Array of the best ranked POS tags for the chunker
                    String[] pos = posSequences[0].getOutcomes().toArray(new String[tokens.length]);
                    chunkSpans = chunker.chunkAsSpans(tokens, pos);
                    chunkProps = chunker.probs();
                } else if(posTypeChunker != null){
                    chunkSpans = posTypeChunker.chunkAsSpans(tokens, posTags, posProbs);
                    chunkProps = new double[chunkSpans.length];
                    Arrays.fill(chunkProps, 1.0);
                } else {
View Full Code Here


                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
                tokenPos = null; //free memory
View Full Code Here

                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
                tokenPos = null; //free memory
View Full Code Here

                }
                Span[] chunkSpans;
                double[] chunkProps;
                if(chunker != null){
                    chunkSpans = chunker.chunkAsSpans(tokens, pos);
                    chunkProps = chunker.probs();
                } else {
                    chunkSpans = null;
                    chunkProps = null;
                }
                enhance(suggestionCache,site,ci,language, //the site, metadata and lang
View Full Code Here

                //posProbs = tagger.probs();
                if(chunker != null){
                    //we still need the Array of the best ranked POS tags for the chunker
                    String[] pos = posSequences[0].getOutcomes().toArray(new String[tokens.length]);
                    chunkSpans = chunker.chunkAsSpans(tokens, pos);
                    chunkProps = chunker.probs();
                } else if(posTypeChunker != null){
                    chunkSpans = posTypeChunker.chunkAsSpans(tokens, posTags, posProbs);
                    chunkProps = new double[chunkSpans.length];
                    Arrays.fill(chunkProps, 1.0);
                } else {
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.