(Work in Progress!!)
A PyTorch-based toolkit for natural language processing
- torch>=1.10.0
- tokenizers >= 0.7.0
- transformers>=4.10.0
- torchmetrics>=0.11.3
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
- Tutorial 6 (sequence labeling): task_sequence_labeling_resume_beam_search_softmax.py
- Tutorual 7 (sequence labeling): task_sequence_labeling_resume_global_pointer.py
- Example scripts for each task: TorchBlocks/examples/