用代码提示提升大模型对命名实体识别的精准理解
CodeNER: Code Prompting for Named Entity Recognition
- 将编程代码嵌入提示,明确指定BIO标注格式
- 在五种语言十项基准上表现优于传统文本提示
- 适合需要高精度标注的多语言NLP任务
近期研究尝试利用大语言模型(LLMs)将候选命名实体跨度视为源和目标序列来处理命名实体识别(NER)。尽管先前方法能生成带有合适标签的候选实体跨度,但它们在使用LLM时仅依赖输入上下文信息,尤其是ChatGPT。然而,NER本质上需要结合输入上下文与详细的标注要求。为此,我们提出一种新方法:通过代码提示增强LLM对NER的理解能力。通过在提示中嵌入代码,提供清晰的BIO标注模式指令,从而利用LLM对编程语言长程结构的理解优势。实验表明,该代码提示方法在英语、阿拉伯语、芬兰语、丹麦语和德语的十项基准上均优于传统文本提示,证明显式结构化指令的有效性。此外,将本方法与思维链提示结合可进一步提升性能。
原文摘要 · Abstract (English)
Recent studies have explored various approaches for treating candidate named entity spans as both source and target sequences in named entity recognition (NER) by leveraging large language models (LLMs). Although previous approaches have successfully generated candidate named entity spans with suitable labels, they rely solely on input context information when using LLMs, particularly, ChatGPT. However, NER inherently requires capturing detailed labeling requirements with input context information. To address this issue, we propose a novel method that leverages code-based prompting to improve the capabilities of LLMs in understanding and performing NER. By embedding code within prompts, we provide detailed BIO schema instructions for labeling, thereby exploiting the ability of LLMs to comprehend long-range scopes in programming languages. Experimental results demonstrate that the proposed code-based prompting method outperforms conventional text-based prompting on ten benchmarks across English, Arabic, Finnish, Danish, and German datasets, indicating the effectiveness of explicitly structuring NER instructions. We also verify that combining the proposed code-based prompting method with the chain-of-thought prompting further improves performance.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。