Skip to main content

A toolkit for Relation Extraction and more...

Project description



Build CodeCoverage Docs

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
    • 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

✉️Update

  • v0.0.9: use argparse instead of click, move loguru logger into rex.utils.logging, add hierarchical config setting
  • v0.0.8: fix config loading, change default of makedirs and dump_configfile to be True
  • v0.0.7: fix recursive import bug
  • v0.0.6: integrate omega conf loading into the inner task, add load_*_data option to data managers
  • v0.0.5: update ffn
  • v0.0.4: return detailed classification information in mc_prf1, support nested dict tensor movement
  • v0.0.3: fix packaging bug in setup.py
  • v0.0.2: add black formatter and pytest testing
  • v0.0.1: change LabelEncoder.to_binary_labels into convert_to_multi_hot or convert_to_one_hot

🔑LICENCE

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytorch-rex-0.0.9.tar.gz (27.0 kB view details)

Uploaded Source

Built Distribution

pytorch_rex-0.0.9-py3-none-any.whl (41.4 kB view details)

Uploaded Python 3

File details

Details for the file pytorch-rex-0.0.9.tar.gz.

File metadata

  • Download URL: pytorch-rex-0.0.9.tar.gz
  • Upload date:
  • Size: 27.0 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

Hashes for pytorch-rex-0.0.9.tar.gz
Algorithm Hash digest
SHA256 e1923f0786565dbdd151bab911a956aa7c9bb066105b2c4018caccfc84f6abe0
MD5 277ad4133333cd704222525641ed14c5
BLAKE2b-256 f1bd11c76d27621199d7be167903ff9c46192e79d48f9daefd1493a694d7465a

See more details on using hashes here.

File details

Details for the file pytorch_rex-0.0.9-py3-none-any.whl.

File metadata

  • Download URL: pytorch_rex-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 41.4 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

Hashes for pytorch_rex-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 71097ab7d27470930157083c6ffd2e2b106f6c530ec4fd4ea55c976d40051b9d
MD5 4777cda088e408094d52d14fcec83f4f
BLAKE2b-256 d06dd66c44703fbbbf77bc58ff11b22a96fe9a868dbc0bf35339e67fe5d0aceb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page