FinancialBERT<T>

Models & Types · AiDotNet.Finance.NLP

FinancialBERT neural network model for domain-specific financial language processing.

Inheritance: NeuralNetworkBase<T> → FinancialModelBase<T> → FinancialNLPModelBase<T> → FinancialBERT<T>

For Beginners

FinancialBERT is a BERT model pre-trained on financial text from corporate reports, analyst notes, and financial news. It understands financial terminology and context better than general-purpose language models. Use it for tasks like classifying financial documents, extracting key information from earnings reports, or detecting sentiment in market commentary.

Example

// Define architecture for financial document classification (512 tokens, 5 document types)
var architecture = new NeuralNetworkArchitecture<double>(
    inputType: InputType.OneDimensional,
    taskType: NeuralNetworkTaskType.MultiClassClassification,
    inputHeight: 512, inputWidth: 1, inputDepth: 1, outputSize: 5);
            
// Training mode: BERT pre-trained on corporate reports and financial news
var model = new FinancialBERT<double>(architecture);
            
// ONNX inference mode: load pre-trained FinancialBERT model
var onnxModel = new FinancialBERT<double>(architecture, "financial_bert.onnx");

Constructors

Constructor Summary
FinancialBERT(NeuralNetworkArchitecture<T> architecture, FinancialBERTOptions<T> options, IGradientBasedOptimizer<T, Tensor<T>, Tensor<T>> optimizer, ILossFunction<T> lossFunction) Creates a FinancialBERT network in native mode for training.
FinancialBERT(NeuralNetworkArchitecture<T> architecture, string onnxModelPath, FinancialBERTOptions<T> options, IGradientBasedOptimizer<T, Tensor<T>, Tensor<T>> optimizer) Creates a FinancialBERT network in native mode for training.