Package joshua.corpus.vocab

Examples of joshua.corpus.vocab.SymbolTable


    if(args.length>=3)
      num_sents = new Integer(args[2].trim());
   
 
   
    SymbolTable p_symbol = new BuildinSymbol(null);
    int baseline_lm_feat_id =0;
   
    ArrayList<HyperGraph> hyperGraphs = new  ArrayList<HyperGraph>();;
   
    HypLenSquareExpectation ds = new HypLenSquareExpectation(scale);
View Full Code Here


   
    String f_dev_hg_prefix=args[0].trim();
    String f_dev_items = f_dev_hg_prefix +".items";
    String f_dev_rules = f_dev_hg_prefix +".rules";
   
    SymbolTable p_symbol = new BuildinSymbol(null);
    int baseline_lm_feat_id =0;
    int num_sents =5;
   
    double scale=1.0;
    DefaultSemiringParser ds = new HypLenSquareExpectation(1,0,scale);
View Full Code Here

   
    //????????????????????????????????????????????????????
    int baseline_lm_feat_id = 0;
    //??????????????????????????????????????
   
    SymbolTable p_symbolTable = new BuildinSymbol(null);
   
    KBestExtractor kbestExtractor =null;
    int topN=300;//TODO
    boolean extract_unique_nbest = true;//TODO
    boolean do_ngram_clip_nbest = true; //TODO
View Full Code Here

        devRefs[i-3]= args[i].trim();
        System.out.println("Use ref file " + devRefs[i-3]);
      }
    }
   
    SymbolTable symbolTbl = new BuildinSymbol(null);
   
    int numSentInDevSet = FileUtilityOld.numberLinesInFile(sourceTrainingFile);
   
   
    HGMinRiskDAMert trainer =  new HGMinRiskDAMert(joshuaConfigFile,numSentInDevSet, devRefs, hypFilePrefix, symbolTbl, sourceTrainingFile);
View Full Code Here

    String onebestFile=args[3].trim();//output
    int topN = new Integer(args[4].trim());
    double scalingFactor = new Double(args[5].trim());
 
    int ngramStateID = 0;
    SymbolTable symbolTbl = new BuildinSymbol(null);;
   
    NbestCrunching cruncher = new NbestCrunching(symbolTbl, scalingFactor, topN);
    NbestMinRiskReranker mbrReranker = new NbestMinRiskReranker(false, 1.0);
 
    BufferedWriter onebestWriter =  FileUtilityOld.getWriteFileStream(onebestFile)
View Full Code Here

    String onebestFile=args[3].trim();//output
    int topN = new Integer(args[4].trim());
    double insideOutsideScalingFactor = new Double(args[5].trim());
 
    int ngramStateID = 0;
    SymbolTable symbolTbl = new BuildinSymbol(null);
   
    NbestCrunching cruncher = new NbestCrunching(symbolTbl, insideOutsideScalingFactor, topN);   
 
    BufferedWriter onebestWriter =  FileUtilityOld.getWriteFileStream(onebestFile)
   
View Full Code Here

    //String f_1best=args[3].trim();//output
    int topN = new Integer(args[4].trim());
    double inside_outside_scaling_factor = new Double(args[5].trim());
 
    int baseline_lm_feat_id = 0;
    SymbolTable p_symbol = new BuildinSymbol(null);
   
    EstimateEntropyGapOnNbest cruncher = new EstimateEntropyGapOnNbest(p_symbol, inside_outside_scaling_factor, topN);   
 
    //BufferedWriter t_writer_1best =  FileUtilityOld.getWriteFileStream(f_1best); 
   
View Full Code Here

      int arity = pattern.arity();
      int size = pattern.size();
      int[] patternTokens = pattern.getWordIDs();
     
      SymbolTable vocab = corpus.getVocabulary();
     
      if (arity==0) {
        int[] bounds = this.findPhrase(pattern, 0, pattern.size(), 0, this.size()-1);
        int[] startPositions = this.getAllPositions(bounds);
        MatchedHierarchicalPhrases result = this.createTriviallyHierarchicalPhrases(startPositions, pattern, vocab);
View Full Code Here

  public void readExternal(ObjectInput in) throws IOException,
      ClassNotFoundException {
   
    boolean loggingFiner = logger.isLoggable(Level.FINER);
   
    SymbolTable vocab = suffixes.getVocabulary();
   
    // Read in the maximum number of phrases of which this object is aware.
    this.maxPhrases = in.readShort();
    if (loggingFiner) logger.finer(" Read: maxPhrases="+maxPhrases);
   
View Full Code Here

   
  }
 
  @Test(dependsOnMethods={"setup"})
  public void arity() {
    SymbolTable vocab = sourceCorpusArray.getVocabulary();
   
    Pattern     pattern = new Pattern(vocab, vocab.getIDs("de sesiones del parlamento europeo"));
    int[]       terminalSequenceStartIndices = {4};
    int[]       sentenceNumbers = {0};
   
    HierarchicalPhrases phrases =
      new HierarchicalPhrases(pattern, terminalSequenceStartIndices, sentenceNumbers);
View Full Code Here

TOP

Related Classes of joshua.corpus.vocab.SymbolTable

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.