Skip to main content

No project description provided

Project description

Bangla Preprocessor (BnPreprocessing)

This page gives a basic introduction to the package.

Installation:

pip install BnPreprocessing

In Python a Bangla Linga is typically written as:

Usage:

import BnPreprocessing as pp
s =  "আমরা কাজ করবো কিভাবে!!😦😦 । Document তৈরী করতে আমাদের সবাইকে কি করতে হবে? ৫-৬ জন আমরা, কঠিন হবে :("
s = pp.remove_punc(s)
print(s)
s = pp.remove_digits(s)
print(s)
s = pp.remove_nonBangla(s)
print(s)
s = pp.remove_emoticons(s)
print(s)
s = pp.remove_sw(s)
print(s)

Output:

আমরা কাজ করবো কিভাবে  😦😦   Document তৈরী করতে আমাদের সবাইকে কি করতে হবে  ৫ ৬ জন আমরা  কঠিন হবে   
আমরা কাজ করবো কিভাবে  😦😦   Document তৈরী করতে আমাদের সবাইকে কি করতে হবে    জন আমরা  কঠিন হবে   
আমরা কাজ করবো কিভাবে  😦😦    তৈরী করতে আমাদের সবাইকে কি করতে হবে    জন আমরা  কঠিন হবে   
আমরা কাজ করবো কিভাবে      তৈরী করতে আমাদের সবাইকে কি করতে হবে    জন আমরা  কঠিন হবে   
করবো কিভাবে তৈরী সবাইকে কঠিন

If you want to do all the preprocessings in one step:

Altogether 😃

import BnPreprocessing as pp
s =  "আমরা কাজ করবো কিভাবে!!😦😦 । Document তৈরী করতে আমাদের সবাইকে কি করতে হবে? ৫-৬ জন আমরা, কঠিন হবে :("
s = pp.remove_noise(s)
print(s)

Output:

করবো কিভাবে তৈরী সবাইকে কঠিন

How to apply to Dataframe!!! 🤔

import BnPreprocessing as pp
#import your dataframe
df['Text'] = df['Text'].apply(pp.remove_noise) #use any of the functions above
#or
df['TEXT'].apply(lambda x: pp.remove_noise(str(x)))

👉 Bonus Features 👈

English to Bangla Digit Conversion

import BnPreprocessing as pp
s = "2018 এর পরিসংখ্যান অনুযায়ী বাংলাদেশের জনসংখ্যা প্রায় 161.4 মিলিয়ন"
s = pp.numBTE(s)
print(s)    

Output:

২০১৮ এর পরিসংখ্যান অনুযায়ী বাংলাদেশের জনসংখ্যা প্রায় ১৬১.৪ মিলিয়ন

Bangla to English Digit Conversion

import BnPreprocessing as pp
s = "২০১৮ এর পরিসংখ্যান অনুযায়ী বাংলাদেশের জনসংখ্যা প্রায় ১৬১.৪ মিলিয়ন"
s = pp.numBTE(s)
print(s)    

Output:

2018 এর পরিসংখ্যান অনুযায়ী বাংলাদেশের জনসংখ্যা প্রায় 161.4 মিলিয়ন

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

BnPreprocessing-2.6-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file BnPreprocessing-2.6-py3-none-any.whl.

File metadata

  • Download URL: BnPreprocessing-2.6-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.21.0 setuptools/42.0.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.5

File hashes

Hashes for BnPreprocessing-2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 43afb3145a88bf42273c7d9ed52a05dbd16d746d79f67390fdfea2f5e9271b32
MD5 bf2fc57a2c4643770d165088c4ce1e35
BLAKE2b-256 0aa7c9711d9c95e04ad6f773bdd6e951916ccdb0c1ca676d983bc1bfbe6a7aa0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page