kermitt2 / grobid_client_python

Python client for GROBID Web services
Apache License 2.0
275 stars 74 forks source link

Grobid ask for a 'config.json' file #30

Closed ali3nnn closed 3 years ago

ali3nnn commented 3 years ago

Steps to reproduce:

git clone https://github.com/kermitt2/grobid_client_python.git
cd grobid_client_python
python setup.py install or python3.7 setup.py install
grobid_client --input Downloads/grobid/inputs/ --output Downloads/grobid/outputs/ processFulltextDocument

Actual result: Traceback (most recent call last): File "/Users/alexmac/miniconda3/bin/grobid_client", line 33, in <module> sys.exit(load_entry_point('grobid-client-python==0.0.2', 'console_scripts', 'grobid_client')()) File "/Users/alexmac/miniconda3/lib/python3.7/site-packages/grobid_client_python-0.0.2-py3.7.egg/grobid_client/grobid_client.py", line 360, in main File "/Users/alexmac/miniconda3/lib/python3.7/site-packages/grobid_client_python-0.0.2-py3.7.egg/grobid_client/grobid_client.py", line 31, in __init__ File "/Users/alexmac/miniconda3/lib/python3.7/site-packages/grobid_client_python-0.0.2-py3.7.egg/grobid_client/grobid_client.py", line 36, in _load_config FileNotFoundError: [Errno 2] No such file or directory: './config.json'

Expected: PDF file inside inputs folder converted to XML

kermitt2 commented 3 years ago

Hello @ali3nnn !

You are lauching grobid_client from a repertory different from the grobid_client_python install (in your steps to reproduce, I guess you are changing to another repository where Downloads/ is available). If you launch grobid_client from grobid_client_python/ you have a config.json file available, otherwise you need to specify where it is, for example:

grobid_client --config ~/grobid_client_python/config.json  --input Downloads/grobid/inputs/ --output Downloads/grobid/outputs/ processFulltextDocument