我在哪里可以获得regexEntityId来通过API获取正则表达式实体 [英] Where can i get the regexEntityId to get the regex entities through API

查看:66
本文介绍了我在哪里可以获得regexEntityId来通过API获取正则表达式实体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

哪里可以通过API获取regexEntityId以获取正则表达式实体?

Where can get the regexEntityId to get the regex entities through API?

我正在尝试通过API获取正则表达式实体一个API,在执行此操作时,它要求regexEntityId。我在哪里可以找到这个?

I am trying to get the regex entities through an API, While doing this it is asking for regexEntityId. Where can I find this one?

推荐答案

以下是Python示例,请参阅https://westus.dev.cognitive.microsoft.com/docs/services/5890b47c39e2bb17b84a55ff/operations/5aa7dd5cd5b81c0b702579e9

Following is the Python sample, please find more in https://westus.dev.cognitive.microsoft.com/docs/services/5890b47c39e2bb17b84a55ff/operations/5aa7dd5cd5b81c0b702579e9

########### Python 2.7 ############# import httplib, urllib, base64 headers = { # Request headers 'Ocp-Apim-Subscription-Key': '{subscription key}', } params = urllib.urlencode({ }) try: conn = httplib.HTTPSConnection('westus.api.cognitive.microsoft.com') conn.request("GET", "/luis/api/v2.0/apps/{appId}/versions/{versionId}/regexentities/{regexEntityId}?%s" % params, "{body}", headers) response = conn.getresponse() data = response.read() print(data) conn.close() except Exception as e: print("[Errno {0}] {1}".format(e.errno, e.strerror)) #################################### ########### Python 3.2 ############# import http.client, urllib.request, urllib.parse, urllib.error, base64 headers = { # Request headers 'Ocp-Apim-Subscription-Key': '{subscription key}', } params = urllib.parse.urlencode({ }) try: conn = http.client.HTTPSConnection('westus.api.cognitive.microsoft.com') conn.request("GET", "/luis/api/v2.0/apps/{appId}/versions/{versionId}/regexentities/{regexEntityId}?%s" % params, "{body}", headers) response = conn.getresponse() data = response.read() print(data) conn.close() except Exception as e: print("[Errno {0}] {1}".format(e.errno, e.strerror)) ####################################


这篇关于我在哪里可以获得regexEntityId来通过API获取正则表达式实体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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