Code4Struct: Code Generation for Few-Shot Structured Prediction from Natural Language

10/23/2022
by   Xingyao Wang, et al.
0

Large Language Model (LLM) trained on the mixture of text and code has demonstrated impressive capability in translating natural language (NL) into structured code. In this work, we propose Code4Struct to leverage such text-to-structure translation capability to tackle structured prediction tasks in NLP. For example, Event Argument Extraction (EAE) aims to convert text into event-argument structures that can be represented as a class object using code. This alignment between structures and code enables us to take advantage of Programming Language (PL) features such as inheritance and type annotation to introduce external knowledge or add constraints with ease. We exploit the analogy between PL and NLP problems, and, as a case study, we use Code4Struct to tackle the EAE task using code generation. We ask a LLM to generate code to instantiate an event class with predicted arguments given a NL sentence. Despite only using 50 training instances for each event type, Code4Struct is comparable to fully-supervised models trained on 4,202 event instances and, when given the same 50-shot data, outperforms current state-of-the-art (SOTA) by 20.8 using inheritance, Code4Struct can predict arguments for low-resource event types using 10-shot training instances from its sibling event type and outperforms zero-shot baseline by 12

READ FULL TEXT

page 4

page 11

page 12

page 13

page 14

page 15

research
08/29/2021

Event Extraction as Natural Language Generation

Event extraction (EE), the task that identifies event triggers and their...
research
10/03/2017

Is Structure Necessary for Modeling Argument Expectations in Distributional Semantics?

Despite the number of NLP studies dedicated to thematic fit estimation, ...
research
02/09/2023

Global Constraints with Prompting for Zero-Shot Event Argument Classification

Determining the role of event arguments is a crucial subtask of event ex...
research
01/13/2022

CLIP-Event: Connecting Text and Images with Event Structures

Vision-language (V+L) pretraining models have achieved great success in ...
research
05/02/2021

Event Argument Extraction using Causal Knowledge Structures

Event Argument extraction refers to the task of extracting structured in...
research
09/20/2018

Rapid Customization for Event Extraction

We present a system for rapidly customizing event extraction capability ...
research
04/21/2019

Few-shot NLG with Pre-trained Language Model

Natural language generation (NLG) from structured data or knowledge is e...

Please sign up or login with your details

Forgot password? Click here to reset