This java program provides RESTful API for Apache OpenNLP library.
-
Default binding address is: 0.0.0.0:80
-
The web service consumes POST requests with raw data (
text/plain
) payload. -
At the moment, it only supports English language (through official pre-trained models for the OpenNLP 1.5).
$ git clone https://github.com/rbehzadan/opennlp-service.git
cd opennlp-service
$ mkdir models
$ cd models
$ wget -i ../models.url
$ cd ..
$ mvn clean package
$ java -jar target/opennlp-service-1.0.jar
$ curl http://localhost -d "Grammar is useless because there is nothing to say."
You can change listening address and port by these two environment variables:
OPENNLP_SERVICE_HOST
OPENNLP_SERVICE_PORT
ย
You can find some samples here.
$ cd opennlp-service
$ docker build -t opennlp .
$ docker run --name opennlp --rm -p 80:80 -d opennlp
To specify the listening port:
$ docker run -e OPENNLP_SERVICE_PORT=1234 -p 1234:1234 -d opennlp
If you're using Docker for Mac, you may have to specify a memory limit.
$ docker run --memory 4G -p 80:80 -d opennlp
- The project (itself), is licensed under the MIT License
- Jersey and Grizzly are licensed under CDDL version 1.0 and GPL v2 license
- Apache OpenNLP library is licensed under Apache 2.0 license