Skip to content

wbkd/wordcount-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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'

About

API to count unique words in german and english texts

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages