hotpxl / corenlp-server

Server wrapper for Stanford CoreNLP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CoreNLP Server

This is a server wrapper for the Stanford CoreNLP.

Dependencies

For client-side Python script, you need to install Requests.

Stanford CoreNLP is also needed. Just run ./get-corenlp.sh.

If you use Docker, nothing else is needed.

If you decide to install it directly, please take a look at Dockerfile for how to set up from scratch.

Docker usage

With the Dockerfile, you could spawn a Docker container easily.

Run the following command to build.

# Build Docker image.
docker build -t corenlp-server .

Usage

# Run Docker image in a container.
# This will map port 8081 on the host to port 80 inside the container.
docker run -d -p 8081:80 --log-opt max-file=8 --log-opt max-size=8m --name corenlp-server corenlp-server

This will open an HTTP server on port 8081. Try the following for a demonstration. The first request may take longer since the server is loading models.

curl --data 'The quick brown fox jumped over the lazy dog.' 'http://localhost:8081/?properties=%7B%22tokenize.whitespace%22%3A%22true%22%2C%22annotators%22%3A%22tokenize%2Cssplit%2Cpos%22%2C%22outputFormat%22%3A%22json%22%7D'

About

Server wrapper for Stanford CoreNLP

License:MIT License


Languages

Language:Python 73.5%Language:Shell 26.5%