Package joshua.corpus.vocab

Examples of joshua.corpus.vocab.BuildinSymbol


    int num_sents=new Integer(args[2].trim());
    String f_config=args[3].trim();//be careful with the weights
   
    //set up models
    VariationalDecoderConfiguration.readConfigFile(f_config);
    SymbolTable symbolTbl = new BuildinSymbol(null)
    List<FeatureFunction> featFunctions = new ArrayList<FeatureFunction>();
    HashMap<VariationalNgramApproximator, FeatureTemplateBasedFF> approximatorMap = new HashMap<VariationalNgramApproximator, FeatureTemplateBasedFF> ();
    VariationalDecoderConfiguration.initializeModels(f_config, symbolTbl, featFunctions, approximatorMap);   
    double insideOutsideScalingFactor =  VariationalDecoderConfiguration.insideoutsideScalingFactor;       
   
View Full Code Here


 
    int baseline_lm_feat_id = 0;//???????
   
    int max_num_words =25;
   
    SymbolTable p_symbol = new BuildinSymbol(null);
    KBestExtractor kbest_extractor = new KBestExtractor(p_symbol, true, false, false, false,  false, true);//????????????
    ApproximateFilterHGByOneString filter = new ApproximateFilterHGByOneString(p_symbol,baseline_lm_feat_id,baseline_lm_order);
    StringSumInHG p_sumer = new StringSumInHG(p_symbol, kbest_extractor, filter);
   
    //#### process test set
View Full Code Here

  // TODO: maybe move to JoshuaConfiguration to enable moving the featureFunction parsing there (Sets: symbolTable, defaultNonterminals)
  private void initializeSymbolTable(SymbolTable existingSymbols) {
    if (JoshuaConfiguration.use_remote_lm_server) {
      if (null == existingSymbols) {
        // Within the decoder, we assume BuildinSymbol when using the remote LM
        this.symbolTable = new BuildinSymbol(JoshuaConfiguration.remote_symbol_tbl);
      } else {
        this.symbolTable = existingSymbols;
      }
    } else if (JoshuaConfiguration.use_srilm) {
      logger.finest("Using SRILM symbol table");
      if (null == existingSymbols) {
        this.symbolTable = new SrilmSymbol(JoshuaConfiguration.lmOrder);
      } else {
        logger.finest("Populating SRILM symbol table with symbols from existing symbol table");
        this.symbolTable = new SrilmSymbol(existingSymbols, JoshuaConfiguration.lmOrder);
      }
    } else {
      if (null == existingSymbols) {
        //this.symbolTable = new Vocabulary();//new BuildinSymbol(null);
        this.symbolTable = new BuildinSymbol();
      } else {
        this.symbolTable = existingSymbols;
      }
    }
   
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 HypLenExpectation(1,0,scale);
    DiskHyperGraph dhg_test = new DiskHyperGraph(p_symbol, baseline_lm_feat_id, true, null); //have model costs stored
View Full Code Here

//  ======================== main method ================================     
   public static void main(String[] args)   throws IOException
       if(args.length<2){
         System.out.println("Wrong command, it should be: java ConfusionExtractor  f_input_grammar f_confusion_grammar");
       }
      SymbolTable symbolTbl = new BuildinSymbol(null);
      String fInputGrammar = args[0];
      String fConfusiongrammar = args[1];
     
      ArrayList<Double> featureWeights = new ArrayList<Double>();
      for(int i=2; i<args.length; i++){
View Full Code Here

//======================== main method ================================     
   public static void main(String[] args)   throws IOException
       if(args.length<3){
         System.out.println("Wrong command, it should be: java ConfusionExtractor f_hypergraphs_items f_hypergraphs_grammar f_confusion_grammar total_num_sent");
       }
      SymbolTable p_symbol = new BuildinSymbol(null);
      int baseline_lm_feat_id=0;//TODO
      boolean saveModelCosts = true;
      boolean itemSpecific=false;
     
      String f_hypergraphs = args[0];
View Full Code Here

    int numSrcWords =1;
    if(args.length>=4)
      numSrcWords = new Integer(args[3].trim());
   
   
    SymbolTable symbolTbl = new BuildinSymbol(null);
    int ngramStateID =0;
   
    double sumEntropy = 0;
   
    EntropyOnHGUsingIO ds = new EntropyOnHGUsingIO(1.0);
View Full Code Here

    int numSrcWords =1;
    if(args.length>=4)
      numSrcWords = new Integer(args[3].trim());
   
   
    SymbolTable p_symbol = new BuildinSymbol(null);
    int ngramStateID =0;
   
    double sumEntropy = 0;
   
    DefaultInsideSemiringParser ds = new EntropyOnHG(1.0);
View Full Code Here

    int numSrcWords =1;
    if(args.length>=4)
      numSrcWords = new Integer(args[3].trim());
   
   
    SymbolTable symbolTbl = new BuildinSymbol(null);
    int ngramStateID =0;
   
    double sumEntropy = 0;
   
    DefaultSemiringParser ds = new EntropyOnHG(1,0,scale);
View Full Code Here

    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

TOP

Related Classes of joshua.corpus.vocab.BuildinSymbol

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.