SpanBasedNEROptions
Options & Configuration · AiDotNet.NER.Options
Options shared by span-based NER models (SpERT, BiaffineNER, PURE).
Known derived types: BiaffineNEROptions
How It Works
Span-based NER models enumerate all possible spans in a sentence and classify each span as an entity type or non-entity. This contrasts with sequence labeling (BIO tagging) where each token is independently labeled. Span-based models handle nested entities naturally because overlapping spans can each have different labels.
Constructors
| Constructor | Summary |
|---|---|
SpanBasedNEROptions() |
Creates a new instance with default settings (BERT-base defaults). |
SpanBasedNEROptions(SpanBasedNEROptions other) |
Deep-copy constructor. |
Properties
| Property | Summary |
|---|---|
NERModelVariant Variant { get; set; } |
Gets or sets the NER model variant. |
OnnxModelOptions OnnxOptions { get; set; } |
Gets or sets ONNX runtime inference options. |
bool UseNegativeSampling { get; set; } |
Gets or sets whether negative spans are sub-sampled during training. |
double DecayRate { get; set; } |
Multiplicative learning-rate decay applied every DecayFrequency steps. |
double DropoutRate { get; set; } |
Gets or sets the dropout rate. |
double LearningRate { get; set; } |
Gets or sets the learning rate for the optimizer. |
int DecayFrequency { get; set; } |
How many optimizer steps between applications of DecayRate. |
int FfnnDepth { get; set; } |
Number of layers in each boundary FFNN that produces the span start/end representations. |
int HiddenDimension { get; set; } |
Gets or sets the hidden dimension of the encoder. |
int IntermediateDimension { get; set; } |
Gets or sets the feed-forward intermediate dimension. |
int MaxSequenceLength { get; set; } |
Gets or sets the maximum sequence length in tokens. |
int MaxSpanLength { get; set; } |
Gets or sets the maximum span length (number of tokens in a single entity span): the bound on the candidate spans the model enumerates and scores. |
int NegativeSpanSampleRatio { get; set; } |
Gets or sets the ratio of negative (non-entity) spans to positive (entity) spans sampled during training. |
int NumAttentionHeads { get; set; } |
Gets or sets the number of attention heads in each transformer layer. |
int NumLabels { get; set; } |
Gets or sets the number of entity labels (including O tag). |
int NumTransformerLayers { get; set; } |
Gets or sets the number of transformer encoder layers. |
int SpanEmbeddingDimension { get; set; } |
Gets or sets the span embedding dimension used for span classification. |
string ModelPath { get; set; } |
Gets or sets the path to an ONNX model file for inference mode. |
string[] LabelNames { get; set; } |
Gets or sets the label names for the NER tags. |