Examples of lookupString()


Examples of org.fnlp.ml.types.alphabet.LabelAlphabet.lookupString()

        error += e;
        if(e != 0)
          senError++;

      }
      predictSet[i] = la.lookupString(pred);
      if(hasLabel)
        goldSet[i] = la.lookupString((int[])carrier.getTarget());
    }

    long endtime = System.currentTimeMillis();
View Full Code Here

Examples of org.fnlp.ml.types.alphabet.LabelAlphabet.lookupString()

          senError++;

      }
      predictSet[i] = la.lookupString(pred);
      if(hasLabel)
        goldSet[i] = la.lookupString((int[])carrier.getTarget());
    }

    long endtime = System.currentTimeMillis();
    System.out.println("总时间:\t" + (endtime - starttime) / 1000.0);
    System.out.println("抽取特征时间:\t" + (featuretime - starttime) / 1000.0);
View Full Code Here

Examples of org.fnlp.ml.types.alphabet.LabelAlphabet.lookupString()

    System.out.println("测试样本个数: " + testSet.size()); //
    String[][] labelsSet = new String[testSet.size()][];
    for (int i = 0; i < testSet.size(); i++) {
      Instance carrier = testSet.get(i);
      int[] pred = (int[]) cl.classify(carrier).getLabel(0);
      labelsSet[i] = labels.lookupString(pred);
    }
   
    String s = SimpleFormatter.format(testSet, labelsSet);
    System.out.println(s);
    System.out.println("Done");
View Full Code Here

Examples of org.fnlp.ml.types.alphabet.LabelAlphabet.lookupString()

        System.out.println("Topic--Term Associations, Phi[k][w] (beta=" + beta
            + ")");

        System.out.print("k\\w\t");
        for (int w = 0; w < phi[0].length; w++) {
            System.out.print("   " + dict.lookupString(w) + "    ");
        }
        System.out.println();
        for (int k = 0; k < phi.length; k++) {
            System.out.print(k + "\t");
            for (int w = 0; w < phi[k].length; w++) {
View Full Code Here

Examples of org.fnlp.ml.types.alphabet.LabelAlphabet.lookupString()

        }
        for (int k = 0; k < phi.length; k++) {
          int[] top = MyArrays.sort(phi[k]);
         
            for (int w = 0; w < 10; w++) {
              System.out.print(dict.lookupString(top[w]) + " ");
            }
            System.out.println();
        }
    }
View Full Code Here

Examples of org.fnlp.ml.types.alphabet.LabelAlphabet.lookupString()

                ENG_right++;
            }
          }
        }
      }
      labelsSet[i] = labels.lookupString(pred);
      targetSet[i] = labels.lookupString((int[])carrier.getTarget());
    }

    long endtime = System.currentTimeMillis();
    System.out.println("totaltime\t" + (endtime - starttime) / 1000.0);
View Full Code Here

Examples of org.fnlp.ml.types.alphabet.LabelAlphabet.lookupString()

            }
          }
        }
      }
      labelsSet[i] = labels.lookupString(pred);
      targetSet[i] = labels.lookupString((int[])carrier.getTarget());
    }

    long endtime = System.currentTimeMillis();
    System.out.println("totaltime\t" + (endtime - starttime) / 1000.0);
    System.out.println("feature\t" + (featuretime - starttime) / 1000.0);
View Full Code Here

Examples of org.fnlp.ml.types.alphabet.LabelAlphabet.lookupString()

                ENG_right++;
            }
          }
        }
      }
      labelsSet[i] = labels.lookupString(pred);
      targetSet[i] = labels.lookupString((int[])carrier.getTarget());
    }

    long endtime = System.currentTimeMillis();
    System.out.println("totaltime\t" + (endtime - starttime) / 1000.0);
View Full Code Here

Examples of org.fnlp.ml.types.alphabet.LabelAlphabet.lookupString()

            }
          }
        }
      }
      labelsSet[i] = labels.lookupString(pred);
      targetSet[i] = labels.lookupString((int[])carrier.getTarget());
    }

    long endtime = System.currentTimeMillis();
    System.out.println("totaltime\t" + (endtime - starttime) / 1000.0);
    System.out.println("feature\t" + (featuretime - starttime) / 1000.0);
View Full Code Here

Examples of org.fnlp.ml.types.alphabet.LabelAlphabet.lookupString()

    SFGenerator generator = new SFGenerator();
    Linear[] models = new Linear[postagAlphabet.size()];
    int fsize = features.size();

    for (int i = 0; i < postagAlphabet.size(); i++) {
      String pos = postagAlphabet.lookupString(i);
      InstanceSet instset = readInstanceSet(pos);
      LabelAlphabet alphabet = factory.buildLabelAlphabet(pos);
      int ysize = alphabet.size();
      System.out.printf("Training with data: %s\n", pos);
      System.out.printf("Number of labels: %d\n", ysize);
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.