vaibhavad / python-wrapper-OpenIE5

Python wrapper for OpenIE5
https://pypi.org/project/pyopenie/
MIT License
40 stars 6 forks source link

JSONDecodeError: Expecting value: line 1 column 1 (char 0) #3

Open 23Uday opened 4 years ago

23Uday commented 4 years ago

A very long text leads to the following error: JSONDecodeError: Expecting value: line 1 column 1 (char 0) Server started with java -Xmx10-XX:+UseConcMarkSweepGC -jar openie-assembly-5.0-SNAPSHOT.jar --split --ignore-errors --httpPort 8000 The input text was text extracted from a research paper.

chaos87 commented 4 years ago

Maybe you could process sentence by sentence.

vaibhavad commented 4 years ago

Hi,

The --split option is currently used only while running OpenIE5 to process an input file. It is not applicable to running OpenIE5 as a server. Hence, you can split the text into sentences and pass each sentence to the server to get the extraction.

satya77 commented 4 years ago

This happens when the output is a list and not a single value, change the last line of openie.py to : try: e=json.loads(r.text) except: e=r.text return e

and then it works!