MaltParser 1.0.2

org.maltparser.parser.guide.predmodel
Class CombinedPredictionModel

java.lang.Object
  extended by org.maltparser.parser.guide.predmodel.CombinedPredictionModel
All Implemented Interfaces:
GuideModel, PredictionModel

public class CombinedPredictionModel
extends Object
implements PredictionModel

The combined prediction guide model combines the transition and all output columns into one class sets (the same behavior as MaltParser 0.4).

Since:
1.0
Author:
Johan Hall

Field Summary
protected  ClassTable classCodeTable
           
protected  FeatureVector features
           
protected  Guide guide
           
protected  InstanceModel model
           
protected  String modelName
           
 
Constructor Summary
CombinedPredictionModel(Guide guide)
          Constructs a combined prediction guide model.
 
Method Summary
 void addInstance(ParserAction parserAction)
           
 void finalize()
           
 void finalizeSentence(Sentence sentence, DependencyGraph dependencyGraph)
           
 ClassTable getClassCodeTable()
          Returns the all combined class table
 SingleMaltConfiguration getConfiguration()
           
 FeatureVector getFeatures()
          Returns the feature vector
 File getFile(String suffix)
           
 InputStreamReader getInputStreamReader(String suffix)
           
 String getModelName()
           
 OutputStreamWriter getOutputStreamWriter(String suffix)
           
 int getParserMode()
           
 ParsingAlgorithm getParsingAlgorithm()
           
protected  void initClassCodeTable()
          Initialize the class code table.
protected  void initFeatures()
          Initialize the feature vector and reads the feature specification file according to the --guide-features option or reads the default feature model specification for current parsing algorithm.
protected  void initModel()
          Initialize instance guide model according to the --guide-data_split_column.
 void noMoreInstances()
           
 boolean predict()
           
 boolean predictFromKBestList()
           
protected  void setGuide(Guide guide)
          Sets a Guide object
protected  void setModelName(String modelName)
          Sets the model name
 String toString()
           
 void update()
           
 void updateCardinality()
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

guide

protected Guide guide

modelName

protected String modelName

features

protected FeatureVector features

classCodeTable

protected ClassTable classCodeTable

model

protected InstanceModel model
Constructor Detail

CombinedPredictionModel

public CombinedPredictionModel(Guide guide)
                        throws MaltChainedException
Constructs a combined prediction guide model.

Parameters:
guide - a Guide object
Throws:
MaltChainedException
Method Detail

addInstance

public void addInstance(ParserAction parserAction)
                 throws MaltChainedException
Specified by:
addInstance in interface GuideModel
Throws:
MaltChainedException

finalizeSentence

public void finalizeSentence(Sentence sentence,
                             DependencyGraph dependencyGraph)
                      throws MaltChainedException
Specified by:
finalizeSentence in interface GuideModel
Throws:
MaltChainedException

noMoreInstances

public void noMoreInstances()
                     throws MaltChainedException
Specified by:
noMoreInstances in interface GuideModel
Throws:
MaltChainedException

finalize

public void finalize()
              throws MaltChainedException
Specified by:
finalize in interface GuideModel
Overrides:
finalize in class Object
Throws:
MaltChainedException

predict

public boolean predict()
                throws MaltChainedException
Specified by:
predict in interface GuideModel
Throws:
MaltChainedException

predictFromKBestList

public boolean predictFromKBestList()
                             throws MaltChainedException
Specified by:
predictFromKBestList in interface PredictionModel
Throws:
MaltChainedException

update

public void update()
            throws MaltChainedException
Specified by:
update in interface PredictionModel
Throws:
MaltChainedException

updateCardinality

public void updateCardinality()
                       throws MaltChainedException
Specified by:
updateCardinality in interface PredictionModel
Throws:
MaltChainedException

getModelName

public String getModelName()
Specified by:
getModelName in interface GuideModel

setModelName

protected void setModelName(String modelName)
Sets the model name

Parameters:
modelName - the model name

getFeatures

public FeatureVector getFeatures()
Returns the feature vector

Returns:
the feature vector

initFeatures

protected void initFeatures()
                     throws MaltChainedException
Initialize the feature vector and reads the feature specification file according to the --guide-features option or reads the default feature model specification for current parsing algorithm.

Throws:
MaltChainedException

getClassCodeTable

public ClassTable getClassCodeTable()
Returns the all combined class table

Returns:
the all combined class table
See Also:
AllCombinedClassTable

initClassCodeTable

protected void initClassCodeTable()
                           throws MaltChainedException
Initialize the class code table. The combined guide model combines the transition and output labels into one class table by using the AllCombinedClassTable.

Throws:
MaltChainedException
See Also:
AllCombinedClassTable

initModel

protected void initModel()
                  throws MaltChainedException
Initialize instance guide model according to the --guide-data_split_column. If the option is empty, when initialize a single model. Otherwise, a data split model (which will split the training instance according to a feature)

Throws:
MaltChainedException

getOutputStreamWriter

public OutputStreamWriter getOutputStreamWriter(String suffix)
                                         throws MaltChainedException
Specified by:
getOutputStreamWriter in interface GuideModel
Throws:
MaltChainedException

getInputStreamReader

public InputStreamReader getInputStreamReader(String suffix)
                                       throws MaltChainedException
Specified by:
getInputStreamReader in interface GuideModel
Throws:
MaltChainedException

getFile

public File getFile(String suffix)
             throws MaltChainedException
Specified by:
getFile in interface GuideModel
Throws:
MaltChainedException

getConfiguration

public SingleMaltConfiguration getConfiguration()
                                         throws MaltChainedException
Specified by:
getConfiguration in interface GuideModel
Throws:
MaltChainedException

getParsingAlgorithm

public ParsingAlgorithm getParsingAlgorithm()
Specified by:
getParsingAlgorithm in interface GuideModel

setGuide

protected void setGuide(Guide guide)
Sets a Guide object

Parameters:
guide - a Guide object

getParserMode

public int getParserMode()
                  throws MaltChainedException
Specified by:
getParserMode in interface GuideModel
Throws:
MaltChainedException

toString

public String toString()
Overrides:
toString in class Object

MaltParser 1.0.2

Copyright 2007 Johan Hall, Jens Nilsson and Joakim Nivre.