A toolkit for Relation Extraction and more...
Project description
A toolkit for Relation & Event eXtraction (REx) and more...
This project has not been finished yet, so be careful when using it, or wait until the first release comes out.
This project is suffering from the second-system effect. I would like to cut some features to make this going smoothly.
Accelerate seems to be a very sweet wrapper for multi-GPU, TPU training, we highly recommend you to use such frameworks, instead of adding hard codes on your own.
⚙️Installation
Make sure you have installed all the dependencies below.
- Python>=3.6
- torch>=1.2.0 : project is developed with torch==1.7.1, should be compatable with >=1.2.0 versions
- numpy>=1.19.0
- scikit-learn>=0.21.3
- click>=7.1.2
- omegaconf>=2.0.6
- loguru>=0.5.3
- tqdm>=4.61.1
- transformers>=4.8.2
$ git clone https://github.com/Spico197/REx.git
$ cd REx
$ pip install -e .
# or you can download and install from pypi, not recommend for now
$ pip install pytorch-rex -i https://pypi.org/simple
🚀QuickStart
Checkout the examples
folder.
Name | Model | Dataset | Task |
---|---|---|---|
SentRE-MCML | PCNN | IPRE | Sentence-level Multi-class multi-label relation classification |
BagRE | PCNN+ONE | NYT10 | Bag-level relation classification (Multi-Instance Learning, MIL) |
JointERE | CasRel | WebNLG | Jointly entity relation extraction |
✈️Abilities
Dataset
- IPRE preprocess
- NYT10
Tasks
- Chinese sentence-level relation extraction
- English bag-level relation extraction
Modules & Models
- Piecewise CNN
- PCNN + ONE
- PCNN + ATT
🌴Development
Make sure you have installed the following packages:
- coverage
- flake8
- sphinx
- sphinx_rtd_theme
Build
$ make all
Test
pip install coverage
coverage run -m unittest -v && coverage report
# or just test without coverage report
make test
# or test with report
make test_report
Docs
cd docs
sphinx-apidoc -o . ..
make html
# or just
make docs
✉️Update
- v0.0.2: add black formatter and pytest testing
- v0.0.1: change
LabelEncoder.to_binary_labels
intoconvert_to_multi_hot
orconvert_to_one_hot
🔑LICENCE
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pytorch-rex-0.0.2.tar.gz
.
File metadata
- Download URL: pytorch-rex-0.0.2.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.7.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a80c17fe75d584bb692bc94ba60462270adb57de3148a3dc91e3db7c6591007b |
|
MD5 | 1e9056a61e20d7f0fa1618d7d6100f5d |
|
BLAKE2b-256 | c5a6a686d767d83e3dbab5061ca491ebc225540dce7de2a7379efda4caf1c739 |
File details
Details for the file pytorch_rex-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: pytorch_rex-0.0.2-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.7.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca2892b5877aaf71cf0528b05c72a5dcb110b452b671a08c2f408fda75e22e39 |
|
MD5 | 5287c1a2c290ef216b298b1f248f64c1 |
|
BLAKE2b-256 | 615fa5fc488cc5d256628f327e945f67baedca3d5d83eb4b8fb64b6074679ce4 |