tfkit


Nametfkit JSON
Version 0.7.21 PyPI version JSON
download
home_pagehttps://github.com/voidful/TFkit
SummaryTransformers kit - Multi-task QA/Tagging/Multi-label Multi-Class Classification/Generation with BERT/ALBERT/T5/BERT
upload_time2021-06-19 18:24:59
maintainer
docs_urlNone
authorVoidful
requires_python>=3.5.0
licenseApache
keywords transformer huggingface nlp multi-task multi-class multi-label classification generation tagging deep learning machine reading
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p  align="center">
    <br>
    <img src="https://raw.githubusercontent.com/voidful/TFkit/master/docs/img/tfkit.png" width="300"/>
    <br>
</p>
<br/>
<p align="center">
    <a href="https://pypi.org/project/tfkit/">
        <img alt="PyPI" src="https://img.shields.io/pypi/v/tfkit">
    </a>
    <a href="https://github.com/voidful/tfkit">
        <img alt="Download" src="https://img.shields.io/pypi/dm/tfkit">
    </a>
    <a href="https://github.com/voidful/tfkit">
        <img alt="Build" src="https://img.shields.io/github/workflow/status/voidful/tfkit/Python package">
    </a>
    <a href="https://github.com/voidful/tfkit">
        <img alt="Last Commit" src="https://img.shields.io/github/last-commit/voidful/tfkit">
    </a>
    <a href="https://www.codefactor.io/repository/github/voidful/tfkit/overview/master">
        <img src="https://www.codefactor.io/repository/github/voidful/tfkit/badge/master" alt="CodeFactor" />
    </a>
    <a href="https://github.com/voidful/tfkit">
        <img src="https://visitor-badge.glitch.me/badge?page_id=voidful.tfkit" alt="Visitor" />
    </a>
    <a href="https://codecov.io/gh/voidful/TFkit">
      <img src="https://codecov.io/gh/voidful/TFkit/branch/master/graph/badge.svg" />
    </a>
</p>

## What is it

TFKit is a deep natural language process framework for classification/tagging/question answering/embedding study and language generation.  
It leverages the use of transformers on many tasks with different models in this all-in-one framework.   
All you need is a little change of config.  

## Task Supported
With transformer models - BERT/ALBERT/T5/BART......
|  |  |
|-|-|
| Classification  | :label: multi-class and multi-label classification |
| Question Answering  | :page_with_curl: extractive qa |
| Question Answering  | :radio_button: multiple-choice qa |
| Tagging  | :eye_speech_bubble: sequence level tagging / sequence level with crf  |
| Text Generation | :memo: seq2seq language model |
| Text Generation | :pen: causal language model |
| Text Generation | :printer: once generation model / once generation model with ctc loss |
| Text Generation | :pencil: onebyone generation model |
| Self-supervise Learning | :diving_mask: mask language model |

