Skip to content

Commit afd4439

Browse files
committed
Update corenlp and add shift reduce parser
1 parent 8e5b16d commit afd4439

File tree

2 files changed

+26
-9
lines changed

2 files changed

+26
-9
lines changed

Dockerfile

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
1-
FROM java:8
1+
FROM maven:alpine
22

3-
MAINTAINER Casey Hilland <casey dot hilland at gmail dot com>
3+
RUN apk add --update --no-cache \
4+
unzip wget
45

5-
RUN wget http://nlp.stanford.edu/software/stanford-corenlp-full-2015-12-09.zip
6-
RUN unzip stanford-corenlp-full-2015-12-09.zip && rm stanford-corenlp-full-2015-12-09.zip
6+
RUN wget http://nlp.stanford.edu/software/stanford-corenlp-full-2018-02-27.zip
7+
RUN unzip stanford-corenlp-full-2018-02-27.zip && \
8+
rm stanford-corenlp-full-2018-02-27.zip
79

8-
WORKDIR stanford-corenlp-full-2015-12-09
10+
WORKDIR stanford-corenlp-full-2018-02-27
11+
12+
RUN wget https://nlp.stanford.edu/software/stanford-srparser-2014-10-23-models.jar
13+
RUN mvn install:install-file -Dfile=stanford-srparser-2014-10-23-models.jar \
14+
-DgroupId=edu.stanford.nlp -DartifactId=stanford-srparser \
15+
-Dversion=3.5.2 -Dpackaging=jar
916

1017
RUN export CLASSPATH="`find . -name '*.jar'`"
1118

12-
EXPOSE 9000
19+
ENV PORT 9000
20+
21+
EXPOSE $PORT
1322

14-
CMD java -cp "*" -mx4g edu.stanford.nlp.pipeline.StanfordCoreNLPServer
23+
CMD java -cp "*" -mx4g edu.stanford.nlp.pipeline.StanfordCoreNLPServer -port \
24+
$PORT -parse.model edu/stanford/nlp/models/srparser/englishSR.ser.gz

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,12 @@ Dockerfile for Stanford CoreNLP Server
33
---------
44

55
This Dockerfile builds the [Stanford CoreNLP
6-
Server](http://stanfordnlp.github.io/CoreNLP/corenlp-server.html) and exposes
7-
the endpoint on port 9000. Requests are made as covered in the documentation.
6+
Server](http://stanfordnlp.github.io/CoreNLP/corenlp-server.html) and
7+
shift-reduce parser. It exposes the endpoint on port 9000. Requests
8+
are made as covered in the documentation.
9+
10+
## Build
11+
12+
```shell
13+
docker build -t corenlp:3.9.1 .
14+
```

0 commit comments

Comments
 (0)