Class AbstractModelReader
public abstract class AbstractModelReader
- Inheritance
-
AbstractModelReader
- Derived
- Inherited Members
Constructors
AbstractModelReader(IDataReader)
protected AbstractModelReader(IDataReader dataReader)
Parameters
dataReaderIDataReader
AbstractModelReader(FileInfo)
protected AbstractModelReader(FileInfo f)
Parameters
fFileInfo
Fields
MAX_ENTRIES_PROPERTY
Setting for overriding the maximum number of entries (outcomes, predicates, outcome patterns, chunk counts) that may be read from a model file or training data.
Falls back to 10_000_000 if absent or invalid.
public const string MAX_ENTRIES_PROPERTY = "OPENNLP_MAX_ENTRIES"
Field Value
NUM_PREDS
The number of predicates contained in the model.
protected int NUM_PREDS
Field Value
dataReader
protected readonly IDataReader dataReader
Field Value
Properties
Model
public virtual AbstractModel Model { get; }
Property Value
OutcomePatterns
protected virtual int[][] OutcomePatterns { get; }
Property Value
- int[][]
Outcomes
protected virtual string[] Outcomes { get; }
Property Value
- string[]
Predicates
protected virtual string[] Predicates { get; }
Property Value
- string[]
Methods
CheckModelType()
public abstract void CheckModelType()
ConstructModel()
public abstract AbstractModel ConstructModel()
Returns
GetParameters(int[][])
Reads the parameters from a file and populates an array of context objects.
protected virtual Context[] GetParameters(int[][] outcomePatterns)
Parameters
outcomePatternsint[][]The outcomes patterns for the model. The first index refers to which outcome pattern (a set of outcomes that occurs with a context) is being specified. The second index specifies the number of contexts which use this pattern at index 0, and the index of each outcomes which make up this pattern in indicies 1-n.
Returns
- Context[]
An array of context objects.
Exceptions
- IOException
when the model file does not match the outcome patterns or can not be read.
ReadDouble()
Implement as needed for the format the model is stored in.
public virtual double ReadDouble()
Returns
ReadInt32()
Implement as needed for the format the model is stored in.
public virtual int ReadInt32()
Returns
ReadUTF()
Implement as needed for the format the model is stored in.
public virtual string ReadUTF()