安卓實現智慧聊天機器人(結合百度語音和圖靈機器人)
阿新 • • 發佈:2019-01-23
package com.ysk.tldemo;
//提問/回答
public class TalkBean {
public TalkBean(String content, int imageId, boolean isAsk) {
super();
this.content = content;
this.imageId = imageId;
this.isAsk = isAsk;
}
public String content;
public int imageId;
public boolean isAsk;//是否是提問
}
package com.ysk.tldemo; import java.util.ArrayList; public class VoiceBean { public ArrayList<WS> ws; public class WS { public ArrayList<CW> cw; } public class CW { public String w; } }
程式碼很簡單,沒什麼難度。使用時,將圖靈和百度的兩個key分別換成自己的就好了。