--- language: - hi - en license: apache-2.0 tags: - qwen3.5 - entity-resolution - kyc - name-matching base_model: Qwen/Qwen3.5-9B --- # SGER: Qwen3.5-9B 姓名实体解析与匹配 在 Qwen/Qwen3.5-9B 基础上分两阶段 LoRA 微调后的合并模型,用于印度 KYC 场景: 1. **阶段一**:噪声姓名解析(还原 first_name / middle_name / last_name,Devanagari 天城文) 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 对姓名): | 指标 | 数值 | | --- | --- | | Precision | 0.9997 | | Recall | 0.9997 | | F1 | 0.9997 | | Accuracy | 0.9998 | ## 注意 - 基础模型为 Qwen/Qwen3.5-9B(多模态架构,Apache-2.0),文本主干为混合架构 (full attention + Gated DeltaNet),LoRA 只微调文本层模块。 - 本仓库存放的是合并后的完整模型(bf16,约 19GB,含视觉塔权重)。