gpt4 book ai didi

python - 为什么 IBM 自然语言分类器返回 DecodeError。 Python

转载 作者:行者123 更新时间:2023-12-02 02:27:25 24 4
gpt4 key购买 nike

为什么 IBM 自然语言分类器返回 DecodeError ?我尝试对集合进行分类,但现在它返回错误。一周前,它运行完美

我的代码

classes_values = []
for i in range(0, len(materiasg), 10):
classes = natural_language_classifier.classify_collection(
classifier_id,
[{"text":materia} for materia in materiasg[i:(i+10 if i+10 < len(materiasg ) else len(materiasg))]]).get_result()
c = [sorted([[dicionario_classe["class_name"], dicionario_classe["confidence"]] for dicionario_classe in i["classes"]],key=lambda x: x[0]) for i in classes["collection"]]
classes_values += c

classes_values = np.array(classes_values)

输出

---------------------------------------------------------------------------
DecodeError Traceback (most recent call last)
<ipython-input-80-d2b25928198b> in <module>()
3 classes = natural_language_classifier.classify_collection(
4 classifier_id,
----> 5 [{"text":materia} for materia in materiasg[i:(i+10 if i+10 < len(materiasg ) else len(materiasg))]]).get_result()
6 c = [sorted([[dicionario_classe["class_name"], dicionario_classe["confidence"]] for dicionario_classe in i["classes"]],key=lambda x: x[0]) for i in classes["collection"]]
7 classes_values += c

7 frames
/usr/local/lib/python3.6/dist-packages/jwt/api_jwt.py in decode_complete(self, jwt, key, algorithms, options, **kwargs)
78 if options["verify_signature"] and not algorithms:
79 raise DecodeError(
---> 80 'It is required that you pass in a value for the "algorithms" argument when calling decode().'
81 )
82

DecodeError: It is required that you pass in a value for the "algorithms" argument when calling decode().

最佳答案

由于最新版本的 PyJWT (2.0.0),您可能会遇到此问题。尝试使用“pip install PyJWT==1.7.1”返回到以前的版本,看看您的项目是否有效。

关于python - 为什么 IBM 自然语言分类器返回 DecodeError。 Python,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65433267/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com