豆福传

2023-09-11更新 / 4.0分 / 动画 / 大陆 / 2017

聚合云播

排序

豆福传剧情简介

"; //text="天涯无处可寻,我的迷失天堂!"; text=strResulta; try { text=text.replaceAll(" ", ""); //创建一个接口 //HttpUtils.HttpResponse//得到对象 //text 需要分词的内容 cut_threshold:如果设置了此参数,会返回所有概率不低于cut_threshold的词语,如果没设则默认是0.5 HttpUtils.HttpResponse response = HttpUtils.sendGet("http://www.datatang.com/webapi/cloud/sensitive/words", "text=" text "&apikey=" apiKey );// System.out.println(response);//结果在控制台输出 //创建一个如下的对象 // {"errno": 0, "data": [{"word": "迷失天堂", "score": 0.999279, "tag": "不良事件名称", "sentiment": "negative"}, {"word": "天堂", "score": 0.985262, "tag": "词语", "sentiment": "neutral"}, {"word": "我的", "score": 0.999288, "tag": "我称", "sentiment": "neutral"}, {"word": "天涯", "score": 0.982305, "tag": "词语", "sentiment": "neutral"}, {"word": "迷失", "score": 0.975591, "tag": "不良事件名称", "sentiment": "negative"}]} JSONObject json = JSONObject.fromObject(response.getResponseBody()); //得到一个对象 System.out.println("response data:" response.getResponseBody());//结果在控制台获取 String dataArray = json.getString("data"); JSONArray jsonarray = JSONArray.fromObject(dataArray); //获取第一个对象 JSONObject JsonObject = (JSONObject)jsonarray.get(0); System.out.println("JsonObject:" JsonObject.toString()); System.out.println("errno:" json.getString("errno")); //词语 String word = JsonObject.getString("word"); System.out.println("word:" word); //概率 String score = JsonObject.getString("score"); System.out.println("score:" score); //情感极性,每一个词语都有结果 String sentiment = JsonObject.getString("sentiment"); System.out.println("sentiment:" sentiment); //词性 String tag = JsonObject.getString("tag"); System.out.println("tag:" tag); } catch (Exception e) { e.printStackTrace(); } }}

猜你喜欢

长骑美眉

3.0 2016/日本/动画

吉尔伽美什

6.0 2003/Japan/动画

奴隶区TheAnimation

10.0 2018/日本/剧情,动画

斗破苍穹缘起

8.0 2022/大陆/动作,动画,奇幻,冒险,古装