Exemplo n.º 1
0
        /// <summary>
        /// 获得配置文件生成Client对象
        /// </summary>
        /// <returns></returns>
        public static Nlp CreateClient()
        {
            // 设置APPID/AK/SK
            string APP_ID     = ConfigurationManager.AppSettings["APP_ID"];
            string API_KEY    = ConfigurationManager.AppSettings["API_KEY"];
            string SECRET_KEY = ConfigurationManager.AppSettings["SECRET_KEY"];

            Baidu.Aip.Nlp.Nlp client = new Baidu.Aip.Nlp.Nlp(API_KEY, SECRET_KEY);
            client.Timeout = 60000;
            return(client);
        }
Exemplo n.º 2
0
 public AipNLP()
 {
     client         = new Baidu.Aip.Nlp.Nlp(API_KEY, SECRET_KEY);
     client.Timeout = 60000;  // 修改超时时间
 }