Token Classification
Transformers
PyTorch
Chinese
named-entity-recognition
ner
ernie
crf
chinese-nlp
person-name-extraction
financial-documents
Instructions to use warfbro/Human-Name-extraction with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use warfbro/Human-Name-extraction with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="warfbro/Human-Name-extraction")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("warfbro/Human-Name-extraction", dtype="auto") - Notebooks
- Google Colab
- Kaggle
| """规则提取(简单模板)""" | |
| import re | |
| def extract(title: str): | |
| """ | |
| 模板: 关于[核准|同意][人名]、[人名]...任职 | |
| 返回 [names] 或 None | |
| """ | |
| m = re.match(r"关于(?:核准|同意)?(.+?)任职", title) | |
| if not m: | |
| return None | |
| name_part = m.group(1) | |
| # 按顿号分隔多人 | |
| if "、" in name_part: | |
| names = [n.strip() for n in name_part.split("、") if n.strip()] | |
| return names if names else None | |
| return [name_part] | |