kermitt2 / grobid_client_python

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

ERROR: GROBID server does not appear up and running #33

Closed LaurentRisser closed 3 years ago

LaurentRisser commented 3 years ago

Hello,

I am trying to install the python version of Grobid and I have python 3.7.5 and linux machine I have installed the project into a directory, and I am getting the following error after entering the CLI: grobid_client --input /home/laurent/Documents/test_file_ETL_DE_BE/test_grobid processFulltextDocument ``GROBID server does not appear up and running, the connection to the server failed Any idea where the error is coming from? Thank you for your help. Laurent

kermitt2 commented 3 years ago

Hello !

You need a running GROBID server to use this client, see the documentation https://github.com/kermitt2/grobid-client-python#build-and-run

I recommend to use the docker image, which should be as simple as this:

docker pull lfoppiano/grobid:0.7.0
docker run -t --rm --init lfoppiano/grobid:0.7.0
LaurentRisser commented 3 years ago

Oh nice, its indeed working!

Thank you! Laurent

Umar888 commented 2 years ago

@kermitt2 I followed your instructions but it still says Grobid server does not appear up and running

kermitt2 commented 2 years ago

@Umar888 Hello ! We need more information on your os, environment, server version, etc. and on what you are exactly doing when installing the server to understand and reproduce a problem.

Umar888 commented 2 years ago

@kermitt2 i am running on Mac OS Monterey(12.3). I am using jupyter notebook running on anaconda navigator

Screenshot 2022-04-22 at 12 31 36 PM

r

Umar888 commented 2 years ago

@kermitt2 do u need any further any information?

Umar888 commented 2 years ago

@kermitt2 do i need to run on. any other compiler? even in terminal it says server is running

Screenshot 2022-04-22 at 12 39 29 PM
kermitt2 commented 2 years ago

Thank you @Umar888

Could you do a simple curl request to see if the server is okay:

curl -X POST -d "citations=Graff, Expert. Opin. Ther. Targets (2002) 6(1): 103-113" localhost:8070/api/processCitation

If it works, it might be due to the jupyter notebook environment. One basic thing to testis to replace in grobid_client_python/config.json localhost by 0.0.0.0.

Umar888 commented 2 years ago

@kermitt2 it gives me this error now

Screenshot 2022-04-22 at 1 02 58 PM
Umar888 commented 2 years ago

@kermitt2 it says failed to connect to localhost port 8070

Umar888 commented 2 years ago

@kermitt2 can we have google meet session? I want to show you live how I am setting up things

kermitt2 commented 2 years ago

@Umar888 usually this problem comes from the docker run, the port need to be mapped:

docker run -t --rm --init -p 8070:8070 lfoppiano/grobid:0.7.1

see https://grobid.readthedocs.io/en/latest/Grobid-docker/#crf-only-image

Umar888 commented 2 years ago

@kermitt2 brother I got this issue now. I need your suggestion regarding this

Screenshot 2022-04-25 at 1 02 04 PM
Umar888 commented 2 years ago

Actually, it is a request timeout error can you show me how to handle this this is my whole piece of code

from grobid_client.grobid_client import GrobidClient client = GrobidClient(config_path="/Users/revglue/grobid_client_python/config.json") client.process("processFulltextDocument", "/Users/revglue/study/main_work/my_working/testing_pdf", output="/Users/revglue/study/main_work/my_working/test_out", consolidate_citations=True, tei_coordinates=True, force=True)

kermitt2 commented 2 years ago

@Umar888 It might be due to the consolidate_citations=True. Consolidation calls CrossRef REST service by default to match extracted references against DOI and this web service is not very reliable and does not scale well. I would try with consolidate_citations=False to see if the timeout error disappears. If it's the case, you can then decrease the concurrency of the client to reduce the number of consolidations required (parameter n which 10 by default, which might be too high to use Crossref).