[论文解读] NER4all or Context is All You Need: Using LLMs for low-effort, high-performance NER on historical texts. A humanities informed approach
论文表明,带有人文信息的提示对出厂就可用的LLMs在历史NER上优于spaCy和Flair,特别是在融入上下文和人设建模时;零-shot提示甚至可超越多-shot提示,最高到16次示例。
Named entity recognition (NER) is a core task for historical research in automatically establishing all references to people, places, events and the like. Yet, do to the high linguistic and genre diversity of sources, only limited canonisation of spellings, the level of required historical domain knowledge, and the scarcity of annotated training data, established approaches to natural language processing (NLP) have been both extremely expensive and yielded only unsatisfactory results in terms of recall and precision. Our paper introduces a new approach. We demonstrate how readily-available, state-of-the-art LLMs significantly outperform two leading NLP frameworks, spaCy and flair, for NER in historical documents by seven to twentytwo percent higher F1-Scores. Our ablation study shows how providing historical context to the task and a bit of persona modelling that turns focus away from a purely linguistic approach are core to a successful prompting strategy. We also demonstrate that, contrary to our expectations, providing increasing numbers of examples in few-shot approaches does not improve recall or precision below a threshold of 16-shot. In consequence, our approach democratises access to NER for all historians by removing the barrier of scripting languages and computational skills required for established NLP tools and instead leveraging natural language prompts and consumer-grade tools and frontends.
研究动机与目标
- 将NER重新框定为由领域上下文驱动的人文学科信息任务,而不仅仅依赖语言学线索。
- 评估在历史NER任务上,针对性提示对商业化LLMs的性能影响。
- 将LLM提示策略与现有NER流程(spaCy 与 Flair)在历史语料上进行比较。
- 识别上下文、人设建模以及少-shot/多-shot对召回、精准度和F1的影响。
- 评估语言因素及在 humanities 研究中实现对NER的普及化使用的实际意义。
提出的方法
- 使用以1921年Berlin Baedeker旅行指南为基础的真实标签语料库,标注为PER、ORG、LOC。
- 对LLM输出采用带有跨度标注的真实标签跨度格式。
- 开发并应用包含上下文信息和人设建模的德英双语提示方案。
- 进行消融研究以量化上下文、人设建模以及零-shot/少-shot/多-shot提示的影响。
- 使用模糊跨度匹配和 nervaluate 来对比 Flair 和 spaCy 的基线,评估LLM输出的准确性。

实验结果
研究问题
- RQ1在不进行微调的前提下,可用的LLMs是否在历史文本上达到更高的NER召回率和精准度?
- RQ2上下文提示、人设建模和提示-shot数量对历史语料库的NER表现有何影响?
- RQ3在历史文献上,具有人文学科信息提示的LLMs是否优于spaCy和Flair?
- RQ4提示语言(英语与德语)对带有历史提示的NER表现有何影响?
- RQ5实际应用中(成本、上下文窗口、标注努力等)哪些因素会影响LLMs在历史NER中的使用?
主要发现
| Context-Impact | lang | Recall | Precision | F1-Score |
|---|---|---|---|---|
| Full Prompt | de | 0.84 ±0.10 | 0.91 ±0.08 | 0.87 ±0.08 |
| Full Prompt | en | 0.85 ±0.09 | 0.91 ±0.06 | 0.88 ±0.07 |
| Specific Context | de | 0.81 ±0.19 | 0.87 ±0.19 | 0.84 ±0.19 |
| Specific Context | en | 0.86 ±0.08 | 0.89 ±0.08 | 0.88 ±0.07 |
| Generic Context | de | 0.81 ±0.11 | 0.90 ±0.10 | 0.85 ±0.09 |
| No Context | de | 0.75 ±0.15 | 0.90 ±0.09 | 0.81 ±0.11 |
| Baseline flair | -- | 0.76 ±0.13 | 0.89 ±0.10 | 0.81 ±0.11 |
| Baseline spaCy | -- | 0.71 ±0.13 | 0.62 ±0.11 | 0.66 ±0.10 |
| (additional prompts and context) | -- | -- | -- | -- |
- 具有人文学科信息提示的LLMs在历史NER的召回率和精准度方面显著优于spaCy和Flair。
- 零-shot提示可在大约使用16个示例前超过少-shot提示,挑战“示例越多越好”的假设。
- 上下文信息和人设建模是高效提示的核心;缺乏上下文或通用/无上下文的提示显著降低性能。
- 德语和英语提示在包含上下文和人设要素时得到的结果相当。
- Baseline Flair在德语NER上达到0.76召回、0.89精准、0.81 F1;spaCy在LOC召回0.82、PER0.76、ORG0.12(总体F1 0.50)表现落后。
- 零-shot与富上下文提示降低了对标注数据的需求,降低了历史学家使用的门槛。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。