Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can NLTK/pyNLTK work "per language" (i.e. non-english), and how?

Tags:

python

nlp

nltk

How can I tell NLTK to treat the text in a particular language?

Once in a while I write a specialized NLP routine to do POS tagging, tokenizing and etc. on a non-english (but still hindo-European) text domain.

This question seem to address only different corpora, not the change in code/settings: POS tagging in German

Alternatively,are there any specialized Hebrew/Spanish/Polish NLP modules for python?

like image 925
Berry Tsakala Avatar asked Nov 25 '09 08:11

Berry Tsakala


1 Answers

I'm not sure what you're referring to as the changes in code/settings. NLTK mostly relies on machine learning and the "settings" are usually extracted from the training data.

When it comes to POS tagging the results and tagging will be dependant on the tagger you use/train. Should you train your own you'll of course need some spanish / polish training data. The reason these might be hard to find is the lack of gold standard material publicly available. There are tools out there to do that do this, but this one isn't for python (http://www.ims.uni-stuttgart.de/projekte/corplex/TreeTagger/).

The nltk.tokenize.punkt.PunktSentenceTokenizer tokenizer will tokenize sentences according to multilingual sentence boundaries the details of which can be found in this paper (http://www.mitpressjournals.org/doi/abs/10.1162/coli.2006.32.4.485).

like image 125
Matti Lyra Avatar answered Sep 23 '22 02:09

Matti Lyra