from QcloudApi.qcloudapi import QcloudApi
import json
config = {
"Region": "sh",
"secretId": "",
"secretKey": "",
"method": "get"
}
def request(params):
try:
service = QcloudApi(module, config)
print(service.generateUrl(action, params))
s = service.call(action, params)
dejson = json.loads(s)
print(dejson)
except Exception as e:
print("exception:", e)
if __name__ == "__main__":
module = 'wenzhi'
action = "LexicalAnalysis"
# action = 'LexicalSynonym'
# action = 'TextKeywords'
params = {
"text": "紫金山在哪里,是在南京吗",
"code": 0x00200000,
"type": 0
}
request(params)
网友评论