CoolFace
Modelpublic

cyqwill/sger-qwen3.5-9b-name-matching

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes23downloads
Model Card

SGER: Qwen3.5-9B 姓名实体解析与匹配

在 Qwen/Qwen3.5-9B 基础上分两阶段 LoRA 微调后的合并模型,用于印度 KYC 场景:

  1. 1.阶段一:噪声姓名解析(还原 firstname / middlename / last_name,Devanagari 天城文)
  2. 2.阶段二:二元姓名匹配(判断两个姓名是否指向同一人,输出 Yes/No)

用法

python
import torch
from transformers import AutoModelForImageTextToText, AutoTokenizer

model = AutoModelForImageTextToText.from_pretrained(
    "cyqwill/sger-qwen3.5-9b-name-matching",
    torch_dtype=torch.bfloat16,
    device_map="auto",
)
tokenizer = AutoTokenizer.from_pretrained("cyqwill/sger-qwen3.5-9b-name-matching")

prompt = (
    "<|im_start|>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).<|im_end|>\n"
    "<|im_start|>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?<|im_end|>\n'
    "<|im_start|>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 对姓名):

指标数值
Precision0.9997
Recall0.9997
F10.9997
Accuracy0.9998

注意

  • —基础模型为 Qwen/Qwen3.5-9B(多模态架构,Apache-2.0),文本主干为混合架构 (full attention + Gated DeltaNet),LoRA 只微调文本层模块。
  • —本仓库存放的是合并后的完整模型(bf16,约 19GB,含视觉塔权重)。