Skip to content

ANR-kFLOW/event-relation-classification

Repository files navigation

Table of Contents

Event Relation Classification

This repository contains code and resources for the paper:

Youssra Rebboud, Pasquale Lisena and Raphaël Troncy. Prompt-based Data Augmentation for Semantically-precise Event Relation Classification. Submitted at Semantic Methods for Events and Stories (SEMMES) workshop 2023

pip install -r requirements.txt

BERT finetuning

BERT\SpanBERT models fine-tuning for token And sentence classification.

To fine-tune BERT models for relation extraction, you can use the sequence_classification.py script. This script takes in a dataset of sentence pairs and their relation labels and fine-tunes a BERT model for relation classification.

To perform inference on the fine-tuned model, you can use the inference.py script. This script takes in a dataset of sentence pairs and performs relation classification using the fine-tuned BERT model.

You can download pre-trained BERT models from the following link:

To fine-tune BERT models for event extraction, you can use the weighted_loss.py script. This script takes in a dataset of sentences and their token labels and fine-tunes a BERT model for event extraction(token classification).

CMan

Replication of the paper:

Shan Zhao, Minghao Hu, Zhiping Cai, Fang Liu Modeling Dense Cross-Modal Interactions for Joint Entity-Relation Extraction. In Proceedings of the Twenty-Ninth International Joint Conference on Artificial Intelligence (IJCAI) Pages 4032-4038. https://doi.org/10.24963/ijcai.2020/558

Joint relation extraction and entity recognition with a Conditional random field (CRF).

GPT-3 data augmentation

Scripts for generating new sentences involving event relations, starting from FARO definitions and examples from an existing Dataset.

Sentence Generation

To generate new sentences involving event relations, you can use the following command:

python sentence_generation.py

This script will take as input a CSV file containing a list of examples with the desired event relation, and output a new CSV file containing the newly generated sentences.

Event Triggers Generation

To generate event triggers for a given set of sentences, you can use the following command:

python Event_triggers_generation_by_GPT-3.py

This script will generate the desired event triggers for the given sentences.

Cleaning Generated Events

To clean up the generated event triggers, you can use the following command:

python answers_cleaning.py

This script will clean the generated events from unwanted text using regular expressions output a new CSV file containing the cleaned data.

Data

The output dataset in csv format, divided in training, test and validation.

About

Prompt based data augmentation for event and event relation classification

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages