Skip to main content

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

Open In Colab

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

Open In Colab

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.

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

FAQ

How to prepare input data?

How to setup jsonl or csv data reader?

How to implement a custom model with attention?

How to customize the prediction output?

Test Details

This project has been tested under the following setup:

  • NVidia GTX-1060/1080 TI
  • CUDA compilation tools, release 10.0, V10.0.130
  • Python 3.6.9
  • Pandas 0.25.3 (Optional, only for CSV reading)
  • Pip freeze package list

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 attentive neural-network 
         models for text classfication and relation extraction tasks},
  year={2023},
  url={https://github.com/nicolay-r/AREnets},
}

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

arenets-0.23.1.tar.gz (155.9 kB view hashes)

Uploaded Source

Built Distribution

arenets-0.23.1-py3-none-any.whl (224.5 kB view hashes)

Uploaded Python 3

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