Ejemplo n.º 1
0
        public BaiduEmotionModel Emotion(string text)
        {
            var client = new Baidu.Aip.Nlp.Nlp(APP_KEY, SECRET_KEY);

            client.Timeout = TIME_OUT;
            var options = new Dictionary <string, object> {
                { "scene", "talk" }
            };

            try
            {
                var result = client.Emotion(text, options);
                return(result.ToObject <BaiduEmotionModel>());
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }