认知服务主题检测 API 不返回任何结果 [英] Cognitive Services Topic Detection API not returning any results

查看:26
本文介绍了认知服务主题检测 API 不返回任何结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我似乎无法从用于主题检测的认知服务文本分析 API 获得任何结果.我下载了API 定义",并使用我下载的 Swagger 元数据文件将 REST API 客户端生成到 C# 项目中.

I can't seem to get any results back from the Cognitive Services Text Analytics API for Topic Detection. I downloaded the "API definition" and generated the REST API Client into a C# project using the Swagger metadata file that I downloaded.

我正在运行一个测试,其中包含 2000 多个包含常用短语的小句子,因此检测应该有效.代码构造如下:

I'm running a test that included 2000+ small sentences that include common phrases so the detection should work. The code is constructed as follows:

  1. 我创建了一个 TopicDetectionInputV2 对象,向其中添加了 2000 多个 InputV2 文档.尝试使用和不使用 StopWordsTopicsToExclude.

  1. I created an TopicDetectionInputV2 object to which I added the 2000+ InputV2 documents. Tried with and without the StopWords and TopicsToExclude.

我创建了一个 AzureMachineLearningTextAnalytics 对象,我将其称为 DetectTopics(key, null, null, null, TopicDetectionInputV2).尝试了每个单词集的最小/最大文档.

I created an AzureMachineLearningTextAnalytics object that I call the DetectTopics(key, null, null, null, TopicDetectionInputV2). Tried both min/max documents per word set.

我总是收到来自 API 调用的空响应.

I always receive a null response from the API call.

当我调试生成的 REST API 调用并检查 httpResponse 时,它总是返回 Status Code: 202ReasonPhrase: 'Accepted'code>,但是响应体是空的.

When I debug into the generated REST API call and inspect the httpResponse, it always returns a Status Code: 202 and ReasonPhrase: 'Accepted', however the response body is empty.

有没有人能够从 DetectTopics API 获得实际结果?任何信息都非常感谢.

Has anyone been able to get actual results from the DetectTopics API? Any information is greatly appreciated.

推荐答案

我没有使用过这个 API,但根据文档,这是预期的行为.

I haven't used this API, but according to the documentation this is the expected behavior.

DetectTopics API返回 202(正在处理)或 400(错误).

DetectTopics API will either return a 202 (processing) or 400 (error).

成功提交请求后,您应该使用 OperationStatus API.

Once the request has successfully been submitted, which is appears that it has, you should get the result using the OperationStatus API.

这篇关于认知服务主题检测 API 不返回任何结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