我想使用IBM Watson Discovery Services,但嘗試時收到錯誤消息。 的錯誤信息是:WatsonException: Unauthorized: Access is denied due to invalid credentials
Watson Discovery「由於憑據無效導致訪問被拒絕」 - Python
import sys
import os
import json
from watson_developer_cloud import DiscoveryV1
discovery = DiscoveryV1(
username="{bbbaaaaa}",
password="{aaaaaabbbb}",
version="2017-09-01"
)
qopts = {'query': 'enriched_text.entities.text:IBM'}
my_query = discovery.query('system', 'news', qopts)
print(json.dumps(my_query, indent=2))
僅供參考,如果這些都是實際發現憑證,我強烈建議刪除或更改它們。 – tmarkiewicz