TextClassification


NameTextClassification JSON
Version 0.2.4 PyPI version JSON
download
home_pagehttps://github.com/falahgs/
SummaryCreate Text Classification Fine-Tunning Model
upload_time2023-07-18 09:48:30
maintainer
docs_urlNone
authorFalahgs.G.Saleih
requires_python>=3.6
licenseMIT
keywords transformers datasets
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Text Classification with NLP Models and Transformers

## Introduction
This Python package provides a simple and efficient solution for text classification tasks using Natural Language Processing (NLP) models and Transformer-based encoder-decoder models. It supports both binary classification and multiple classification scenarios, allowing you to train, evaluate, and deploy state-of-the-art models for classifying text data.

## Features
- Binary classification: Classify text data into two classes.
- Multiple classification: Classify text data into multiple classes.
- NLP models: Utilize powerful NLP models for accurate classification, such as BERT, GPT, RoBERTa, and more.
- Transformer-based encoder-decoder models: Benefit from the encoder-decoder architecture for advanced classification tasks.
- Easy deployment: Deploy your trained models effortlessly using the PyPI package.
- Markdown format README file: Comprehensive documentation and usage instructions in Markdown format for seamless integration into your project.

## Installation
You can install the package from PyPI using the following command:

```bash
pip install text-classification-nlp
```

## Usage
To use the text classification package, follow these steps:

1. Import the necessary modules and dependencies.
```python
from text_classification_nlp import TextClassifier, TransformerEncoderDecoderModel
```

2. Load your dataset and preprocess the text data as required.
```python
# Example dataset loading and preprocessing
data = load_dataset('your_dataset')
preprocessed_data = preprocess_data(data)
```

3. Create an instance of the TextClassifier class.
```python
# Binary classification example
binary_classifier = TextClassifier(model='bert', num_classes=2)

# Multiple classification example
multi_classifier = TextClassifier(model='roberta', num_classes=5)
```

4. Train your classifier using the prepared dataset.
```python
binary_classifier.train(preprocessed_data)

multi_classifier.train(preprocessed_data)
```

5. Evaluate the performance of your trained classifier.
```python
binary_classifier.evaluate(test_data)

multi_classifier.evaluate(test_data)
```

6. Deploy your trained model for predictions.
```python
binary_classifier.predict(text)

multi_classifier.predict(text)
```

For detailed examples and advanced usage, refer to the provided documentation.

## Citation
If you use this package in your research or project, please cite it as follows:

```
Author. (Year). Text Classification with NLP Models and Transformers [Software]. Available from https://github.com/your_repository
```

## Dataset Example
Here's an example of how your dataset should be structured:

```json
{
  "data": [
    {
      "text": "This is an example text for classification.",
      "label": 1
    },
    {
      "text": "Another text for classification.",
      "label": 0
    },
    ...
  ]
}
```

Ensure that your dataset is properly formatted with the "text" field containing the input text and the "label" field containing the corresponding class label.

