public abstract class BaseModel extends Object implements Serializable
| Constructor and Description |
|---|
BaseModel(BaseModel other) |
BaseModel(ShiftReduceOptions op,
Index<Transition> transitionIndex,
Set<String> knownStates,
Set<String> rootStates,
Set<String> rootOnlyStates) |
| Modifier and Type | Method and Description |
|---|---|
Transition |
findEmergencyTransition(State state,
List<ParserConstraint> constraints)
Returns a transition which might not even be part of the model,
but will hopefully allow progress in an otherwise stuck parse
TODO: perhaps we want to create an EmergencyTransition class
which indicates that something has gone wrong
|
abstract Collection<ScoredObject<Integer>> |
findHighestScoringTransitions(State state,
boolean requireLegal,
int numTransitions,
List<ParserConstraint> constraints) |
abstract void |
trainModel(String serializedPath,
Tagger tagger,
Random random,
List<Tree> binarizedTrainTrees,
List<List<Transition>> transitionLists,
Treebank devTreebank,
int nThreads)
Train a new model.
|
public BaseModel(ShiftReduceOptions op, Index<Transition> transitionIndex, Set<String> knownStates, Set<String> rootStates, Set<String> rootOnlyStates)
public BaseModel(BaseModel other)
public Transition findEmergencyTransition(State state, List<ParserConstraint> constraints)
public abstract Collection<ScoredObject<Integer>> findHighestScoringTransitions(State state, boolean requireLegal, int numTransitions, List<ParserConstraint> constraints)
public abstract void trainModel(String serializedPath, Tagger tagger, Random random, List<Tree> binarizedTrainTrees, List<List<Transition>> transitionLists, Treebank devTreebank, int nThreads)
serializedPath - 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.binarizedTrainTrees - 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