Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sileod authored Jun 30, 2023
1 parent 79afb6a commit 859260b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
The task templates follow the same interface. They implement `preprocess_function`, a data collator and `compute_metrics`.
Look at [tasks.py](https://github.com/sileod/tasknet/blob/main/src/tasknet/tasks.py) and use existing templates as a starting point to implement a custom task template.

## Task instances and example
## Installation and example

`pip install tasknet`

Each task template has fields that should be matched with specific dataset columns. Classification has two text fields `s1`,`s2`, and a label `y`. Pass a dataset to a template, and fill in the mapping between the template fields and the dataset columns to instantiate a task.
```py
Expand All @@ -36,9 +38,6 @@ p([{'text':x.premise,'text_pair': x.hypothesis}]) # HuggingFace pipeline for inf
```
Tasknet is multitask by design. `model.task_models_list` contains one model per task, with a shared encoder.

## Installation
`pip install tasknet`

## Balancing dataset sizes
```py
tn.Classification(dataset, nrows=5000, nrows_eval=500, oversampling=2)
Expand Down

0 comments on commit 859260b

Please sign in to comment.