## Conclusion
This text classification package provides a convenient and powerful solution for binary and multiple classification tasks using NLP models and Transformer-based encoder-decoder models. By leveraging the capabilities of these models, you can achieve accurate and efficient text classification results. Install the package today and start classifying your text data with ease!

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/falahgs/",
    "name": "TextClassification",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "transformers,datasets",
    "author": "Falahgs.G.Saleih",
    "author_email": "falahgs07@gmail.com",
    "download_url": "",
    "platform": null,
    "description": "# Text Classification with NLP Models and Transformers\r\n\r\n## Introduction\r\nThis Python package provides a simple and efficient solution for text classification tasks using Natural Language Processing (NLP) models and Transformer-based encoder-decoder models. It supports both binary classification and multiple classification scenarios, allowing you to train, evaluate, and deploy state-of-the-art models for classifying text data.\r\n\r\n## Features\r\n- Binary classification: Classify text data into two classes.\r\n- Multiple classification: Classify text data into multiple classes.\r\n- NLP models: Utilize powerful NLP models for accurate classification, such as BERT, GPT, RoBERTa, and more.\r\n- Transformer-based encoder-decoder models: Benefit from the encoder-decoder architecture for advanced classification tasks.\r\n- Easy deployment: Deploy your trained models effortlessly using the PyPI package.\r\n- Markdown format README file: Comprehensive documentation and usage instructions in Markdown format for seamless integration into your project.\r\n\r\n## Installation\r\nYou can install the package from PyPI using the following command:\r\n\r\n```bash\r\npip install text-classification-nlp\r\n```\r\n\r\n## Usage\r\nTo use the text classification package, follow these steps:\r\n\r\n1. Import the necessary modules and dependencies.\r\n```python\r\nfrom text_classification_nlp import TextClassifier, TransformerEncoderDecoderModel\r\n```\r\n\r\n2. Load your dataset and preprocess the text data as required.\r\n```python\r\n# Example dataset loading and preprocessing\r\ndata = load_dataset('your_dataset')\r\npreprocessed_data = preprocess_data(data)\r\n```\r\n\r\n3. Create an instance of the TextClassifier class.\r\n```python\r\n# Binary classification example\r\nbinary_classifier = TextClassifier(model='bert', num_classes=2)\r\n\r\n# Multiple classification example\r\nmulti_classifier = TextClassifier(model='roberta', num_classes=5)\r\n```\r\n\r\n4. Train your classifier using the prepared dataset.\r\n```python\r\nbinary_classifier.train(preprocessed_data)\r\n\r\nmulti_classifier.train(preprocessed_data)\r\n```\r\n\r\n5. Evaluate the performance of your trained classifier.\r\n```python\r\nbinary_classifier.evaluate(test_data)\r\n\r\nmulti_classifier.evaluate(test_data)\r\n```\r\n\r\n6. Deploy your trained model for predictions.\r\n```python\r\nbinary_classifier.predict(text)\r\n\r\nmulti_classifier.predict(text)\r\n```\r\n\r\nFor detailed examples and advanced usage, refer to the provided documentation.\r\n\r\n## Citation\r\nIf you use this package in your research or project, please cite it as follows:\r\n\r\n```\r\nAuthor. (Year). Text Classification with NLP Models and Transformers [Software]. Available from https://github.com/your_repository\r\n```\r\n\r\n## Dataset Example\r\nHere's an example of how your dataset should be structured:\r\n\r\n```json\r\n{\r\n  \"data\": [\r\n    {\r\n      \"text\": \"This is an example text for classification.\",\r\n      \"label\": 1\r\n    },\r\n    {\r\n      \"text\": \"Another text for classification.\",\r\n      \"label\": 0\r\n    },\r\n    ...\r\n  ]\r\n}\r\n```\r\n\r\nEnsure that your dataset is properly formatted with the \"text\" field containing the input text and the \"label\" field containing the corresponding class label.\r\n\r\n## Conclusion\r\nThis text classification package provides a convenient and powerful solution for binary and multiple classification tasks using NLP models and Transformer-based encoder-decoder models. By leveraging the capabilities of these models, you can achieve accurate and efficient text classification results. Install the package today and start classifying your text data with ease!\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Create Text Classification Fine-Tunning Model",
    "version": "0.2.4",
    "project_urls": {
        "Homepage": "https://github.com/falahgs/"
    },
    "split_keywords": [
        "transformers",
        "datasets"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "eea4f85d340e2f5d3cdcbd3c7eb4297c918df9cfaa0b4d3de3bf92bae48a2bd3",
                "md5": "625066e3b6e498c8a2d5315d1bbefa16",
                "sha256": "7974791ee33d68081c572581de5e3c0bfee9eca510a3a97dde586a851e91051c"
            },
            "downloads": -1,
            "filename": "TextClassification-0.2.4-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "625066e3b6e498c8a2d5315d1bbefa16",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.6",
            "size": 8379,
            "upload_time": "2023-07-18T09:48:30",
            "upload_time_iso_8601": "2023-07-18T09:48:30.880548Z",
            "url": "https://files.pythonhosted.org/packages/ee/a4/f85d340e2f5d3cdcbd3c7eb4297c918df9cfaa0b4d3de3bf92bae48a2bd3/TextClassification-0.2.4-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-18 09:48:30",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "textclassification"
}
        
Elapsed time: 0.11427s