用百度的自然语言分析Python的,调用的时候报错怎么解决
Ta的回复 :我的错误能不能帮忙看看: APPID:9759742 from aip import AipNlp # 定义常量 APP_ID = '9759742' API_KEY = 'xxx' SECRET_KEY = 'xxx' # 初始化AipNlp对象 aipNlp = AipNlp(APP_ID, API_KEY, SECRET_KEY) result = aipNlp.wordEmbedding('百度') 运行错误: Traceback (most recent call last): File "C:/Users/hyang13/Desktop/superBot/test.py", line 10, in result = aipNlp.wordEmbedding('百度') File "C:\Anaconda3\lib\site-packages\aip\nlp.py", line 105, in wordEmbedding return self._request(self.__wordEmbeddingUrl, self.__processData(data)) File "C:\Anaconda3\lib\site-packages\aip\nlp.py", line 55, in __processData return json.dumps(content) File "C:\Anaconda3\lib\json\__init__.py", line 230, in dumps return _default_encoder.encode(obj) File "C:\Anaconda3\lib\json\encoder.py", line 198, in encode chunks = self.iterencode(o, _one_shot=True) File "C:\Anaconda3\lib\json\encoder.py", line 256, in iterencode return _iterencode(o, 0) File "C:\Anaconda3\lib\json\encoder.py", line 179, in default raise TypeError(repr(o) + " is not JSON serializable") TypeError: b'\xb0\xd9\xb6\xc8' is not JSON serializable Process finished with exit code 1