我在哪里可以获得regexEntityId来通过API获取正则表达式实体 [英] Where can i get the regexEntityId to get the regex entities through 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屋!