Tensorflow-based framework which lists implementation of conventional neural network models (CNN, RNN-based) for Relation Extraction classification tasks as well as API for custom model implementation
Project description
AREnets
AREnets -- is an OpenNRE like project, but the kernel based on tensorflow
library, with implementation of neural networks on top of it, designed for Attitude and Relation Extraction tasks.
AREnets is a result of advances in Sentiment Attitude Extraction task
but introduced in generalized form and applicable for other relation-extraction related classification tasks.
It provides ready to use neural networks and API for subject
→object
pairs classification in a given samples.
This project is powered by
AREkit
core API, squeezed into a tiny
kernel.
Contents
Installation
pip install git+https://github.com/nicolay-r/AREnets@master
Quick Start
Simply just open and follow the google-colab version like IDE to modify the train and inference code of provided tutorial:
The complete examples are in tutorials folder.
First of all, prepare your _data
folder with data required for training model and performing inference.
- Input samples: check out input data formatting guide.
- Embeddings could be obtained from NLPL repository,
with
model.txt
file placed at_data
folder;- See downloading script;
More on input features could be found here.
Train
from arenets.quickstart.train import train
from arenets.enum_name_types import ModelNames
train(input_data_dir="_data", labels_count=3, model_name=ModelNames.CNN, epochs_count=10)
Runs cnn
model with 10
epochs for 3-class
classification problem;
all the model-related details will be stored at _data
model by default.
Predict
from arenets.quickstart.predict import predict
from arenets.arekit.common.data_type import DataType
from arenets.enum_name_types import ModelNames
predict(input_data_dir="_data", output_dir="_out", labels_count=3, model_name=ModelNames.CNN, data_type=DataType.Test)
Predict test
results for pre-trained cnn
model and saves them into _out
folder
Models List
- Aspect-based Attentive encoders:
- Multilayer Perceptron (MLP) [code] / [github:nicolay-r];
- Self-based Attentive encoders:
- P. Zhou et. al. [code] / [github:SeoSangwoo];
- Z. Yang et. al. [code] / [github:ilivans];
- Single Sentence Based Architectures:
- CNN [code] / [github:roomylee];
- CNN + Aspect-based MLP Attention [code];
- PCNN [code] / [github:nicolay-r];
- PCNN + Aspect-based MLP Attention [code];
- RNN (LSTM/GRU/RNN) [code] / [github:roomylee];
- IAN (frames based) [code] / [github:lpq29743];
- RCNN (BiLSTM + CNN) [code] / [github:roomylee];
- RCNN + Self Attention [code];
- BiLSTM [code] / [github:roomylee];
- Bi-LSTM + Aspect-based MLP Attention [code]
- Bi-LSTM + Self Attention [code] / [github:roomylee];
- RCNN + Self Attention [code];
- Multi Sentence Based Encoders Architectures:
Test Details
This project has been tested under the following setup:
- NVidia GTX-1060/1080 TI
- Python 3.6.9
- Pip freeze package list
- Cuda compilation tools, release 10.0, V10.0.130
How to cite
Our one and my personal interest is to help you better explore and analyze attitude and relation extraction related tasks with AREnets. A great research is also accompanied with the faithful reference. if you use or extend our work, please cite as follows:
@misc{arenets2023,
author={Nicolay Rusnachenko},
title={AREnets: Tensorflow-based framework of neural-network applicable
models for attitude and relation extraction tasks},
year={2023},
url={https://github.com/nicolay-r/AREnets},
}
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 arenets-0.23.0.tar.gz
.
File metadata
- Download URL: arenets-0.23.0.tar.gz
- Upload date:
- Size: 154.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 017ab7e2b1d386ffe36927d53c6e7fb191a8ced9d70ee8f4465fa0be2aef4bff |
|
MD5 | edd523852e138611848513d035e91c9e |
|
BLAKE2b-256 | 79c5af2ba5f96bdaeb3532716739dbd5eb00acd7572b34d1ac871558a8d35f90 |
File details
Details for the file arenets-0.23.0-py3-none-any.whl
.
File metadata
- Download URL: arenets-0.23.0-py3-none-any.whl
- Upload date:
- Size: 220.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 405dd0a8f01c94c1ad644e3a5a980d2c09d52a3eb041a4300d56a4a50c9bb256 |
|
MD5 | 6ae9df94275188c9f456db7fb9fae06d |
|
BLAKE2b-256 | 6ec3204733ab177d0c2b51ee2bd6f34181b9b54379fc75cb9377e56685924137 |