Пример #1
0
        public async Task <TextAnalysisResults> TextAnalyticsCall(string text)
        {
            List <Input> list      = BreakText(text);
            var          language  = new LanguageMain();
            var          keyphrase = new KeyPhraseMain();
            var          sentiment = new SentimentMain();

            try
            {
                Results.LanguageResult = await language.DetectLangCall(_Client, list);

                if (Results.LanguageResult.Documents.Count > 0)
                {
                    Results.KeyPhraseResult = await keyphrase.GetKeyPhraseCall(list, Results.LanguageResult.Documents, _Client);

                    Results.SentimentResult = await sentiment.GetSentimentCall(list, Results.LanguageResult.Documents, _Client);
                }
                return(Results);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #2
0
        public DetectDominantLanguageResponse GetLanguage(string text)
        {
            LanguageMain language = new LanguageMain(_Client);

            return(language.GetLanguage(text).Result);
        }