< Summary

Class:Azure.AI.TextAnalytics.DocumentSentiment
Assembly:Azure.AI.TextAnalytics
File(s):C:\Git\azure-sdk-for-net\sdk\textanalytics\Azure.AI.TextAnalytics\src\DocumentSentiment.cs
Covered lines:9
Uncovered lines:1
Coverable lines:10
Total lines:47
Line coverage:90% (9 of 10)
Covered branches:0
Total branches:0

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-100%100%
get_Sentiment()-100%100%
get_ConfidenceScores()-100%100%
get_Sentences()-100%100%
get_Warnings()-0%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\textanalytics\Azure.AI.TextAnalytics\src\DocumentSentiment.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System.Collections.Generic;
 5using System.Collections.ObjectModel;
 6
 7namespace Azure.AI.TextAnalytics
 8{
 9    /// <summary>
 10    /// Overall predicted sentiment and confidence scores for the document.
 11    /// It also includes per-sentence sentiment prediction.
 12    /// For more information regarding text sentiment, see
 13    /// <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/Text-Analytics/how-tos/text-analytics-how-to-
 14    /// </summary>
 15    public class DocumentSentiment
 16    {
 4817        internal DocumentSentiment(TextSentiment sentiment, double positiveScore, double neutralScore, double negativeSc
 18        {
 4819            Sentiment = sentiment;
 4820            ConfidenceScores = new SentimentConfidenceScores(positiveScore, neutralScore, negativeScore);
 4821            Sentences = new ReadOnlyCollection<SentenceSentiment>(sentenceSentiments);
 4822            Warnings = new ReadOnlyCollection<TextAnalyticsWarning>(warnings);
 4823        }
 24
 25        /// <summary>
 26        /// Gets the predicted sentiment for the analyzed document.
 27        /// </summary>
 4028        public TextSentiment Sentiment { get; }
 29
 30        /// <summary>
 31        /// Gets the sentiment confidence score (Softmax score) between 0 and 1,
 32        /// for each sentiment. Higher values signify higher confidence.
 33        /// </summary>
 16034        public SentimentConfidenceScores ConfidenceScores { get; }
 35
 36        /// <summary>
 37        /// Gets the predicted sentiment for each sentence in the corresponding
 38        /// document.
 39        /// </summary>
 4440        public IReadOnlyCollection<SentenceSentiment> Sentences { get; }
 41
 42        /// <summary>
 43        /// Gets the warnings encountered while processing the document.
 44        /// </summary>
 045        public IReadOnlyCollection<TextAnalyticsWarning> Warnings { get; }
 46    }
 47}