kamalkraj / BERT-NER-TF

Named Entity Recognition with BERT using TensorFlow 2.0
Apache License 2.0
212 stars 71 forks source link

Float32 is not json serializable #13

Open RiteshKSingh1709 opened 4 years ago

RiteshKSingh1709 commented 4 years ago

Hi @kamalkraj , Nice work , but one thing while using the api.py and curl to get the prediction i got error float32 is not json serializable.

alexkohan commented 4 years ago

I solved that by changing the line 16 in api.py

from this:

`return`` jsonify({"result":out})`

to this:

`return jsonify({"result":str(out)})`

Hope it will help you.

RiteshKSingh1709 commented 4 years ago

Hi @alexkohan ,

Nice , But already there is one pull request is open for this . and wrapping the output in str will not give proper json I believe.