Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lonepatient/torchblocks
A PyTorch-based toolkit for natural language processing
https://github.com/lonepatient/torchblocks
advertising bert multilabel-classification named-entity-recognition nlp pytorch relation-classification siamese-network text-classification text-similarity transformers triplet-loss
Last synced: 7 days ago
JSON representation
A PyTorch-based toolkit for natural language processing
- Host: GitHub
- URL: https://github.com/lonepatient/torchblocks
- Owner: lonePatient
- License: mit
- Created: 2020-06-21T15:09:07.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-03-10T02:28:39.000Z (over 1 year ago)
- Last Synced: 2024-11-01T08:17:06.763Z (12 days ago)
- Topics: advertising, bert, multilabel-classification, named-entity-recognition, nlp, pytorch, relation-classification, siamese-network, text-classification, text-similarity, transformers, triplet-loss
- Language: Python
- Homepage:
- Size: 481 KB
- Stars: 153
- Watchers: 7
- Forks: 25
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## TorchBlocks
(Work in Progress!!)
A PyTorch-based toolkit for natural language processing
![python](https://img.shields.io/badge/-Python_3.7_%7C_3.8_%7C_3.9_%7C_3.10-blue?logo=python&logoColor=white)
![pytorch](https://img.shields.io/badge/PyTorch_1.10+-ee4c2c?logo=pytorch&logoColor=white)
![black](https://img.shields.io/badge/Code%20Style-Black-black.svg?labelColor=gray)
![license](https://img.shields.io/badge/License-MIT-green.svg?labelColor=gray)### Requirements
- torch>=1.10.0
- tokenizers >= 0.7.0
- transformers>=4.10.0
- torchmetrics>=0.11.3TorchBlocks requires Python 3.7+. We recommend installing TorchBlocks in a Linux or OSX environment.
### Installation
Recommended (because of active development):
```shell
git clone https://github.com/lonePatient/TorchBlocks.git
cd TorchBlocks
python setup.py install
```
⚠️**Note:** This project is still in the development stage and some of the interfaces are subject to change.### Tutorials
* Tutorial 1 (text classification): [task_text_classification_cola.py](https://github.com/lonePatient/TorchBlocks/blob/master/examples/task_text_classification_cola.py)
* Tutorial 2 (siamese similarity): [task_siamese_similarity_afqmc.py](https://github.com/lonePatient/TorchBlocks/blob/master/examples/task_siamese_similarity_afqmc.py)
* Tutorial 3 (sequence labeling): [task_sequence_labeling_ner_crf.py](https://github.com/lonePatient/TorchBlocks/blob/master/examples/task_sequence_labeling_ner_crf.py)
* Tutorial 4 (sentence similarity): [task_sentence_similarity_lcqmc.py](https://github.com/lonePatient/TorchBlocks/blob/master/examples/task_sentence_similarity_lcqmc.py)
* Tutorial 5 (triple similarity): [task_triple_similarity_epidemic.py](https://github.com/lonePatient/TorchBlocks/blob/master/examples/task_triple_similarity_epidemic.py)
* Tutorial 6 (sequence labeling): [task_sequence_labeling_resume_beam_search_softmax.py](https://github.com/lonePatient/TorchBlocks/blob/master/examples/task_sequence_labeling_resume_beam_search_softmax.py)
* Tutorual 7 (sequence labeling): [task_sequence_labeling_resume_global_pointer.py](https://github.com/lonePatient/TorchBlocks/blob/master/examples/task_sequence_labeling_resume_global_pointer.py)
* Example scripts for each task: [TorchBlocks/examples/](https://github.com/lonePatient/TorchBlocks/tree/master/examples)