Giter VIP home page Giter VIP logo

metaevent's Introduction

Introduction

The MetaEvent repository is the PyTorch implementation of ACL 2023 Paper Zero-and Few-Shot Event Detection via Prompt-Based Meta Learning

We propose MetaEvent, a meta learning-based framework for zero- and few-shot event detection. Specifically, we sample training tasks from existing event types and perform meta training to search for optimal parameters that quickly adapt to unseen tasks. In our framework, we propose to use the cloze-based prompt and a trigger-aware soft verbalizer to efficiently project output to unseen event types. Moreover, we design a contrastive meta objective based on maximum mean discrepancy (MMD) to learn class-separating features. As such, the proposed MetaEvent can perform zero-shot event detection by mapping features to event types without any prior knowledge. In our experiments, we demonstrate the effectiveness of MetaEvent in both zero-shot and few-shot scenarios, where the proposed method achieves state-of-the-art performance in extensive experiments on benchmark datasets FewEvent and MAVEN.

Citing

Please consider citing the following paper if you use our methods in your research:

@inproceedings{yue2023zero,
  title={Zero-and Few-Shot Event Detection via Prompt-Based Meta Learning},
  author={Yue, Zhenrui and Zeng, Huimin and Lan, Mengfei and Ji, Heng and Wang, Dong},
  booktitle={Proceedings of the 61th Annual Meeting of the Association for Computational Linguistics},
  year={2023}
}

Data & Requirements

The adopted datasets are publicly available, you can download FewEvent here and MAVEN here. To run our code you need PyTorch & Transformers, see requirements.txt for our running environment

Run MetaAdapt

python src/train_fewevent_zeroshot.py;

Excecute the above command (with arguments) to perform zero-shot training on FewEvent.

python src/train_maven_zeroshot.py;

Excecute the above command (with arguments) to perform zero-shot training on MAVEN.

python src/train_fewevent_fewshot.py;

Excecute the above command (with arguments) to perform few-shot training on FewEvent.

python src/train_maven_fewshot.py;

Excecute the above command (with arguments) to perform few-shot training on MAVEN.

Performance

The zero and few-shot performance on both datasets is presented below. For training and evaluation details, please refer to our paper and code.

Acknowledgement

During the implementation we base our code mostly on PA-CRF from Cong et al. and MetaST by Wang et al. Many thanks to these authors for their great work!

metaevent's People

Contributors

yueeeeeeee avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.