edu.stanford.nlp.maxent.iis
Class ProblemSolverHPSG

java.lang.Object
  |
  +--edu.stanford.nlp.maxent.iis.ProblemSolverHPSG

public class ProblemSolverHPSG
extends Object


Constructor Summary
ProblemSolverHPSG()
           
ProblemSolverHPSG(String wekaProbFile)
           
 
Method Summary
 void buildClassifier(String trainFileName, int iters, double gaincutoff)
           
 void dumpWrong(ArrayList trees, double[] posteriors)
          Print out the correct tree with all that have higher probability
 int getClassification(DataDouble d)
           
 double[] getPosteriors(DataDouble d)
           
 boolean isOk(String key)
           
static void main(String[] args)
          Parameters : -train trainFileArff ( training will be done now ) -gain double ( the gain cutoff ) -support int ( the minimum number of times a feature must appear to be included ) -test trainFile testFile -iters numIterations ( iterative scaling iterations ) -binary ( indicates that for attributes that are binary we are adding features only for the value 1 of them ) -validation ( use cross-validation to select features ) -clean ( in testing, print only one classification per line ) -ftNum [numFeatures] ( the maximum number of features ) -no_sel ( do not do feature selection ) -usetop [numTop] ( use only top numTop classifiers ) -fixedtop ( do not select number of classifiers to include, use specified ) -crossval ( use cross validation to choose optinmal number of clasisifers to combine )
 void makeFeatures()
           
 void normalizeForConstraints(DiffFunction[] constraints, double[] lambda, DiffFunction objective)
          making a PCFG model
 void printFeatures()
           
 void printTree(DataDouble d, DataDouble ref)
          Print all features in a tree with their weights but only if the differ from values in another tree
 void printTreeLeaves(DataDouble d)
          print all features for which the name contains a terminal
 void read(String filename)
           
 String[][] readInfo(String filename)
          read in sentence info and return it in ArrayList
 void readTrainingInstances(String wekaDataFile)
           
 void save(String filename)
           
 double test(ArrayList trees)
          these trees are all for one sentence the tester chooses one of them as correct returns 1/numtied is a tie for first place and correct, ow 0
 void test(String fileName)
          This file is supposed to be in Weka format The class attribute might be missing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProblemSolverHPSG

public ProblemSolverHPSG()

ProblemSolverHPSG

public ProblemSolverHPSG(String wekaProbFile)
Method Detail

normalizeForConstraints

public void normalizeForConstraints(DiffFunction[] constraints,
                                    double[] lambda,
                                    DiffFunction objective)
making a PCFG model


readTrainingInstances

public void readTrainingInstances(String wekaDataFile)
                           throws Exception
Exception

makeFeatures

public void makeFeatures()

isOk

public boolean isOk(String key)

buildClassifier

public void buildClassifier(String trainFileName,
                            int iters,
                            double gaincutoff)
                     throws Exception
Exception

dumpWrong

public void dumpWrong(ArrayList trees,
                      double[] posteriors)
Print out the correct tree with all that have higher probability


printTreeLeaves

public void printTreeLeaves(DataDouble d)
print all features for which the name contains a terminal


printTree

public void printTree(DataDouble d,
                      DataDouble ref)
Print all features in a tree with their weights but only if the differ from values in another tree


test

public double test(ArrayList trees)
these trees are all for one sentence the tester chooses one of them as correct returns 1/numtied is a tie for first place and correct, ow 0


test

public void test(String fileName)
This file is supposed to be in Weka format The class attribute might be missing


getClassification

public int getClassification(DataDouble d)

getPosteriors

public double[] getPosteriors(DataDouble d)

main

public static void main(String[] args)
Parameters : -train trainFileArff ( training will be done now ) -gain double ( the gain cutoff ) -support int ( the minimum number of times a feature must appear to be included ) -test trainFile testFile -iters numIterations ( iterative scaling iterations ) -binary ( indicates that for attributes that are binary we are adding features only for the value 1 of them ) -validation ( use cross-validation to select features ) -clean ( in testing, print only one classification per line ) -ftNum [numFeatures] ( the maximum number of features ) -no_sel ( do not do feature selection ) -usetop [numTop] ( use only top numTop classifiers ) -fixedtop ( do not select number of classifiers to include, use specified ) -crossval ( use cross validation to choose optinmal number of clasisifers to combine )


save

public void save(String filename)

read

public void read(String filename)

printFeatures

public void printFeatures()

readInfo

public String[][] readInfo(String filename)
read in sentence info and return it in ArrayList



Stanford NLP Group