# Getting Started
Learn more from the [document](https://voidful.github.io/TFkit/).  

## How To Use

### Step 0: Install
Simple installation from PyPI
```bash
pip install tfkit
```

### Step 1: Prepare dataset in csv format
[Task format](https://voidful.tech/TFkit/tasks/)
``` 
input, target
```

### Step 2: Train model
```bash
tfkit-train \
--model clas \
--config xlm-roberta-base \
--train training_data.csv \
--test testing_data.csv \
--lr 4e-5 \
--maxlen 384 \
--epoch 10 \
--savedir roberta_sentiment_classificer
```

### Step 3: Evaluate
```bash
tfkit-eval \
--model roberta_sentiment_classificer/1.pt \
--metric clas \
--valid testing_data.csv
```

## Advanced features
<details>
  <summary>Multi-task training </summary>

  ```bash
  tfkit-train \
    --model clas clas \
    --config xlm-roberta-base \
    --train training_data_taskA.csv training_data_taskB.csv \
    --test testing_data_taskA.csv testing_data_taskB.csv \
    --lr 4e-5 \
    --maxlen 384 \
    --epoch 10 \
    --savedir roberta_sentiment_classificer_multi_task
  ```
</details>


## Supplement
- [transformers models list](https://huggingface.co/models): you can find any pretrained models here   
- [nlprep](https://github.com/voidful/NLPrep): download and preprocessing data in one line     
- [nlp2go](https://github.com/voidful/nlp2go): create demo api as quickly as possible.


## Contributing
Thanks for your interest.There are many ways to contribute to this project. Get started [here](https://github.com/voidful/tfkit/blob/master/CONTRIBUTING.md).

## License ![PyPI - License](https://img.shields.io/github/license/voidful/tfkit)

* [License](https://github.com/voidful/tfkit/blob/master/LICENSE)

## Icons reference
Icons modify from <a href="http://www.freepik.com/" title="Freepik">Freepik</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a>      
Icons modify from <a href="https://www.flaticon.com/authors/nikita-golubev" title="Nikita Golubev">Nikita Golubev</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a>      



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/voidful/TFkit",
    "name": "tfkit",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.5.0",
    "maintainer_email": "",
    "keywords": "transformer huggingface nlp multi-task multi-class multi-label classification generation tagging deep learning machine reading",
    "author": "Voidful",
    "author_email": "voidful.stack@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/49/f0/a4803953821b274b3c5f5f063eb2448143eb55302445948274ca2915975f/tfkit-0.7.21.tar.gz",
    "platform": "",
    "description": "<p  align=\"center\">\n    <br>\n    <img src=\"https://raw.githubusercontent.com/voidful/TFkit/master/docs/img/tfkit.png\" width=\"300\"/>\n    <br>\n</p>\n<br/>\n<p align=\"center\">\n    <a href=\"https://pypi.org/project/tfkit/\">\n        <img alt=\"PyPI\" src=\"https://img.shields.io/pypi/v/tfkit\">\n    </a>\n    <a href=\"https://github.com/voidful/tfkit\">\n        <img alt=\"Download\" src=\"https://img.shields.io/pypi/dm/tfkit\">\n    </a>\n    <a href=\"https://github.com/voidful/tfkit\">\n        <img alt=\"Build\" src=\"https://img.shields.io/github/workflow/status/voidful/tfkit/Python package\">\n    </a>\n    <a href=\"https://github.com/voidful/tfkit\">\n        <img alt=\"Last Commit\" src=\"https://img.shields.io/github/last-commit/voidful/tfkit\">\n    </a>\n    <a href=\"https://www.codefactor.io/repository/github/voidful/tfkit/overview/master\">\n        <img src=\"https://www.codefactor.io/repository/github/voidful/tfkit/badge/master\" alt=\"CodeFactor\" />\n    </a>\n    <a href=\"https://github.com/voidful/tfkit\">\n        <img src=\"https://visitor-badge.glitch.me/badge?page_id=voidful.tfkit\" alt=\"Visitor\" />\n    </a>\n    <a href=\"https://codecov.io/gh/voidful/TFkit\">\n      <img src=\"https://codecov.io/gh/voidful/TFkit/branch/master/graph/badge.svg\" />\n    </a>\n</p>\n\n## What is it\n\nTFKit is a deep natural language process framework for classification/tagging/question answering/embedding study and language generation.  \nIt leverages the use of transformers on many tasks with different models in this all-in-one framework.   \nAll you need is a little change of config.  \n\n## Task Supported\nWith transformer models - BERT/ALBERT/T5/BART......\n|  |  |\n|-|-|\n| Classification  | :label: multi-class and multi-label classification |\n| Question Answering  | :page_with_curl: extractive qa |\n| Question Answering  | :radio_button: multiple-choice qa |\n| Tagging  | :eye_speech_bubble: sequence level tagging / sequence level with crf  |\n| Text Generation | :memo: seq2seq language model |\n| Text Generation | :pen: causal language model |\n| Text Generation | :printer: once generation model / once generation model with ctc loss |\n| Text Generation | :pencil: onebyone generation model |\n| Self-supervise Learning | :diving_mask: mask language model |\n\n# Getting Started\nLearn more from the [document](https://voidful.github.io/TFkit/).  \n\n## How To Use\n\n### Step 0: Install\nSimple installation from PyPI\n```bash\npip install tfkit\n```\n\n### Step 1: Prepare dataset in csv format\n[Task format](https://voidful.tech/TFkit/tasks/)\n``` \ninput, target\n```\n\n### Step 2: Train model\n```bash\ntfkit-train \\\n--model clas \\\n--config xlm-roberta-base \\\n--train training_data.csv \\\n--test testing_data.csv \\\n--lr 4e-5 \\\n--maxlen 384 \\\n--epoch 10 \\\n--savedir roberta_sentiment_classificer\n```\n\n### Step 3: Evaluate\n```bash\ntfkit-eval \\\n--model roberta_sentiment_classificer/1.pt \\\n--metric clas \\\n--valid testing_data.csv\n```\n\n## Advanced features\n<details>\n  <summary>Multi-task training </summary>\n\n  ```bash\n  tfkit-train \\\n    --model clas clas \\\n    --config xlm-roberta-base \\\n    --train training_data_taskA.csv training_data_taskB.csv \\\n    --test testing_data_taskA.csv testing_data_taskB.csv \\\n    --lr 4e-5 \\\n    --maxlen 384 \\\n    --epoch 10 \\\n    --savedir roberta_sentiment_classificer_multi_task\n  ```\n</details>\n\n\n## Supplement\n- [transformers models list](https://huggingface.co/models): you can find any pretrained models here   \n- [nlprep](https://github.com/voidful/NLPrep): download and preprocessing data in one line     \n- [nlp2go](https://github.com/voidful/nlp2go): create demo api as quickly as possible.\n\n\n## Contributing\nThanks for your interest.There are many ways to contribute to this project. Get started [here](https://github.com/voidful/tfkit/blob/master/CONTRIBUTING.md).\n\n## License ![PyPI - License](https://img.shields.io/github/license/voidful/tfkit)\n\n* [License](https://github.com/voidful/tfkit/blob/master/LICENSE)\n\n## Icons reference\nIcons modify from <a href=\"http://www.freepik.com/\" title=\"Freepik\">Freepik</a> from <a href=\"https://www.flaticon.com/\" title=\"Flaticon\">www.flaticon.com</a>      \nIcons modify from <a href=\"https://www.flaticon.com/authors/nikita-golubev\" title=\"Nikita Golubev\">Nikita Golubev</a> from <a href=\"https://www.flaticon.com/\" title=\"Flaticon\">www.flaticon.com</a>      \n\n\n",
    "bugtrack_url": null,
    "license": "Apache",
    "summary": "Transformers kit - Multi-task QA/Tagging/Multi-label Multi-Class Classification/Generation with BERT/ALBERT/T5/BERT",
    "version": "0.7.21",
    "split_keywords": [
        "transformer",
        "huggingface",
        "nlp",
        "multi-task",
        "multi-class",
        "multi-label",
        "classification",
        "generation",
        "tagging",
        "deep",
        "learning",
        "machine",
        "reading"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "d2a081e0873f2488f5908390199d1963",
                "sha256": "a8a4ed50b2d726554a57796fa02df5c7ca6c897a39efe9b20867c5f40b140b08"
            },
            "downloads": -1,
            "filename": "tfkit-0.7.21-py3.7.egg",
            "has_sig": false,
            "md5_digest": "d2a081e0873f2488f5908390199d1963",
            "packagetype": "bdist_egg",
            "python_version": "3.7",
            "requires_python": ">=3.5.0",
            "size": 176398,
            "upload_time": "2021-06-19T18:24:58",
            "upload_time_iso_8601": "2021-06-19T18:24:58.029708Z",
            "url": "https://files.pythonhosted.org/packages/3f/9a/f1c13b753ed5ce0ba87d42113d83fa3e5b17253ff2eedd4cd6cd594c910c/tfkit-0.7.21-py3.7.egg",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "5c3dba05db6ffe8deb2c1c20dfa4c015",
                "sha256": "daaaa4af0b9178271b1be56192fbc79f2e9320f3d6a5f77ae929738b080a392e"
            },
            "downloads": -1,
            "filename": "tfkit-0.7.21-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5c3dba05db6ffe8deb2c1c20dfa4c015",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.5.0",
            "size": 78763,
            "upload_time": "2021-06-19T18:24:55",
            "upload_time_iso_8601": "2021-06-19T18:24:55.983283Z",
            "url": "https://files.pythonhosted.org/packages/45/26/2cd26bc12a30dbdf21f50de459120302d63e2ada2c2c9e0624ac58bb0b0a/tfkit-0.7.21-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "cb15416efe82839c8b8d643812a1edd1",
                "sha256": "fc8236e91dd079a96cb27b1261cbc3f73589e2f04f52525009923a99ceda897d"
            },
            "downloads": -1,
            "filename": "tfkit-0.7.21.tar.gz",
            "has_sig": false,
            "md5_digest": "cb15416efe82839c8b8d643812a1edd1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.5.0",
            "size": 215705,
            "upload_time": "2021-06-19T18:24:59",
            "upload_time_iso_8601": "2021-06-19T18:24:59.704505Z",
            "url": "https://files.pythonhosted.org/packages/49/f0/a4803953821b274b3c5f5f063eb2448143eb55302445948274ca2915975f/tfkit-0.7.21.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2021-06-19 18:24:59",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "voidful",
    "github_project": "TFkit",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "tfkit"
}
        
Elapsed time: 0.30604s