Cognitive Services Topic Detection API not returning any results

天大地大妈咪最大 提交于 2019-12-25 07:49:16

问题


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.

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. I created an TopicDetectionInputV2 object to which I added the 2000+ InputV2 documents. Tried with and without the StopWords and TopicsToExclude.

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

I always receive a null response from the API call.

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.

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


回答1:


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

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

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



来源:https://stackoverflow.com/questions/41468148/cognitive-services-topic-detection-api-not-returning-any-results

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!