arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2210.12810cs.CL
收藏

Code4Struct:面向少样本事件结构预测的代码生成

Code4Struct: Code Generation for Few-Shot Event Structure Prediction

University of Illinois Urbana-Champaign(伊利诺伊大学厄巴纳-香槟分校)

Xingyao Wang, Sha Li, Heng Ji

AI总结:

本文提出 Code4Struct,将事件论元抽取形式化为代码生成问题,利用编程语言特性引入约束,在少样本和零资源场景下显著超越现有方法。

摘要:

在文本与代码混合数据上训练的大语言模型(LLM)已展现出将自然语言(NL)转换为结构化代码的出色能力。我们观察到语义结构可以方便地转换为代码,并提出 Code4Struct,以利用这种文本到结构的转换能力来解决结构化预测任务。作为案例研究,我们将事件论元抽取(EAE)形式化为将文本转换为事件-论元结构,该结构可以使用代码表示为类对象。结构与代码之间的这种对应关系使我们能够利用编程语言(PL)的特性(如继承和类型标注)来引入外部知识或添加约束。我们表明,在具有足够上下文示例的情况下,将 EAE 形式化为代码生成问题优于使用基于文本提示的变体。尽管每种事件类型仅使用 20 个训练事件实例,Code4Struct 仍可与在 4,202 个实例上训练的监督模型相媲美,并以 29.5% 的绝对 F1 值超越当前在 20-shot 数据上训练的最先进(SOTA)模型。Code4Struct 可以使用来自同类事件类型的 10-shot 训练数据来预测零资源事件类型的论元,并以 12% 的绝对 F1 值超越零样本基线。

英文摘要:

Large Language Model (LLM) trained on a mixture of text and code has demonstrated impressive capability in translating natural language (NL) into structured code. We observe that semantic structures can be conveniently translated into code and propose Code4Struct to leverage such text-to-structure translation capability to tackle structured prediction tasks. As a case study, we formulate Event Argument Extraction (EAE) as converting 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. We show that, with sufficient in-context examples, formulating EAE as a code generation problem is advantageous over using variants of text-based prompts. Despite only using 20 training event instances for each event type, Code4Struct is comparable to supervised models trained on 4,202 instances and outperforms current state-of-the-art (SOTA) trained on 20-shot data by 29.5% absolute F1. Code4Struct can use 10-shot training data from a sibling event type to predict arguments for zero-resource event types and outperforms the zero-shot baseline by 12% absolute F1.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