Skip to content

[Solved][StanfordCoreNLP] Resolving requests.exceptions.ConnectionError: (‘Connection aborted.’, ConnectionResetError(10054, ‘An existing connection was forcibly closed by the remote host’, None, 10054, None))

Last Updated on 2021-03-29 by Clay

json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))

If you want to read more discussion of Stanford CoreNLP, maybe you can refer: https://stanfordnlp.github.io

Too many people meet many problems when they are using Python to call Stanford CoreNLP. Therefore, I decided to open a new record of possible solutions to these problems.

If there is a possibility of resolving the more error in the future, I may be able to update my text.


Solution

json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

If you have the error like above, maybe you can check your input: If you leave it blank, it is easy to get this error.

requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))

If such an error occurs, it is very likely that the memory has been filled by the java program. It is recommended to close all java programs in the suggestion body and remember to add at the end of the code.

nlp.close()


This command will close the java when you finished your program. If you get an interrupted unexpectedly, the java program will not close automatically.

If you want to see how to use Stanford CoreNLP with Python, maybe you can check out my Stanford CoreNLP Tutorial: Stanford CoreNLP Tutorial —— by Python

Tags:

Leave a ReplyCancel reply

Exit mobile version