SGER: LFM2.5-350M 姓名实体解析与匹配
在 LiquidAI/LFM2.5-350M 基础上分两阶段 LoRA 微调后的合并模型,用于印度 KYC 场景:
- 阶段一:噪声姓名解析(还原 first_name / middle_name / last_name,Devanagari 天城文)
- 阶段二:二元姓名匹配(判断两个姓名是否指向同一人,输出 Yes/No)
用法
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
"cyqwill/sger-lfm2.5-name-matching",
torch_dtype=torch.bfloat16,
device_map="auto",
)
tokenizer = AutoTokenizer.from_pretrained("cyqwill/sger-lfm2.5-name-matching")
prompt = (
"<|system|>\n"
"You are an expert system for KYC name matching in India. Determine if Name 1 and Name 2 refer to the same person. "
"Account for spelling variations, abbreviations, token reordering, merged tokens, and honorifics (-bhai, -ji).\n"
"<|user|>\n"
'[Few-Shot Examples]\n'
'Name 1: "kirtan singh" | Name 2: "singhkirtan" -> Yes\n'
'Name 1: "ramesh patel" | Name 2: "rameshbhai patel" -> Yes\n'
'Name 1: "vipin" | Name 2: "bipin" -> No\n'
'[Target]\n'
'Name 1: "अनिल रजनी यादव" | Name 2: "रजनी अनिल यादव" -> Match?\n'
"<|assistant|>\n"
)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=8)
print(tokenizer.decode(out[0][inputs.input_ids.shape[-1]:], skip_special_tokens=True))
评估结果
测试集(9581 对姓名):
| 指标 | 数值 |
|---|---|
| Precision | 0.9997 |
| Recall | 0.9997 |
| F1 | 0.9997 |
| Accuracy | 0.9998 |
注意
- 基础模型为 LiquidAI/LFM2.5-350M,请遵循其原始 license。
- 本仓库存放的是合并后的完整模型(bf16)。
- Downloads last month
- -
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support