public class PerceptronModel extends BaseModel
| Constructor and Description |
|---|
PerceptronModel(PerceptronModel other) |
PerceptronModel(ShiftReduceOptions op,
Index<Transition> transitionIndex,
Set<String> knownStates,
Set<String> rootStates,
Set<String> rootOnlyStates) |
| Modifier and Type | Method and Description |
|---|---|
void |
averageModels(Collection<PerceptronModel> models) |
void |
averageScoredModels(Collection<ScoredObject<PerceptronModel>> scoredModels) |
Collection<ScoredObject<Integer>> |
findHighestScoringTransitions(State state,
boolean requireLegal,
int numTransitions,
List<ParserConstraint> constraints) |
void |
outputStats()
Output some random facts about the model
|
void |
trainModel(String serializedPath,
Tagger tagger,
Random random,
List<Tree> binarizedTrees,
List<List<Transition>> transitionLists,
Treebank devTreebank,
int nThreads)
Will train the model on the given treebank, using devTreebank as
a dev set.
|
findEmergencyTransitionpublic PerceptronModel(ShiftReduceOptions op, Index<Transition> transitionIndex, Set<String> knownStates, Set<String> rootStates, Set<String> rootOnlyStates)
public PerceptronModel(PerceptronModel other)
public void averageScoredModels(Collection<ScoredObject<PerceptronModel>> scoredModels)
public void averageModels(Collection<PerceptronModel> models)
public void outputStats()
public Collection<ScoredObject<Integer>> findHighestScoringTransitions(State state, boolean requireLegal, int numTransitions, List<ParserConstraint> constraints)
findHighestScoringTransitions in class BaseModelpublic void trainModel(String serializedPath, Tagger tagger, Random random, List<Tree> binarizedTrees, List<List<Transition>> transitionLists, Treebank devTreebank, int nThreads)
trainModel in class BaseModelserializedPath - Where serialized models go. If the appropriate options are set, the method can use this to save intermediate models.tagger - The tagger to use when evaluating devTreebank. TODO: it would make more sense for ShiftReduceParser to retag the trees firstrandom - A random number generator to use for any random numbers. Useful to make sure results can be reproduced.binarizedTrees - The treebank to train from.transitionLists - binarizedTrainTrees converted into lists of transitions that will reproduce the same tree.devTreebank - a set of trees which can be used for dev testing (assuming the user provided a dev treebank)nThreads - how many threads the model can use for training