(Work in Progress!!)
A PyTorch-based toolkit for natural language processing
- torch>=1.6.0
- transformers>=4.1.1
- torchmetrics>=0.6.0
TorchBlocks requires Python 3.7+. We recommend installing TorchBlocks in a Linux or OSX environment.
Recommended (because of active development):
git clone https://github.com/lonePatient/TorchBlocks.git
cd TorchBlocks
python setup.py install
- Tutorial 1 (text classification): task_text_classification_cola.py
- Tutorial 2 (siamese similarity): task_siamese_similarity_afqmc.py
- Tutorial 3 (sequence labeling): task_sequence_labeling_ner_crf.py
- Tutorial 4 (sentence similarity): task_sentence_similarity_lcqmc.py
- Tutorial 5 (triple similarity): task_triple_similarity_epidemic.py
- Example scripts for each task: TorchBlocks/examples/