Search code examples
multithreadingnlpstanford-nlp

Running Stanford CoreNLP server multithreadedly


I am running a Stanford CoreNLP server:

java -mx4g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer -port 9001 -timeout 50000

It seems that it only uses one core when processing texts. Is it possible to run the Stanford CoreNLP server multithreadedly, so that it utilizes more than one core?


Solution

  • This is correct; every request to the server only uses one core. You can get parallelism by making multiple server requests at once. This will run in parallel up to the number of cores on the server (or, the value of -threads passed into the server executable), and after that it'll queue up jobs in a thread pool.