Skip to main content

A BERT-based text sentiment classification pipeline for Nepali Language

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.33.tar.gz (5.2 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.33-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nephased-0.0.33.tar.gz
  • Upload date:
  • Size: 5.2 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.33.tar.gz
Algorithm Hash digest
SHA256 da2469269749a60f69329d4e15246cc4e31e6b3762ee0494c22a662e7bec1b4a
MD5 8d55d3c39014ba073ae59b93d896f416
BLAKE2b-256 0b7da3285512d06f8d3971184606eea5150b8e942888683a74fd6955ea62a84a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nephased-0.0.33-py3-none-any.whl
  • Upload date:
  • Size: 5.4 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.33-py3-none-any.whl
Algorithm Hash digest
SHA256 435503adab1186e17786d416b8ed5bdd836a5ed6bd39edaef05e28bc64e31d5f
MD5 3dff24c65516e5e94e310a0748240e6f
BLAKE2b-256 ff921e2c5d402dfe9ee2bb3fa3858d95c1e04d481b6f16dca7869c644b9bad7c

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