nephased


Namenephased JSON
Version 0.0.31 PyPI version JSON
download
home_pageNone
SummaryA BERT-based text sentiment classification pipeline for Nepali
upload_time2025-02-09 16:56:41
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseMIT
keywords nlp transformers bert nepali
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # nephased

> [!Warning]
> This section contains vulgar words

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

## Installation

From TestPyPI:

```bash
pip install nephased
```

Or you can use the Nephased(finetune of distilbert-base-nepali) from [huggingface](https://huggingface.co/Vyke2000/Nephased)

## Usage

Import `Nephased` module using the following command.

```python
from nephased import Nephased
```

Initialize Nephased

```python
clf = Nephased()
```

- You can pass a single string:

```python
>>> clf.predict("थुक्क पैसा मा बिकने हीजडा")
'PROFANITY_0'
```

- or, a list of string:

```python
>>> 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](https://github.com/oya163/nepali-sentiment-analysis/blob/master/guidelines/NepsaGuidelines_2020.pdf)

> [!NOTE]
> Nephased is trained on [NepSa](https://github.com/oya163/nepali-sentiment-analysis/blob/master/data/nepcls/csv/ss_ac_at_txt_unbal.csv) dataset \
> By default Nephased preprocesses the input:
>
> - stemming using [nepali-stemmer](https://github.com/oya163/nepali-stemmer)
> - lowering case, punctuation and stopwords removal \
>   you can choose to not preprocess text when initializing Nephased
>
> ```python
> clf = nephased(preprocess_text = False)
> ```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "nephased",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "nlp, transformers, bert, nepali",
    "author": null,
    "author_email": "Angel Tamang <tamangangel2057@gmail.com>, Aadarsha Regmi <aadarsha.regmi11@gmail.com>, Gaurav Maharjan <gauravmaharjan1@gmail.com>, Anil Bhatta <bhattaanil1234@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/47/87/e3f9044b115db23c64c90deacd3a97a356d4288d6f7f44d5d185a14a3157/nephased-0.0.31.tar.gz",
    "platform": null,
    "description": "# nephased\n\n> [!Warning]\n> This section contains vulgar words\n\n`Nephased` provides a BERT-based classification pipeline\nfor detecting Nepali text sentiment\n\n## Installation\n\nFrom TestPyPI:\n\n```bash\npip install nephased\n```\n\nOr you can use the Nephased(finetune of distilbert-base-nepali) from [huggingface](https://huggingface.co/Vyke2000/Nephased)\n\n## Usage\n\nImport `Nephased` module using the following command.\n\n```python\nfrom nephased import Nephased\n```\n\nInitialize Nephased\n\n```python\nclf = Nephased()\n```\n\n- You can pass a single string:\n\n```python\n>>> clf.predict(\"\u0925\u0941\u0915\u094d\u0915 \u092a\u0948\u0938\u093e \u092e\u093e \u092c\u093f\u0915\u0928\u0947 \u0939\u0940\u091c\u0921\u093e\")\n'PROFANITY_0'\n```\n\n- or, a list of string:\n\n```python\n>>> clf.predict([\"\u0930\u093e\u0921\u093f\u0915\u094b \u091b\u094b\u0930\u094b\u0915\u094b \u0936\u093e\u0938\u0928 \u0927\u0947\u0930 \u0926\u093f\u0928 \u091f\u093f\u0915\u094d\u0926\u0948\u0928 |\", \"\u0938\u0941\u0930\u0941 \u092e\u093e \u091a\u093e\u0939\u093f\u0901 \u0924\u0948\u0932\u0947 \u092f\u094b \u0926\u0947\u0936 \u091b\u094b\u0921\u0928\u0941 \u092a\u0930\u094d\u092f\u094b |\", \"\u090f\u0938\u0915\u094b \u0918\u0930\u092e\u093e \u0906\u0917\u094b \u0932\u093e\u0939\u093f\u0926\u0947 \u0964\"])\n['PROFANITY_1', 'GENERAL', 'VIOLENCE']\n```\n\n## About Output\n\nNephased can distinguish between 4 categories:\n\n- GENERAL : Instance without any profanity or violence.\n- PROFANITY_0 : Instance including rude, bad or slander which are not very harsh but offensive words used on day-to-day lives in Nepal.\n- PROFANITY_1 : Instance including swear or curse words which are very harsh\n- VIOLENCE : Instance including physical assualt or rape and pyromaniac act.\n\nThe guidelines for segragating such sentiments are on [NepsaGuidelines](https://github.com/oya163/nepali-sentiment-analysis/blob/master/guidelines/NepsaGuidelines_2020.pdf)\n\n> [!NOTE]\n> Nephased is trained on [NepSa](https://github.com/oya163/nepali-sentiment-analysis/blob/master/data/nepcls/csv/ss_ac_at_txt_unbal.csv) dataset \\\n> By default Nephased preprocesses the input:\n>\n> - stemming using [nepali-stemmer](https://github.com/oya163/nepali-stemmer)\n> - lowering case, punctuation and stopwords removal \\\n>   you can choose to not preprocess text when initializing Nephased\n>\n> ```python\n> clf = nephased(preprocess_text = False)\n> ```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A BERT-based text sentiment classification pipeline for Nepali",
    "version": "0.0.31",
    "project_urls": {
        "Homepage": "https://github.com/angeltamang123/nephased",
        "Source": "https://github.com/angeltamang123/nephased"
    },
    "split_keywords": [
        "nlp",
        " transformers",
        " bert",
        " nepali"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "6afa4a82d1df107fbdb157d9fbd104b022d214b81beb7c14e187c756b82f2143",
                "md5": "9ecd6a86478c0e72f11973ba8a8a126a",
                "sha256": "130cee904e472adaa64609265356dda2d7515aae8d31e288c4455f7f6a8a3cac"
            },
            "downloads": -1,
            "filename": "nephased-0.0.31-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9ecd6a86478c0e72f11973ba8a8a126a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 4726,
            "upload_time": "2025-02-09T16:56:40",
            "upload_time_iso_8601": "2025-02-09T16:56:40.501576Z",
            "url": "https://files.pythonhosted.org/packages/6a/fa/4a82d1df107fbdb157d9fbd104b022d214b81beb7c14e187c756b82f2143/nephased-0.0.31-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "4787e3f9044b115db23c64c90deacd3a97a356d4288d6f7f44d5d185a14a3157",
                "md5": "1fa583f9f3d18bddc5dd8d5b05f6f8f4",
                "sha256": "d5b238ee8f55c2efa6adaaae9101c537adc906c0734c491dfb6fbfadb9505109"
            },
            "downloads": -1,
            "filename": "nephased-0.0.31.tar.gz",
            "has_sig": false,
            "md5_digest": "1fa583f9f3d18bddc5dd8d5b05f6f8f4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 4465,
            "upload_time": "2025-02-09T16:56:41",
            "upload_time_iso_8601": "2025-02-09T16:56:41.738095Z",
            "url": "https://files.pythonhosted.org/packages/47/87/e3f9044b115db23c64c90deacd3a97a356d4288d6f7f44d5d185a14a3157/nephased-0.0.31.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-09 16:56:41",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "angeltamang123",
    "github_project": "nephased",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "nephased"
}
        
Elapsed time: 1.68167s