Skip to main content

Low Resource NLTK

Project description

LowResNLTK

A low-resource Natural Language Processing toolkit.

Quick Inference Without Training

Pretrained model acheived an F1 Score of 97% in all classes.

POS Tagging

from lowresnltk import POSTagger

# Simple usage
tags = POSTagger.tag('আমি ভালো আছি')

Sentence Classification

from lowresnltk import SentenceClassifier

# Simple usage
label = SentenceClassifier.classify('আমি ভালো আছি')

Training Custom Models

Data Format Requirements

Column Description Example
Sentence Full Bengali sentence সন্ধ্যায় পাখিরা বাসায় ফেরে
Labels Sentence type Simple
POS List of POS tags ['ক্রিয়া', 'বিশেষ্য', 'বিশেষ্য', 'অব্যয়']
Words List of words ['সন্ধ্যায়', 'পাখিরা', 'বাসায়', 'ফেরে']

Example Dataset: https://huggingface.co/datasets/abkafi1234/POS-Sentence-Type

The code is Language Agnostic So Any Language will work. if the proper structure is followed

Train POS Tagger

import pandas as pd
from lowresnltk import POSTagger

# Load your data
data = pd.read_csv('Bangla.csv')

# Initialize and train
pt = POSTagger(data)
pt.train()

# Test prediction
result = pt.predict('আমি ভালো আছি')

Train Sentence Classifier

from lowresnltk import SentenceClassifier

# Load your data
data = pd.read_csv('Bangla.csv')

# Initialize and train
sc = SentenceClassifier(data=data)
sc.train()
result = sc.predict('আমি ভালো আছি')

Model Configuration

Default model paths:

  • POS Tagger: ~/.lowresnltk/POSModel/
  • Classifier: ~/.lowresnltk/ClassifierModel/

Installation

pip install lowresnltk

License

MIT License

Project details


Download files

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

Source Distribution

lowresnltk-1.1.1.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

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

lowresnltk-1.1.1-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file lowresnltk-1.1.1.tar.gz.

File metadata

  • Download URL: lowresnltk-1.1.1.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for lowresnltk-1.1.1.tar.gz
Algorithm Hash digest
SHA256 34b97af90678077bc685fb03bf47f07acb9655954a23e9c6f12321aefa467e9b
MD5 3b32e8d568d2c735ecfa750fe3767ab7
BLAKE2b-256 8b1565b9506924d070658f9a0e0c4111d8322c505ca25f0062327b0b979567cd

See more details on using hashes here.

File details

Details for the file lowresnltk-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: lowresnltk-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for lowresnltk-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 34f52184aa3a3a916f6f4e6433aa870c9439297e81befee6c9cc1dd4724f1d08
MD5 a8cbff4897a190f20f57cd9d8341fa95
BLAKE2b-256 36143882878a0daa4f300ca414dea80c75b5d353b96001bd338d59cc72f76c83

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