Skip to content

Latest commit

 

History

History
42 lines (31 loc) · 1.12 KB

README.md

File metadata and controls

42 lines (31 loc) · 1.12 KB

Wordcount API

API to count unique words in german and english texts. See the frontend code here.

Installation

Requirements:

  • Python
  • Virtualenv (optional, but recommended)
  • Virtualenvwrapper (optional, but recommended)

Run:

mkvirtualenv nlpy # optional
pip install -r requirements.txt

Copy the JSON and XML files into data/. There you will place the pickle files for the NLTK german classifier and the TIGER corpus.

You have to convert the extracted TIGER corpus in a pickle file as following:

python lib/GermaLemma.py data/tigercorpus-2.2.conll09

API Server

Start the HTTP API server running:

./server.py

Then you can query the API sending a POST request containing a text body parameter:

curl -X POST -d '{"text": "Testen"}' localhost:5000/api/count/de/ -H 'Content-type: application/json'

or

curl -X POST -d '{"text": "Test it"}' localhost:5000/api/count/en/ -H 'Content-type: application/json'