Spindle Server contains a Dockerfile that can be used to create a containerised Flask server with the Spindle parser, which produces type-logical analyses of Dutch sentences. This project is built as a dependency to ParsePort.
The main entry point is a Dockerfile that will create a container, install the necessary dependencies and move the atom_map.tsv
and bert_config.json
files over to the container. In addition, this repository expects to find a file with PyTorch model weights (model_weights.pt
).
A host machine with Docker installed and internet access.
-
Put a copy of
model_weights.pt
in the root directory of this repository. -
Build an image with
docker build -t spindle-server:latest .
-
Run container and expose a port with
docker run -d -p 32768:5000 --name spindle-server spindle-server
-
After successful startup, the server will setup the parser. This may take a few minutes.
-
Connect to the parser by sending a request to
localhost:32768
. The request should be a JSON object of the shape{ 'input': '<my-sentence>'}
, where<my-sentence>
should be replaced with a Dutch sentence. -
If the parse fails, a response with status code 500 is returned. If the parser returns a so-called proof, it is included in the response.
-
Upon successful parsing, the server will return a JSON object containing the following properties.
tex
: the full analysis of the sentence in.tex
format;proof
: the proof of the analysis (in JSON format);lexical_phrases
: analyses of the individual phrases (in JSON format).
Spindle Server is shared under a BSD 3-Clause licence. See LICENSE for more information.
If you wish to cite this repository, please use the metadata provided in our CITATION.cff file.
For questions, small feature suggestions, and bug reports, feel free to create an issue. If you do not have a Github account, you can also contact the Centre for Digital Humanities.