2

Why the IBM natural language classifier is returning DecodeError ? Im try to classifier a collection, but now it returning error. A week ago, its was runing perfect

MY CODE

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)

OUTPUT

---------------------------------------------------------------------------
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().
Sansone
  • 41
  • 1
  • 4

1 Answers1

5

You may be having this problem due to the newest version of PyJWT (2.0.0). Try going back to the previous version with 'pip install PyJWT==1.7.1' and see if your project works.

Insaurator
  • 141
  • 2