arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2403.19283cs.CL
收藏

基于不合语法句法的上下文示例选择方法用于语法错误纠正

Ungrammatical-syntax-based In-context Example Selection for Grammatical Error Correction

Peking University(北京大学)

Chenming Tang, Fanyi Qu, Yunfang Wu

AI总结:

本文针对语法错误纠正任务,提出基于不合语法句法相似度的上下文示例选择策略,并通过两阶段筛选优化示例质量,实验证明其优于词匹配和语义方法,能有效提升大语言模型的GEC性能。

摘要:

在大语言模型(LLMs)时代,上下文学习(ICL)作为一种有效的提示策略脱颖而出,探索了LLMs在各种任务中的潜力。然而,将LLMs应用于语法错误纠正(GEC)仍然是一项具有挑战性的任务。本文提出了一种新颖的基于不合语法句法的上下文示例选择策略用于GEC。具体而言,我们使用多种算法基于句子的句法结构来度量句子之间的相似性,并识别出与测试输入共享最相似的不合语法句法结构的最优ICL示例。此外,我们采用了一个两阶段过程来进一步提高选择结果的质量。在基准英语GEC数据集上,实验结果表明,我们提出的基于不合语法句法的策略在使用多个LLMs时优于常用的词匹配或基于语义的方法。这表明对于像GEC这样以句法为导向的任务,更多地关注句法信息可以有效提升LLMs的性能。我们的代码将在本文发表后公开。

英文摘要:

In the era of large language models (LLMs), in-context learning (ICL) stands out as an effective prompting strategy that explores LLMs' potency across various tasks. However, applying LLMs to grammatical error correction (GEC) is still a challenging task. In this paper, we propose a novel ungrammatical-syntax-based in-context example selection strategy for GEC. Specifically, we measure similarity of sentences based on their syntactic structures with diverse algorithms, and identify optimal ICL examples sharing the most similar ill-formed syntax to the test input. Additionally, we carry out a two-stage process to further improve the quality of selection results. On benchmark English GEC datasets, empirical results show that our proposed ungrammatical-syntax-based strategies outperform commonly-used word-matching or semantics-based methods with multiple LLMs. This indicates that for a syntax-oriented task like GEC, paying more attention to syntactic information can effectively boost LLMs' performance. Our code will be publicly available after the publication of this paper.

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

↑