FinBERTOptions<T>
Options & Configuration · AiDotNet.Models.Options
Configuration options for FinBERT (Financial BERT) model.
Inheritance: ModelOptions → FinBERTOptions<T>
For Beginners
FinBERT is designed specifically for financial text:
The Key Insight: General-purpose sentiment models often misinterpret financial language. For example, “shares fell 3%” is negative for the stock, but a general sentiment model might not understand this. FinBERT is trained on financial text to understand such nuances.
What Problems Does FinBERT Solve?
- Sentiment analysis of financial news articles
- Analyzing SEC filings (10-K, 10-Q, 8-K)
- Processing earnings call transcripts
- Social media sentiment for stock prediction
- Document classification in financial contexts
How FinBERT Works:
- Pre-training: BERT architecture trained on large text corpus
- Fine-tuning: Further trained on financial-specific text and labels
- Tokenization: Text is split into WordPiece tokens (subwords)
- Embedding: Tokens are converted to dense vectors
- Transformer: Self-attention captures context across the sequence
- Classification: [CLS] token is used for sentiment prediction
FinBERT Architecture:
- Input: [CLS] token1 token2 … tokenN [SEP]
- Embeddings: Token + Position + Segment embeddings
- Transformer: 12 layers of multi-head self-attention
- Output: Softmax over sentiment classes
Key Benefits:
- Understands financial language and terminology
- Captures context and nuance in financial text
- Pre-trained on large financial corpora
- State-of-the-art for financial sentiment analysis
How It Works
FinBERT is a BERT model fine-tuned on financial text for sentiment analysis and understanding of financial language.
Reference: Araci, “FinBERT: Financial Sentiment Analysis with Pre-trained Language Models”, 2019.
https://arxiv.org/abs/1908.10063
Constructors
| Constructor | Summary |
|---|---|
FinBERTOptions() |
Initializes a new instance of the FinBERTOptions class with default values. |
FinBERTOptions(FinBERTOptions<T> other) |
Initializes a new instance by copying from another instance. |
Properties
| Property | Summary |
|---|---|
bool FreezeBaseModel { get; set; } |
Gets or sets whether to freeze the base model during fine-tuning. |
bool UsePretrainedWeights { get; set; } |
Gets or sets whether to use pretrained weights. |
double AttentionDropoutRate { get; set; } |
Gets or sets the attention-specific dropout rate. |
double DropoutRate { get; set; } |
Gets or sets the dropout rate for regularization. |
double HiddenDropoutRate { get; set; } |
Gets or sets the hidden layer dropout rate. |
int HiddenDimension { get; set; } |
Gets or sets the hidden dimension of transformer layers. |
int IntermediateDimension { get; set; } |
Gets or sets the intermediate (feed-forward) dimension. |
int MaxPositionEmbeddings { get; set; } |
Gets or sets the maximum position embeddings. |
int MaxSequenceLength { get; set; } |
Gets or sets the maximum sequence length in tokens. |
int NumAttentionHeads { get; set; } |
Gets or sets the number of attention heads. |
int NumFineTuneLayers { get; set; } |
Gets or sets the number of layers to fine-tune (from the top). |
int NumLayers { get; set; } |
Gets or sets the number of transformer layers. |
int NumSentimentClasses { get; set; } |
Gets or sets the number of sentiment classes. |
int TypeVocabSize { get; set; } |
Gets or sets the type vocabulary size (for sentence pairs). |
int VocabularySize { get; set; } |
Gets or sets the vocabulary size. |
string PretrainedModelPath { get; set; } |
Gets or sets the path to pretrained model weights. |