Metadata-Version: 2.1
Name: tt4l
Version: 0.0.4
Summary: Training a transformer model for language
Home-page: https://github.com/fjklqq/tt4l
License: Apache-2.0
Author: ZhouHang
Author-email: fjklqq@gmail.com
Requires-Python: >=3.10,<4.0
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: accelerate (>=0.34.0,<=1.0.1)
Requires-Dist: datasets (>=2.17.0,<3.0.0)
Requires-Dist: evaluate (>=0.4.2,<0.5.0)
Requires-Dist: matplotlib (>=3.9.2,<4.0.0)
Requires-Dist: pydantic (>=2.6.0,<3.0.0)
Requires-Dist: scikit-learn (>=1.4.0,<2.0.0)
Requires-Dist: seqeval (>=1.2.2,<2.0.0)
Requires-Dist: torch (>=2.1.0,<3.0.0)
Requires-Dist: transformers (>=4.41.2,<=4.46.1)
Requires-Dist: typer (>=0.12.3,<0.13.0)
Description-Content-Type: text/markdown

# Training a transformer model for language

## Install

```shell
pip install tt4l
```

## Usage

### Tasks

find supported tasks

```shell
tt4l tasks
```

| Args                             | Task Name                        | Short Description                                                                                                                                                                                                                                                                                             |
|----------------------------------|----------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| text_classification              | Text Classification              | Text classification is a common NLP task that assigns a label or class to text.                                                                                                                                                                                                                               |
| token_classification             | Token Classification             | Token classification assigns a label to individual tokens in a sentence. One of the most common task is Named Entity Recognition (NER)。                                                                                                                                                                       |
| universal_information_extraction | Universal Information Extraction | The Unified Information Extraction Framework (UIE) for general information extraction achieves unified modeling of tasks such as entity extraction,   relationship extraction, event extraction, and sentiment analysis, and enables good transferability and generalization ability between different tasks. |

Show task description.  
`tt4l desc [TASK_TYPE]`
Eg:

```shell
tt4l desc text_classification
```

### init task config file

`tt4l init [TASK_TYPE]`

Eg:

```shell
tt4l init text_classification
```

**Modify the corresponding configuration**

### Train

`tt4l train [TASK_TYPE]`

Eg:

```shell
tt4l train text_classification_task.yaml
```

### Predict

`tt4l predict [YAML]`

Eg:

```shell
tt4l predict text_classification_task.yaml
```

### Inference

`tt4l inference [TASK_TYPE] [*args]`

