[2507.20423] CodeNER: Code Prompting for Named Entity Recognition
About this article
Abstract page for arXiv paper 2507.20423: CodeNER: Code Prompting for Named Entity Recognition
Computer Science > Computation and Language arXiv:2507.20423 (cs) [Submitted on 27 Jul 2025 (v1), last revised 26 Mar 2026 (this version, v4)] Title:CodeNER: Code Prompting for Named Entity Recognition Authors:Sungwoo Han, Hyeyeon Kim, Jingun Kwon, Hidetaka Kamigaito, Manabu Okumura View a PDF of the paper titled CodeNER: Code Prompting for Named Entity Recognition, by Sungwoo Han and 4 other authors View PDF HTML (experimental) 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 proposed code-based prompting method outperforms conventional text-based prompting on ten benchmarks across English, Arabic, Finnish, Danish, and German datasets,...