Quick Start

Installation

Installation:
pip install bnltk 

Version 0.7.8 (Latest)

Tokenizer

Tokenizer example:
from bnltk.tokenize import Tokenizers  
t = Tokenizers()
print(t.bn_word_tokenizer('আজ আবহাওয়া খুব ভালো।'))
# ["আজ", "আবহাওয়া", "খুব", "ভালো", "।"]

Stemmer

Stemmer example:
from bnltk.stemmer import BanglaStemmer  
bn_stemmer = BanglaStemmer()
print(bn_stemmer.stem('হেসেছিলেন'))
# হাসা

Parts of Speech Tagger

For using the Parts of Tagger you need to download some data files as follows:

Datafiles download example:
from bnltk.bnltk_downloads import DataFiles  
DataFiles.download()

After successfully downloading the files, then you can use this module.

POS tagger example:
from bnltk.pos_tagger import PosTagger  
p_tagger = PosTagger()
print(p_tagger.tagger('দুশ্চিন্তার কোন কারণই নাই'))
# [('দুশ্চিন্তার', 'NC'), ('কোন', 'JQ'), ('কারণই', 'NC'), ('নাই', 'VM')]

Version 0.7.6 (Jun 29, 2019)

Tokenizer

Tokenizer example:
from bnltk.tokenize import Tokenizers  
t = Tokenizers()
print(t.bn_word_tokenizer('আজ আবহাওয়া খুব ভালো।'))
# ["আজ", "আবহাওয়া", "খুব", "ভালো"]

Stemmer

Stemmer example:
from bnltk.stemmer import BanglaStemmer  
bn_stemmer = BanglaStemmer()
print(bn_stemmer.stem('হেসেছিলেন'))
# হাসা

Parts of Speech Tagger

For using the Parts of Tagger you need to download some data files as follows:

Datafiles download example:
from bnltk.bnltk_downloads import DataFiles  
DataFiles().download()

After successfully downloading the files, then you can use this module.

POS tagger example:
from bnltk.pos_tagger import PosTagger  
p_tagger = PosTagger()
p_tagger.loader()
print(p_tagger.tagger('দুশ্চিন্তার কোন কারণই নাই'))
# [('দুশ্চিন্তার', 'NC'), ('কোন', 'JQ'), ('কারণই', 'NC'), ('নাই', 'VM')]