Class TokenNameFinderModel
The TokenNameFinderModel is the model used by a learnable ITokenNameFinder.
public class TokenNameFinderModel : BaseModel, IArtifactProvider
- Inheritance
-
TokenNameFinderModel
- Implements
- Inherited Members
Constructors
TokenNameFinderModel(FileInfo)
public TokenNameFinderModel(FileInfo modelFile)
Parameters
modelFileFileInfo
TokenNameFinderModel(Stream)
public TokenNameFinderModel(Stream @in)
Parameters
inStream
TokenNameFinderModel(string)
public TokenNameFinderModel(string modelPath)
Parameters
modelPathstring
TokenNameFinderModel(string, IMaxentModel, byte[]?, IDictionary<string, object>, IDictionary<string, string>)
public TokenNameFinderModel(string languageCode, IMaxentModel nameFinderModel, byte[]? generatorDescriptor, IDictionary<string, object> resources, IDictionary<string, string> manifestInfoEntries)
Parameters
languageCodestringnameFinderModelIMaxentModelgeneratorDescriptorbyte[]resourcesIDictionary<string, object>manifestInfoEntriesIDictionary<string, string>
TokenNameFinderModel(string, IMaxentModel, IDictionary<string, object>, IDictionary<string, string>)
public TokenNameFinderModel(string languageCode, IMaxentModel nameFinderModel, IDictionary<string, object> resources, IDictionary<string, string> manifestInfoEntries)
Parameters
languageCodestringnameFinderModelIMaxentModelresourcesIDictionary<string, object>manifestInfoEntriesIDictionary<string, string>
TokenNameFinderModel(string, IMaxentModel, int, byte[]?, IDictionary<string, object>?, IDictionary<string, string>, ISequenceCodec<string>, TokenNameFinderFactory)
public TokenNameFinderModel(string languageCode, IMaxentModel nameFinderModel, int beamSize, byte[]? generatorDescriptor, IDictionary<string, object>? resources, IDictionary<string, string> manifestInfoEntries, ISequenceCodec<string> seqCodec, TokenNameFinderFactory factory)
Parameters
languageCodestringnameFinderModelIMaxentModelbeamSizeintgeneratorDescriptorbyte[]resourcesIDictionary<string, object>manifestInfoEntriesIDictionary<string, string>seqCodecISequenceCodec<string>factoryTokenNameFinderFactory
TokenNameFinderModel(string, ISequenceClassificationModel<string>, byte[]?, IDictionary<string, object>?, IDictionary<string, string>, ISequenceCodec<string>, TokenNameFinderFactory)
public TokenNameFinderModel(string languageCode, ISequenceClassificationModel<string> nameFinderModel, byte[]? generatorDescriptor, IDictionary<string, object>? resources, IDictionary<string, string> manifestInfoEntries, ISequenceCodec<string> seqCodec, TokenNameFinderFactory factory)
Parameters
languageCodestringnameFinderModelISequenceClassificationModel<string>generatorDescriptorbyte[]resourcesIDictionary<string, object>manifestInfoEntriesIDictionary<string, string>seqCodecISequenceCodec<string>factoryTokenNameFinderFactory
Properties
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 virtual TokenNameFinderFactory Factory { get; }
Property Value
NameFinderSequenceModel
public virtual ISequenceClassificationModel<string>? NameFinderSequenceModel { get; }
Property Value
SequenceCodec
public virtual ISequenceCodec<string> SequenceCodec { get; }
Property Value
Methods
CreateArtifactSerializers()
Create the artifact serializers. Currently for serializers related to
features that require external resources, such as W2VClassesDictionary
objects, the convention is to add its element tag name as key of the serializer map.
For example, the element tag name for the WordClusterFeatureGenerator which
uses W2VClassesDictionary objects serialized by the W2VClassesDictionarySerializer
is 'wordcluster', which is the key used to add the serializer to the map.
public static IDictionary<string, IArtifactSerializer> CreateArtifactSerializers()
Returns
- IDictionary<string, IArtifactSerializer>
the map containing the added serializers
CreateArtifactSerializers(IDictionary<string, IArtifactSerializer>)
Registers all IArtifactSerializer for their artifact file name extensions. The registered IArtifactSerializer are used to create and serialize resources in the model package.
Override this method to register custom IArtifactSerializers.
Note: Subclasses should generally invoke super.createArtifactSerializers at the beginning of this method.
This method is called during construction.
public override void CreateArtifactSerializers(IDictionary<string, IArtifactSerializer> serializers)
Parameters
serializersIDictionary<string, IArtifactSerializer>the key of the map is the file extension used to lookup the IArtifactSerializer.
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()