我正在使用python3.5,并尝试在python上运行googlecloud自然语言api。 我试过这个代码:
from googleapiclient import discovery
lang_service = discovery.build('language', 'v1beta1', developerKey= 'mykey')
body = {
'document': {
'type': 'PLAIN_TEXT',
'content': 'Google Inc Apple Inc',
},
'features': {
'extract_syntax': True,
},
'encodingType': encoding,
}
ret = lang_service.documents().annotateText(body=body).execute()
print (ret)
mykey被我的api密钥替换。 代码没有出错,但我没有给我任何结果。你知道吗
顺便说一句,如果你知道如何在python上运行google自然语言api,请帮助我!你知道吗
目前没有回答
相关问题 更多 >
编程相关推荐