A RESTful service that service NLP parsing requests.
1.8K
A RESTful service that service NLP parsing requests using the NLP service application. This makes the NLP parsing project available as a REST service.
Additional documentation.
Start the RESTful service, on say, port 9000 (defaults to 8080):
$ ./nlparse service -p 9000
Use a web client to test the service using the pretty print option:
$ wget -q -O - 'http://localhost:9100/parse?utterance=My+name+is+Paul+Landes&pretty=true'
The output:
{"text":"My name is Paul Landes",
"mentions":
[{"entity-type":"PERSON",
"token-range":[3, 5],
"ner-tag":"PERSON",
"sent-index":0,
"char-range":[11, 22],
"text":"Paul Landes"}],
"tok-re-mentions":[],
"coref":
[{"id":1,
"mention":
[{"sent-index":1,
"token-range":[4, 6],
"head-index":5,
"gender":"MALE",
"animacy":"ANIMATE",
"type":"PROPER",
"number":"SINGULAR"}]},
Note: I will make the distribution binaries available on request.
For convenience, here's the usage docs you get when invoking with no parameters:
$ nlparse
repl start a repl either on the command line or headless with -h
-h, --headless start an nREPL server
-p, --port NUMBER 12345 the port bind for the repl server
parse parse an English utterance
-l, --level LOG LEVEL INFO Log level to set in the Log4J2 system.
-u, --utterance TEXT The utterance to parse
-p, --pretty Pretty print the JSON string
service start the agent parse website and service
-p, --port PORT 8080 the port bind for web site/service
version Get the version of the application.
-g, --gitref
A docker image is available with an install of this service at Docker Hub. Here's an example of how to use the image in a docker-compose.yml:
nlpserv:
container_name: nlps
image: plandes/nlpserv
ports:
- "9100:9100"
environment:
COMPONENTS: tokenize,sentence,stopword,part-of-speech,morphology
PORT: 9100
Copyright © 2016, 2017 Paul Landes
Apache License version 2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Content type
Image
Digest
Size
1.9 GB
Last updated
about 9 years ago
docker pull plandes/nlpservice