Examples of MaxentModel


Examples of opennlp.ccg.parse.tagger.ml.MaxentModel

        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
        res = (pTagger != null) ?
            new WordAndPOSDictionaryLabellingStrategy(wD, pD, kay, mem, fex, seqModS, alg, pTagger) :
            new WordAndPOSDictionaryLabellingStrategy(wD, pD, kay, mem, fex, seqModS, alg);
View Full Code Here

Examples of opennlp.ccg.parse.tagger.ml.MaxentModel

            String[] pathKeys = { "maxentmodel", "priormodel", "priormodelvocab", "sequencemodel"};
            Map<String, String> opts = ConfigFileProcessor.readInConfig(configFile, pathKeys);
            if (opts.get("taggertype").equalsIgnoreCase("dummy")) {
                return new DummyPOSTagger();
            }
            MaxentModel mem = new ZLMEM(new File(opts.get("maxentmodel")));
            POSPriorModel posPrior = null;
      if (opts.get("priormodel") != null) {
    posPrior = new POSPriorModel(opts.get("priormodel"), opts.get("priormodelvocab"));
      }
            POSTagFex fexer = new POSTagFex(posPrior);
View Full Code Here

Examples of opennlp.model.MaxentModel

  public void testBestSequence() {
    String sequence[] = {"1", "2", "3", "2", "1"};
    BeamSearchContextGenerator<String> cg = new IdentityFeatureGenerator(sequence);
   
    String outcomes[] = new String[] {"1", "2", "3"};
    MaxentModel model = new IdentityModel(outcomes);
   
    BeamSearch<String> bs = new BeamSearch<String>(2, cg, model);
   
    Sequence seq = bs.bestSequence(sequence, null);
    assertNotNull(seq);
View Full Code Here

Examples of opennlp.model.MaxentModel

  public void testBestSequenceWithValidator() {
    String sequence[] = {"1", "2", "3", "2", "1"};
    BeamSearchContextGenerator<String> cg = new IdentityFeatureGenerator(sequence);
   
    String outcomes[] = new String[] {"1", "2", "3"};
    MaxentModel model = new IdentityModel(outcomes);
   
    BeamSearch<String> bs = new BeamSearch<String>(2, cg, model, new SequenceValidator<String>(){

      public boolean validSequence(int i, String[] inputSequence,
          String[] outcomesSequence, String outcome) {
View Full Code Here

Examples of opennlp.model.MaxentModel

   
    String sequence[] = new String[0];
    BeamSearchContextGenerator<String> cg = new IdentityFeatureGenerator(sequence);
   
    String outcomes[] = new String[] {"1", "2", "3"};
    MaxentModel model = new IdentityModel(outcomes);
   
    BeamSearch<String> bs = new BeamSearch<String>(3, cg, model);
   
    Sequence seq = bs.bestSequence(sequence, null);
    assertNotNull(seq);
View Full Code Here

Examples of opennlp.model.MaxentModel

  public void testBestSequenceOneElementInput() {
    String sequence[] = {"1"};
    BeamSearchContextGenerator<String> cg = new IdentityFeatureGenerator(sequence);
   
    String outcomes[] = new String[] {"1", "2", "3"};
    MaxentModel model = new IdentityModel(outcomes);
   
    BeamSearch<String> bs = new BeamSearch<String>(3, cg, model);
   
    Sequence seq = bs.bestSequence(sequence, null);
    assertNotNull(seq);
View Full Code Here

Examples of opennlp.model.MaxentModel

   
    String sequence[] = new String[0];
    BeamSearchContextGenerator<String> cg = new IdentityFeatureGenerator(sequence);
   
    String outcomes[] = new String[] {"1", "2", "3"};
    MaxentModel model = new IdentityModel(outcomes);
   
    BeamSearch<String> bs = new BeamSearch<String>(3, cg, model);
   
    Sequence seq = bs.bestSequence(sequence, null);
    assertNotNull(seq);
View Full Code Here

Examples of opennlp.model.MaxentModel

  public void testBestSequenceOneElementInput() {
    String sequence[] = {"1"};
    BeamSearchContextGenerator<String> cg = new IdentityFeatureGenerator(sequence);
   
    String outcomes[] = new String[] {"1", "2", "3"};
    MaxentModel model = new IdentityModel(outcomes);
   
    BeamSearch<String> bs = new BeamSearch<String>(3, cg, model);
   
    Sequence seq = bs.bestSequence(sequence, null);
    assertNotNull(seq);
View Full Code Here

Examples of opennlp.model.MaxentModel

  public void testBestSequence() {
    String sequence[] = {"1", "2", "3", "2", "1"};
    BeamSearchContextGenerator<String> cg = new IdentityFeatureGenerator(sequence);
   
    String outcomes[] = new String[] {"1", "2", "3"};
    MaxentModel model = new IdentityModel(outcomes);
   
    BeamSearch<String> bs = new BeamSearch<String>(2, cg, model);
   
    Sequence seq = bs.bestSequence(sequence, null);
    assertNotNull(seq);
View Full Code Here

Examples of opennlp.model.MaxentModel

  public void testBestSequenceWithValidator() {
    String sequence[] = {"1", "2", "3", "2", "1"};
    BeamSearchContextGenerator<String> cg = new IdentityFeatureGenerator(sequence);
   
    String outcomes[] = new String[] {"1", "2", "3"};
    MaxentModel model = new IdentityModel(outcomes);
   
    BeamSearch<String> bs = new BeamSearch<String>(2, cg, model, new SequenceValidator<String>(){

      public boolean validSequence(int i, String[] inputSequence,
          String[] outcomesSequence, String outcome) {
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.