我正在尝试使用Watson API进行情感分析。代码很简单。 但为什么我一直得到这个错误?????为什么我一直得到415 WatsonException:错误:Python中不支持的媒体类型?
WatsonException: Error: unsupported media type, Code: 415
没有关于API文档中的这个错误。
from watson_developer_cloud import AlchemyLanguageV1
alchemy_language = AlchemyLanguageV1(url="https://gateway.watsonplatform.net/natural-language-understanding/api",
username="xxx",
password="xxx")
print(json.dumps(alchemy_language.sentiment(text="hehe")))
当你构建AlchemyLanguageV1对象或调用sentiment()方法时,你会得到错误吗? – mekkanizer