Class TokenNameFinderModel

Namespace
NOpenNLP.Tools.Namefind
Assembly
NOpenNLP.Tools.dll

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

modelFile FileInfo

TokenNameFinderModel(Stream)

public TokenNameFinderModel(Stream @in)

Parameters

in Stream

TokenNameFinderModel(string)

public TokenNameFinderModel(string modelPath)

Parameters

modelPath string

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

languageCode string
nameFinderModel IMaxentModel
generatorDescriptor byte[]
resources IDictionary<string, object>
manifestInfoEntries IDictionary<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

languageCode string
nameFinderModel IMaxentModel
resources IDictionary<string, object>
manifestInfoEntries IDictionary<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

languageCode string
nameFinderModel IMaxentModel
beamSize int
generatorDescriptor byte[]
resources IDictionary<string, object>
manifestInfoEntries IDictionary<string, string>
seqCodec ISequenceCodec<string>
factory TokenNameFinderFactory

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

languageCode string
nameFinderModel ISequenceClassificationModel<string>
generatorDescriptor byte[]
resources IDictionary<string, object>
manifestInfoEntries IDictionary<string, string>
seqCodec ISequenceCodec<string>
factory TokenNameFinderFactory

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

TokenNameFinderFactory

NameFinderSequenceModel

public virtual ISequenceClassificationModel<string>? NameFinderSequenceModel { get; }

Property Value

ISequenceClassificationModel<string>

SequenceCodec

public virtual ISequenceCodec<string> SequenceCodec { get; }

Property Value

ISequenceCodec<string>

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

serializers IDictionary<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()

Exceptions

InvalidFormatException

See Also