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 Nephasedclf = 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nephased-0.0.34.tar.gz.
File metadata
- Download URL: nephased-0.0.34.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5217923cd53b36ff399ad3794df8fec29f8c5c62855c1127cac6da785953e613
|
|
| MD5 |
169e6c15eb501f70922f6bc1043c0ae2
|
|
| BLAKE2b-256 |
c8c534ecf17e17359c5655d920c39d73014347c39fd110e9fb85d8be0c78fd5b
|
File details
Details for the file nephased-0.0.34-py3-none-any.whl.
File metadata
- Download URL: nephased-0.0.34-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c6e8250d383337f6f8263ffa4bb27fac84a63ae8cee50ad23fdca77ff5a061b
|
|
| MD5 |
10fc4a74555a3102fd61ca8c3f4cbedd
|
|
| BLAKE2b-256 |
5e8504da0836d99dbda665555d6447ecb6a6c3044366f950548a1bcd3b9ddb3b
|