FinBERTTone<T>
Models & Types · AiDotNet.Finance.NLP
FinBERT-tone neural network model specialized for financial sentiment analysis.
Inheritance: NeuralNetworkBase<T> → FinancialModelBase<T> → FinancialNLPModelBase<T> → FinBERTTone<T>
For Beginners
FinBERT-Tone is a specialized sentiment analysis model for financial text. Given a sentence from an earnings call, news article, or analyst report, it classifies the sentiment as positive, negative, or neutral. It understands financial context, so “revenue declined less than expected” is correctly identified as positive sentiment despite containing the word “declined”.
Example
// Define architecture for financial tone classification (512 tokens, 3 sentiment classes)
var architecture = new NeuralNetworkArchitecture<double>(
inputType: InputType.OneDimensional,
taskType: NeuralNetworkTaskType.MultiClassClassification,
inputHeight: 512, inputWidth: 1, inputDepth: 1, outputSize: 3);
// Training mode: fine-tune BERT for financial tone detection in earnings calls
var model = new FinBERTTone<double>(architecture);
// ONNX inference mode: load pre-trained FinBERT-Tone model
var onnxModel = new FinBERTTone<double>(architecture, "finbert_tone.onnx");
Constructors
| Constructor | Summary |
|---|---|
FinBERTTone(NeuralNetworkArchitecture<T> architecture, FinBERTToneOptions<T> options, IGradientBasedOptimizer<T, Tensor<T>, Tensor<T>> optimizer, ILossFunction<T> lossFunction) |
Creates a FinBERT-tone network in native mode for training. |
FinBERTTone(NeuralNetworkArchitecture<T> architecture, string onnxModelPath, FinBERTToneOptions<T> options, IGradientBasedOptimizer<T, Tensor<T>, Tensor<T>> optimizer) |
Creates a FinBERT-tone network in native mode for training. |