Files
Finlytic/FinlyticCore/Dtos/Sentiment/FinBertResultDto.cs
T

64 lines
1.9 KiB
C#

using System.Text.Json.Serialization;
namespace FinlyticCore.Dtos.Sentiment;
/// <summary>
/// Probabilities dictionary containing positive, negative, and neutral softmax scores.
/// </summary>
public record FinBertProbabilities
{
/// <summary>
/// Gets or sets the positive probability score (0.0 to 1.0).
/// </summary>
[JsonPropertyName("positive")]
public double Positive { get; init; }
/// <summary>
/// Gets or sets the negative probability score (0.0 to 1.0).
/// </summary>
[JsonPropertyName("negative")]
public double Negative { get; init; }
/// <summary>
/// Gets or sets the neutral probability score (0.0 to 1.0).
/// </summary>
[JsonPropertyName("neutral")]
public double Neutral { get; init; }
}
/// <summary>
/// Data transfer object holding the result of a FinBERT sentiment analysis.
/// </summary>
public record FinBertResultDto
{
/// <summary>
/// Gets or sets the dominant sentiment label ("POSITIVE", "NEGATIVE", "NEUTRAL").
/// </summary>
[JsonPropertyName("label")]
public string Label { get; init; } = "NEUTRAL";
/// <summary>
/// Gets or sets the compound score (-1.0 to +1.0).
/// </summary>
[JsonPropertyName("compoundScore")]
public double CompoundScore { get; init; }
/// <summary>
/// Gets or sets the highest confidence score (0.0 to 1.0).
/// </summary>
[JsonPropertyName("confidence")]
public double Confidence { get; init; }
/// <summary>
/// Gets or sets the probability breakdown.
/// </summary>
[JsonPropertyName("probabilities")]
public FinBertProbabilities Probabilities { get; init; } = new();
/// <summary>
/// Gets or sets the short summary snippet highlighting the impact of the article.
/// </summary>
[JsonPropertyName("summarySnippet")]
public string? SummarySnippet { get; init; }
}