| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | using System.Collections.Generic; |
| | 5 | | using System.Collections.ObjectModel; |
| | 6 | |
|
| | 7 | | namespace 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 | | { |
| 48 | 17 | | internal DocumentSentiment(TextSentiment sentiment, double positiveScore, double neutralScore, double negativeSc |
| | 18 | | { |
| 48 | 19 | | Sentiment = sentiment; |
| 48 | 20 | | ConfidenceScores = new SentimentConfidenceScores(positiveScore, neutralScore, negativeScore); |
| 48 | 21 | | Sentences = new ReadOnlyCollection<SentenceSentiment>(sentenceSentiments); |
| 48 | 22 | | Warnings = new ReadOnlyCollection<TextAnalyticsWarning>(warnings); |
| 48 | 23 | | } |
| | 24 | |
|
| | 25 | | /// <summary> |
| | 26 | | /// Gets the predicted sentiment for the analyzed document. |
| | 27 | | /// </summary> |
| 40 | 28 | | 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> |
| 160 | 34 | | public SentimentConfidenceScores ConfidenceScores { get; } |
| | 35 | |
|
| | 36 | | /// <summary> |
| | 37 | | /// Gets the predicted sentiment for each sentence in the corresponding |
| | 38 | | /// document. |
| | 39 | | /// </summary> |
| 44 | 40 | | public IReadOnlyCollection<SentenceSentiment> Sentences { get; } |
| | 41 | |
|
| | 42 | | /// <summary> |
| | 43 | | /// Gets the warnings encountered while processing the document. |
| | 44 | | /// </summary> |
| 0 | 45 | | public IReadOnlyCollection<TextAnalyticsWarning> Warnings { get; } |
| | 46 | | } |
| | 47 | | } |