CodeNER: Code Prompting for Named Entity Recognition
Sungwoo Han, Hyeyeon Kim, Jingun Kwon, Hidetaka Kamigaito, Manabu Okumura

TL;DR
This paper introduces a novel code-based prompting technique for large language models to enhance named entity recognition by explicitly providing detailed labeling instructions, leading to improved performance across multiple languages and benchmarks.
Contribution
It proposes embedding code within prompts to better capture labeling schemas, significantly improving NER accuracy over traditional text prompts.
Findings
Outperforms conventional prompts on ten multilingual benchmarks
Combining code-based prompting with chain-of-thought further boosts performance
Effective across diverse languages including English, Arabic, Finnish, Danish, and German
Abstract
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsTopic Modeling · Natural Language Processing Techniques · Advanced Graph Neural Networks
