Lynten / stanford-corenlp

Python wrapper for Stanford CoreNLP.
MIT License
920 stars 200 forks source link

JSONDecodeError: Expecting value #17

Closed DANNALI35 closed 6 years ago

DANNALI35 commented 6 years ago

i am trying to run the following sample code, and i get the jsonDecodeError. looks like the program cannot find any object to decode. i am using anaconda python 3.6

from stanfordcorenlp import StanfordCoreNLP nlp = StanfordCoreNLP(r'C:/Users/lidan/Desktop/es/corenlp/stanford-corenlp-full-2017-06-09/') sentence = "Guangdong University of Foreign Studies is located in Guangzhou." print ('Tokenize:', nlp.word_tokenize(sentence))

Traceback (most recent call last):

File "", line 4, in print ('Tokenize:', nlp.word_tokenize(sentence))

File "C:\Users\lidan\Anaconda3\lib\site-packages\stanfordcorenlp\corenlp.py", line 132, in word_tokenize r_dict = self._request('ssplit,tokenize', sentence)

File "C:\Users\lidan\Anaconda3\lib\site-packages\stanfordcorenlp\corenlp.py", line 171, in _request r_dict = json.loads(r.text)

File "C:\Users\lidan\Anaconda3\lib\json__init__.py", line 354, in loads return _default_decoder.decode(s)

File "C:\Users\lidan\Anaconda3\lib\json\decoder.py", line 339, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end())

File "C:\Users\lidan\Anaconda3\lib\json\decoder.py", line 357, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None

JSONDecodeError: Expecting value

Lynten commented 6 years ago

Check the comment of #16.