Skip to content

JSONDecodeError when calling Chinese jar in Python #1255

@4daJKong

Description

@4daJKong

I have download stanfordcorenlp 3.9.1.1 and the newest zip file stanford-corenlp-latest, still download Chinese model jar in this folder, when I run the code,

from stanfordcorenlp import StanfordCoreNLP
sentence = "香港理工大学校长滕锦光表示,任何情况下暴力都不是解决问题的方法。"
nlp_ch = StanfordCoreNLP(r'C:\stanford-corenlp-full-2018-02-27', lang='zh')
print('named entities:',nlp_ch.ner(sentence))

It shows error,

Exception has occurred: JSONDecodeError
Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

  File "[C:\...\stanford_filter.py]()", line 22, in <module>
    print('named entities:',nlp_ch.ner(sentence))

I have tried to download stanza, correct Json file but still didn't word, any idea?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions