Addressing the challenges in named entity recognition(NER) for Beiyang Government Document Resources due to linguistic complexity, diversity, and lack of annotation data, this paper proposes a large language model-based NER framework adapted for low-resource scenarios. This framework provides methodological su⁃pport for structured mining and knowledge reorganization of modern historical documents. [Methods/
This framework integrated retrieval-enhanced generation with efficient parameter fine-tuning. It used Faiss vector retrieval to build a dynamic context example selection method and used the LoRA strategy to add domain knowledge to large language models.On a custom corpus, the study designed seven special entity types,including persons, places, organizations, time, positions, events,and document types. The study then compared two deep learning entity recognition methods, BERT-BiLSTM-CRF and RoBERTa-BiLSTM-CRF,with Baichuan-4B, DcepSeck-R1, Xunzi-Qwen3-8B, Qwen3-4B,Llama, and GPT-4. The study evaluated large language models performance under different sampling methods.
Experiments demonstrate that compared to traditional deep learning models and general-purpose large language mo⁃dels, the synergistic paradigm integrating LoRA fine-tuning with RAG significantly enhances entity recognition performance, achieving an overall F1 score of 0.857. A framework that uses RAG with large, fine-tuned language models for named entity recognition in Beiyang Government Document Resources works well together, and it achieves accurate entity identification in these historical records. This shows that large language models are practical and can be scaled when processing historical documents with limited resources.
| 科 Family | 属数 Number of genus | 种数 Number of species | 占总种数比例 Percentage of total species (%) | 属 Genus | 种数 Number of species | 占总种数比例 Percentage of total species (%) |
|---|---|---|---|---|---|---|
| 鹅膏菌科Amanitaceae | 2 | 11 | 5.26 | 鹅膏菌属 Amanita | 10 | 4.78 |
| 小菇科 Mycenaceae | 2 | 12 | 5.74 | 丝盖伞属 Inocybe | 5 | 2.39 |
| 多孔菌科 Polyporaceae | 8 | 14 | 6.70 | 蜡蘑属 Laccaria | 5 | 2.39 |
| 红菇科 Russulaceae | 3 | 23 | 11.00 | 小皮伞属 Marasmius | 6 | 2.87 |
| 小菇属 Mycena | 11 | 5.26 | ||||
| 光柄菇属 Pluteus | 5 | 2.39 | ||||
| 红菇属 Russula | 17 | 8.13 | ||||
| 栓菌属 Trametes | 5 | 2.39 |