랭킹으로 돌아가기

lonePatient/BERT-NER-Pytorch

Python

Chinese NER(Named Entity Recognition) using BERT(Softmax, CRF, Span)

chinesenlpnerbertsoftmaxcrfspanpytorchalbertfocal-lossadversarial-traininglabelsmoothing
스타 성장
스타
2.2k
포크
434
주간 성장
이슈
69
1k2k
2020년 1월2022년 3월2024년 5월2026년 7월
아티팩트PyPIpip install bert-ner-pytorch
README

Chinese NER using Bert

BERT for Chinese NER.

update:其他一些可以参考,包括Biaffine、GlobalPointer等:examples

dataset list

  1. cner: datasets/cner
  2. CLUENER: https://github.com/CLUEbenchmark/CLUENER

model list

  1. BERT+Softmax
  2. BERT+CRF
  3. BERT+Span

requirement

  1. 1.1.0 =< PyTorch < 1.5.0
  2. cuda=9.0
  3. python3.6+

input format

Input format (prefer BIOS tag scheme), with each character its label for one line. Sentences are splited with a null line.

美	B-LOC
国	I-LOC
的	O
华	B-PER
莱	I-PER
士	I-PER

我	O
跟	O
他	O

run the code

  1. Modify the configuration information in run_ner_xxx.py or run_ner_xxx.sh .
  2. sh scripts/run_ner_xxx.sh

note: file structure of the model

├── prev_trained_model
|  └── bert_base
|  |  └── pytorch_model.bin
|  |  └── config.json
|  |  └── vocab.txt
|  |  └── ......

CLUENER result

The overall performance of BERT on dev:

Accuracy (entity) Recall (entity) F1 score (entity)
BERT+Softmax 0.7897 0.8031 0.7963
BERT+CRF 0.7977 0.8177 0.8076
BERT+Span 0.8132 0.8092 0.8112
BERT+Span+adv 0.8267 0.8073 0.8169
BERT-small(6 layers)+Span+kd 0.8241 0.7839 0.8051
BERT+Span+focal_loss 0.8121 0.8008 0.8064
BERT+Span+label_smoothing 0.8235 0.7946 0.8088

ALBERT for CLUENER

The overall performance of ALBERT on dev:

model version Accuracy(entity) Recall(entity) F1(entity) Train time/epoch
albert base_google 0.8014 0.6908 0.7420 0.75x
albert large_google 0.8024 0.7520 0.7763 2.1x
albert xlarge_google 0.8286 0.7773 0.8021 6.7x
bert google 0.8118 0.8031 0.8074 -----
albert base_bright 0.8068 0.7529 0.7789 0.75x
albert large_bright 0.8152 0.7480 0.7802 2.2x
albert xlarge_bright 0.8222 0.7692 0.7948 7.3x

Cner result

The overall performance of BERT on dev(test):

Accuracy (entity) Recall (entity) F1 score (entity)
BERT+Softmax 0.9586(0.9566) 0.9644(0.9613) 0.9615(0.9590)
BERT+CRF 0.9562(0.9539) 0.9671(0.9644) 0.9616(0.9591)
BERT+Span 0.9604(0.9620) 0.9617(0.9632) 0.9611(0.9626)
BERT+Span+focal_loss 0.9516(0.9569) 0.9644(0.9681) 0.9580(0.9625)
BERT+Span+label_smoothing 0.9566(0.9568) 0.9624(0.9656) 0.9595(0.9612)
관련 저장소
Anduin2017/HowToCook

Programmer's guide about how to cook at home.

The Unlicensecookbookrecipes
howtocook.aiursoft.com
101.3k11k
d2l-ai/d2l-zh

《动手学深度学习》:面向中文读者、能运行、可讨论。中英文版被70多个国家的500多所大学用于教学。

PythonPyPIApache License 2.0deep-learningbook
zh.d2l.ai
79.1k12.3k
byoungd/up

An advanced guide which might benefit you a lot 🎉 . 人生进阶指南 离谱的人生 离谱的英语学习指南/英语学习教程/英语学习/学英语

JavaScriptnpmchinesetutorial
token.love
56k5.7k
chinese-poetry/chinese-poetry

The most comprehensive database of Chinese poetry 🧶最全中华古诗词数据库, 唐宋两朝近一万四千古诗人, 接近5.5万首唐诗加26万宋诗. 两宋时期1564位词人,21050首词。

JavaScriptnpmMIT Licensejsonchinese
awesome-poetry.top
52.7k10.6k
2noise/ChatTTS

A generative speech model for daily dialogue.

PythonPyPIGNU Affero General Public License v3.0agenttext-to-speech
2noise.com
39.7k4.2k
byoungd/English-level-up-tips

An advanced guide to learn English which might benefit you a lot 🎉 . 离谱的英语学习指南/英语学习教程。

HTMLchinesetutorial
byoungd.github.io/English-level-up-tips/
38k4.2k
PDFMathTranslate/PDFMathTranslate

[EMNLP 2025 Demo] PDF scientific paper translation with preserved formats - 基于 AI 完整保留排版的 PDF 文档全文双语翻译,支持 Google/DeepL/Ollama/OpenAI 等服务,提供 CLI/GUI/MCP/Docker/Zotero

PythonPyPIGNU Affero General Public License v3.0chineselatex
pdf2zh.com
35.7k3.2k
sunface/rust-course

什么?你敢放心的把后背交给 AI? 我赌你不敢,那就来学学 AI 时代最酷、最安全、最快的语言吧。本书拥有全面且深入的讲解、生动贴切的示例、德芙般丝滑的内容,这可能是目前最用心的 Rust 中文学习教程 / Book

Rustcrates.iorust-langrust
course.rs
30.7k2.6k
Z-Siqi/Clash-for-Windows_Chinese

clash for windows汉化版. 提供clash for windows的汉化版, 汉化补丁及汉化版安装程序

JavaScriptnpmclashwindows
28.4k3.2k
xiaojieonly/Ehviewer_CN_SXJ

ehviewer,用爱发电,快乐前行

COtherscreenshotehviewer
25.5k670
AccumulateMore/CV

✅(已完结)超级全面的 深度学习 笔记【土堆 Pytorch】【李沐 动手学深度学习】【吴恩达 深度学习】【大飞 大模型Agent】

Jupyter Notebookbookchinese
22.8k2.6k
AiHubCN/Awesome-Chinese-LLM

整理开源的中文大语言模型,以规模较小、可私有化部署、训练成本较低的模型为主,包括底座模型,垂直领域微调及应用,数据集与教程等。

llmnlp
22.7k2.1k