Skip to content
API to count unique words in german and english texts
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
src
.gitignore
README.md
__init__.py
requirements.txt
server.py

README.md

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'
You can’t perform that action at this time.