我已经下载了Watson统一SDK并将其设置为如图中的显示,它的工作原理。 我的问题是如何添加关键字点击? 我已阅读此问题For Watson's Speech-To-Text Unity SDK, how can you specify keywords? 但我不能找到SendStart函数。Watson关键字检测统一
回答
到文本的服务没有找到关键字的讲话。要查找关键字,您需要输入最终的文本输出并将其发送到Alchemy Language
服务。 Natural Language Understanding
服务仍然被抽象为Watson Unity SDK,但最终将取代炼金术语言。
private AlchemyAPI m_AlchemyAPI = new AlchemyAPI();
private void FindKeywords(string speechToTextFinalResponse)
{
if (!m_AlchemyAPI.ExtractKeywords(OnExtractKeywords, speechToTextFinalResponse))
Log.Debug("ExampleAlchemyLanguage", "Failed to get keywords.");
}
void OnExtractKeywords(KeywordData keywordData, string data)
{
Log.Debug("ExampleAlchemyLanguage", "GetKeywordsResult: {0}", JsonUtility.ToJson(resp));
}
编辑1
Natural Language Understanding
被抽象的托特他沃森统一SDK。
NaturalLanguageUnderstanding m_NaturalLanguageUnderstanding = new NaturalLanguageUnderstanding();
private static fsSerializer sm_Serializer = new fsSerializer();
private void FindKeywords(string speechToTextFinalResponse)
{
Parameters parameters = new Parameters()
{
text = speechToTextFinalResponse,
return_analyzed_text = true,
language = "en",
features = new Features()
{
entities = new EntitiesOptions()
{
limit = 50,
sentiment = true,
emotion = true,
},
keywords = new KeywordsOptions()
{
limit = 50,
sentiment = true,
emotion = true
}
}
if (!m_NaturalLanguageUnderstanding.Analyze(OnAnalyze, parameters))
Log.Debug("ExampleNaturalLanguageUnderstanding", "Failed to analyze.");
}
private void OnAnalyze(AnalysisResults resp, string customData)
{
fsData data = null;
sm_Serializer.TrySerialize(resp, out data).AssertSuccess();
Log.Debug("ExampleNaturalLanguageUnderstanding", "AnalysisResults: {0}", data.ToString());
}
EDIT 2 对不起,我没有意识到语音到文本必须做关键词定位的能力。感谢Nathan为我指出了这一点!我将这个功能添加到了Unity SDK未来的Speech to Text版本中。它看起来像这样的沃森统一SDK 1.0.0:
void Start()
{
// Create credential and instantiate service
Credentials credentials = new Credentials(_username, _password, _url);
_speechToText = new SpeechToText(credentials);
// Add keywords
List<string> keywords = new List<string>();
keywords.Add("speech");
_speechToText.KeywordsThreshold = 0.5f;
_speechToText.Keywords = keywords.ToArray();
_speechToText.Recognize(_audioClip, HandleOnRecognize);
}
private void HandleOnRecognize(SpeechRecognitionEvent result)
{
if (result != null && result.results.Length > 0)
{
foreach (var res in result.results)
{
foreach (var alt in res.alternatives)
{
string text = alt.transcript;
Log.Debug("ExampleSpeechToText", string.Format("{0} ({1}, {2:0.00})\n", text, res.final ? "Final" : "Interim", alt.confidence));
if (res.final)
_recognizeTested = true;
}
if (res.keywords_result != null && res.keywords_result.keyword != null)
{
foreach (var keyword in res.keywords_result.keyword)
{
Log.Debug("ExampleSpeechToText", "keyword: {0}, confidence: {1}, start time: {2}, end time: {3}", keyword.normalized_text, keyword.confidence, keyword.start_time, keyword.end_time);
}
}
}
}
}
目前,你可以找到重构分支here.该版本是一个重大更改,并拥有所有的较高水平(窗口小部件,配置等)的功能除去。
Speech to Text服务* does *支持关键字发现,但我认为Unity SDK可能还没有。 –
https://github.com/watson-developer-cloud/unity-sdk/issues/243 – taj
- 1. 关键字检测
- 2. IBM Watson-提取关键字和概念
- 3. 高效的关键字检测/提取。预定义的一组关键字
- 4. R:简单的关键字检测
- 5. HLSL中的统一关键字
- 6. 统一2D:碰撞检测
- 7. AutoHotKey检测数字键按
- 8. 如何为IBM Watson speech2text服务指定语音关键字?
- 9. 检测系统用户关机
- 10. 使用Powershell检测系统关机
- 11. 检查名称==关键字
- 12. 检查搜索关键字
- 13. 检测箭头键 - 一次
- 14. 标记系统中的关键字或关键词?
- 15. 在Matlab中的SIFT关键点检测
- 16. 检测键是否关闭mac python
- 17. Solr的得分关键词检测率
- 18. Gvim折叠系统verilog关键字对
- 19. Ehcache通过关键字统计
- 20. 比较非关键字段并检测更新记录
- 21. .Net - 检测标识符是否为关键字
- 22. 的Javascript检测何时属性与var关键字
- 23. Google检测到我网站上的无效关键字
- 24. 如何检测字节序的系统
- 25. 检测按键
- 26. 有没有一种方法来检测关键记录软件?
- 27. 关键检索
- 28. 机器人测试框架:运行关键字如果发生用户关键字不包含关键字
- 29. Selenium关键字驱动测试
- 30. jQuery验证,不检查关键字
哦,我不喜欢把Watson连接到Unity:/ – Fattie