Package opennlp.ccg.parse.postagger

Examples of opennlp.ccg.parse.postagger.POSTagger


        }
       
        // should we use the tagging dictionaries (yes if there is no prior model).
        boolean useWordDictionary = (wDictS != null);
        boolean usePOSDictionary = (pDictS != null);
        POSTagger pTagger = (posConfigS == null) ? null : POSTagger.posTaggerFactory(posConfigS);
        TaggingAlgorithm alg = (opts.get("taggingalgorithm") == null || opts.get("taggingalgorithm").equals("forward-backward")) ?
            TaggingAlgorithm.FORWARDBACKWARD : TaggingAlgorithm.FORWARD;
        MaxentModel mem = new ZLMEM(new File(maxentModS));
        //STTaggerWordDictionary wd,STTaggerPOSDictionary pd,  int K, MaxentModel mo, FeatureExtractor fexer,
        //String tagSequenceModel, Constants.TaggingAlgorithm alg, POSTagger posTagger
View Full Code Here


            } catch (IOException ex) {
                Logger.getLogger(STFex.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        STFex fexer = new STFex(stPriorMod);       
        POSTagger posT = (posConfig == null) ? null : POSTagger.posTaggerFactory(posConfig);
       
        if(posT != null) { fexer.useMultiPOS(true); } else { fexer.useMultiPOS(false); }
       
        for(List<Word> sentence : corp) {
            Map<Integer, TaggedWord> sent = new HashMap<Integer, TaggedWord>(sentence.size());
            int index = 0;               
            if(posT == null) {               
                for(Word w : sentence) { sent.put(index++, new TaggedWord(w)); }           
            } else {
                List<TaggedWord> posTagging = posT.tagSentence(sentence);
                for(TaggedWord tw : posTagging) { sent.put(index++, tw); }
            }
            List<Collection<Pair<String,Double>>> ftss = fexer.getSentenceFeatures(sent, true);           
            for(Collection<Pair<String,Double>> fts : ftss) {
                index = 0;
View Full Code Here

TOP

Related Classes of opennlp.ccg.parse.postagger.POSTagger

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.