Example #1
0
        public ClassificationResponse ClassifyText(string classifierName, List <string> textList, bool isObject = false)
        {
            string ApiPath = CommonUtils.Format(config.ClassifyTextUrl, new { username = config.UserName, classifierName = classifierName });
            string body    = JsonConvert.SerializeObject(new { texts = textList });

            return(APIRequestHelper.DoAPIRequest(config.BaseUrl, ApiPath, config.Read_API_KEY, body, "POST", true));
        }
Example #2
0
        public string ClassifyTextWithLanguage(string classifierName, string language, List <string> textList)
        {
            string ApiPath = CommonUtils.Format(config.ClassifyTextUrl, new { username = config.UserName, classifierName = classifierName, language = language });
            string body    = JsonConvert.SerializeObject(new { texts = textList });

            return(APIRequestHelper.DoAPIRequest(config.BaseUrl, ApiPath, config.Read_API_KEY, body, "POST"));
        }
Example #3
0
        public string UnTrainClassifier(string classifierName, string className, string text)
        {
            string ApiPath = CommonUtils.Format(config.UnTrainClassifierUrl, new { classifierName = classifierName, className = className, });
            string body    = JsonConvert.SerializeObject(new { texts = text });

            return(APIRequestHelper.DoAPIRequest(config.BaseUrl, ApiPath, config.Read_API_KEY, body, "POST"));
        }
Example #4
0
        public string RemoveClassifierClass(string classifierName, string className)
        {
            string ApiPath = CommonUtils.Format(config.RemoveClassifierClassUrl, new { classifierName = classifierName });
            string body    = JsonConvert.SerializeObject(new { className = className });

            return(APIRequestHelper.DoAPIRequest(config.BaseUrl, ApiPath, config.Write_API_KEY, body, "POST"));
        }
Example #5
0
        public string ClassifyTextKeywords(string classifierName, string text)
        {
            string ApiPath = CommonUtils.Format(config.ClassifyTextKeywordsUrl, new { username = config.UserName, classifierName = classifierName });
            string body    = JsonConvert.SerializeObject(new { texts = new List <string> {
                                                                   text
                                                               } });

            return(APIRequestHelper.DoAPIRequest(config.BaseUrl, ApiPath, config.Read_API_KEY, body, "POST"));
        }
Example #6
0
        public List <KeywordsResponse> ClassifyTextKeywords(string classifierName, string text, bool isObject = false)
        {
            string ApiPath = CommonUtils.Format(config.ClassifyTextKeywordsUrl, new { username = config.UserName, classifierName = classifierName });
            string body    = JsonConvert.SerializeObject(new { texts = text });

            KeywordsResponse[][]            keyvalye          = APIRequestHelper.DoAPIRequest(config.BaseUrl, ApiPath, config.Read_API_KEY, body, "POST", true);
            List <List <KeywordsResponse> > keywordListOfList = keyvalye.Select(x => x.ToList()).ToList();
            var keywordList = keywordListOfList.SelectMany(d => d).ToList();

            return(keywordList);
        }
Example #7
0
        public bool RemoveClassifier(string classifierName)
        {
            string ApiPath = CommonUtils.Format(config.RemoveClassifierUrl, new { classifierName = classifierName });

            return(APIRequestHelper.DoAPIRequest(config.BaseUrl, ApiPath, config.Write_API_KEY, "", "POST"));
        }
Example #8
0
        public List <ClassifierInformationResponse> GetClassifierInformation(string classifierName, bool isObject)
        {
            string ApiPath = CommonUtils.Format(config.GetClassifierInformationUrl, new { username = config.UserName, classifierName = classifierName });

            return(APIRequestHelper.DoAPIRequest(config.BaseUrl, ApiPath, config.Write_API_KEY, "", "POST", isObject));
        }
Example #9
0
        public string GetClassifierInformation(string classifierName)
        {
            string ApiPath = CommonUtils.Format(config.GetClassifierInformationUrl, new { username = config.UserName, classifierName = classifierName });

            return(APIRequestHelper.DoAPIRequest(config.BaseUrl, ApiPath, config.Write_API_KEY, "", "POST"));
        }