I am trying to do sentiment analysis from the c# code. I have enabled the sentiment analysis to true.
DetectIntentRequest detectIntentRequest = new DetectIntentRequest();
detectIntentRequest.QueryInput = queryInput;
detectIntentRequest.SessionAsSessionName = _sessionName;
detectIntentRequest.QueryParams = new QueryParameters(); detectIntentRequest.QueryParams.SentimentAnalysisRequestConfig = new SentimentAnalysisRequestConfig(); detectIntentRequest.QueryParams.SentimentAnalysisRequestConfig.AnalyzeQueryTextSentiment = true;
For few sentences, I get the SentimentAnalysisResult in present response. But for few sentences the SentimentAnalysisResult is null in response.
For example: When i send following as query string to detectIntent.
Show me possibilities not in Maharashtra - This gives valid result.
Show me possibilities in Maharashtra but not in pune - This gives SentimentAnalysisResult as null