【发布时间】:2016-05-27 10:36:43
【问题描述】:
我正在使用 IBM Watson Speech to text API 将音频文件转换为文本。每个功能对我来说都很好。但我无法使用关键字识别功能。输出未提供有关发现关键字的任何信息。
这是我的代码:
SpeechToText service = new SpeechToText();
service.setUsernameAndPassword("*********", "********");
//SpeechModel model =service.getModel("en-US_NarrowbandModel");
service.setEndPoint("https://stream.watsonplatform.net/speech-to-text/api");
String[] keys= {"abuse","bullying","parents","physical","assaulting"};
RecognizeOptions options = new RecognizeOptions().contentType("audio/wav").model("en-US_NarrowbandModel").continuous(true).inactivityTimeout(500).keywords(keys).keywordsThreshold(0.7);
File audio = new File("C:\\Users\\AudioFiles\\me.wav");
SpeechResults transcript = service.recognize(audio, options);
//Speech t1 = service.recognize(audio, options);
System.out.println(transcript);
是否有任何特殊功能可以将发现的关键字作为输出以及成绩单?
【问题讨论】:
-
Java-SDK 中存在错误。你现在可以检查吗?