Class TokenizerModel
The TokenizerModel is the model used by a learnable ITokenizer.
public sealed class TokenizerModel : BaseModel, IArtifactProvider
- Inheritance
-
TokenizerModel
- Implements
- Inherited Members
Constructors
TokenizerModel(IMaxentModel, IDictionary<string, string>?, TokenizerFactory)
Initializes the current instance.
public TokenizerModel(IMaxentModel tokenizerModel, IDictionary<string, string>? manifestInfoEntries, TokenizerFactory tokenizerFactory)
Parameters
tokenizerModelIMaxentModelthe model
manifestInfoEntriesIDictionary<string, string>the manifest
tokenizerFactoryTokenizerFactorythe factory
TokenizerModel(FileInfo)
Initializes the current instance.
public TokenizerModel(FileInfo modelFile)
Parameters
modelFileFileInfothe file containing the tokenizer model
Exceptions
- IOException
if reading from the stream fails in anyway
TokenizerModel(Stream)
Initializes the current instance.
public TokenizerModel(Stream @in)
Parameters
inStreamthe Input Stream to load the model from
Exceptions
- IOException
if reading from the stream fails in anyway
- InvalidFormatException
if the stream doesn't have the expected format
Properties
Abbreviations
public Dictionary? Abbreviations { get; }
Property Value
DefaultFactory
Sub-classes should override this method if their module has a default BaseToolFactory sub-class.
protected override Type DefaultFactory { get; }
Property Value
- Type
the default BaseToolFactory for the module, or null if none.
Factory
public TokenizerFactory Factory { get; }
Property Value
MaxentModel
public IMaxentModel MaxentModel { get; }
Property Value
UseAlphaNumericOptimization
public bool UseAlphaNumericOptimization { get; }
Property Value
Methods
ValidateArtifactMap()
Validates the parsed artifacts. If something is not valid subclasses should throw an InvalidFormatException.
Note: Subclasses should generally invoke super.validateArtifactMap at the beginning of this method.
protected override void ValidateArtifactMap()