Skip to main content

A BERT-based text sentiment classification pipeline for Nepali

Project description

nephased

[!Warning] This section contains vulgar words

Nephased provides a BERT-based classification pipeline for detecting Nepali text sentiment

Installation

From TestPyPI:

pip install nephased

Or you can use the Nephased(finetune of distilbert-base-nepali) from huggingface

Usage

Import Nephased module using the following command.

from nephased import Nephased

Initialize Nephased

clf = Nephased()
  • You can pass a single string:
>>> clf.predict("थुक्क पैसा मा बिकने हीजडा")
'PROFANITY_0'
  • or, a list of string:
>>> clf.predict(["राडिको छोरोको शासन धेर दिन टिक्दैन |", "सुरु मा चाहिँ तैले यो देश छोडनु पर्यो |", "एसको घरमा आगो लाहिदे ।"])
['PROFANITY_1', 'GENERAL', 'VIOLENCE']

About Output

Nephased can distinguish between 4 categories:

  • GENERAL : Instance without any profanity or violence.
  • PROFANITY_0 : Instance including rude, bad or slander which are not very harsh but offensive words used on day-to-day lives in Nepal.
  • PROFANITY_1 : Instance including swear or curse words which are very harsh
  • VIOLENCE : Instance including physical assualt or rape and pyromaniac act.

The guidelines for segragating such sentiments are on NepsaGuidelines

[!NOTE] Nephased is trained on NepSa dataset
By default Nephased preprocesses the input:

  • stemming using nepali-stemmer
  • lowering case, punctuation and stopwords removal
    you can choose to not preprocess text when initializing Nephased
clf = nephased(preprocess_text = False)

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

nephased-0.0.3.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

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

nephased-0.0.3-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file nephased-0.0.3.tar.gz.

File metadata

  • Download URL: nephased-0.0.3.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.4

File hashes

Hashes for nephased-0.0.3.tar.gz
Algorithm Hash digest
SHA256 b0b42ac549c9f501035212dc19c1db6a37ea7f68a354c10b51dfbae1ffe7c19e
MD5 44bba26b9d8505701420dcbfa403b1ac
BLAKE2b-256 8516f0e6c460d6972327e63ba874212544bf6edc9f9d6a1a051b2c9ce5ae1f46

See more details on using hashes here.

File details

Details for the file nephased-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: nephased-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.4

File hashes

Hashes for nephased-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9969a9f5bd5adb8ac2ff043930fde75b8c62c38c473d9f7774016ec2953ece29
MD5 3a521ccf0d6806bbb4403c65ac6fecd2
BLAKE2b-256 195a29623b937a029af3d0424196ed32d61e193d49480c7c3b6005b9261cbc80

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