Class POSModel
The POSModel is the model used by a learnable IPOSTagger.
public sealed class POSModel : BaseModel, IArtifactProvider, ISerializableArtifact
- Inheritance
-
POSModel
- Implements
- Inherited Members
Constructors
POSModel(FileInfo)
public POSModel(FileInfo modelFile)
Parameters
modelFileFileInfo
POSModel(Stream)
public POSModel(Stream @in)
Parameters
inStream
POSModel(string, IMaxentModel, IDictionary<string, string>?, POSTaggerFactory)
public POSModel(string languageCode, IMaxentModel posModel, IDictionary<string, string>? manifestInfoEntries, POSTaggerFactory posFactory)
Parameters
languageCodestringposModelIMaxentModelmanifestInfoEntriesIDictionary<string, string>posFactoryPOSTaggerFactory
POSModel(string, IMaxentModel, int, IDictionary<string, string>?, POSTaggerFactory)
public POSModel(string languageCode, IMaxentModel posModel, int beamSize, IDictionary<string, string>? manifestInfoEntries, POSTaggerFactory posFactory)
Parameters
languageCodestringposModelIMaxentModelbeamSizeintmanifestInfoEntriesIDictionary<string, string>posFactoryPOSTaggerFactory
POSModel(string, ISequenceClassificationModel<string>, IDictionary<string, string>?, POSTaggerFactory)
public POSModel(string languageCode, ISequenceClassificationModel<string> posModel, IDictionary<string, string>? manifestInfoEntries, POSTaggerFactory posFactory)
Parameters
languageCodestringposModelISequenceClassificationModel<string>manifestInfoEntriesIDictionary<string, string>posFactoryPOSTaggerFactory
Properties
ArtifactSerializerClass
Retrieves the class which can serialize and recreate this artifact.
Note:
The serializer class must have a public zero argument constructor or
an exception is thrown during model serialization/loading.
public Type ArtifactSerializerClass { get; }
Property Value
- Type
the corresponding IArtifactSerializer class.
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 POSTaggerFactory Factory { get; }
Property Value
NgramDictionary
Retrieves the ngram dictionary.
public Dictionary? NgramDictionary { get; }
Property Value
- Dictionary
ngram dictionary or null if not used
PosModel
[Obsolete("Use PosSequenceModel instead. This property will be removed soon. Only required for Parser 1.5.x backward compatibility. Newer models don't need this anymore.")]
public IMaxentModel? PosModel { get; }
Property Value
PosSequenceModel
public ISequenceClassificationModel<string>? PosSequenceModel { get; }
Property Value
Methods
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()