cyqwill commited on
Commit
a5c9090
·
verified ·
1 Parent(s): 6fcc74f

Delete README_test.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README_test.md +0 -67
README_test.md DELETED
@@ -1,67 +0,0 @@
1
- ---
2
- language:
3
- - hi
4
- - en
5
- license: apache-2.0
6
- tags:
7
- - qwen3.5
8
- - entity-resolution
9
- - kyc
10
- - name-matching
11
- base_model: Qwen/Qwen3.5-9B
12
- ---
13
-
14
- # SGER: Qwen3.5-9B 姓名实体解析与匹配
15
-
16
- 在 Qwen/Qwen3.5-9B 基础上分两阶段 LoRA 微调后的合并模型,用于印度 KYC 场景:
17
-
18
- 1. **阶段一**:噪声姓名解析(还原 first_name / middle_name / last_name,Devanagari 天城文)
19
- 2. **阶段二**:二元姓名匹配(判断两个姓名是否指向同一人,输出 Yes/No)
20
-
21
- ## 用法
22
-
23
- ```python
24
- import torch
25
- from transformers import AutoModelForImageTextToText, AutoTokenizer
26
-
27
- model = AutoModelForImageTextToText.from_pretrained(
28
- "cyqwill/sger-qwen3.5-9b-name-matching",
29
- torch_dtype=torch.bfloat16,
30
- device_map="auto",
31
- )
32
- tokenizer = AutoTokenizer.from_pretrained("cyqwill/sger-qwen3.5-9b-name-matching")
33
-
34
- prompt = (
35
- "<|im_start|>system\n"
36
- "You are an expert system for KYC name matching in India. Determine if Name 1 and Name 2 refer to the same person. "
37
- "Account for spelling variations, abbreviations, token reordering, merged tokens, and honorifics (-bhai, -ji).<|im_end|>\n"
38
- "<|im_start|>user\n"
39
- '[Few-Shot Examples]\n'
40
- 'Name 1: "kirtan singh" | Name 2: "singhkirtan" -> Yes\n'
41
- 'Name 1: "ramesh patel" | Name 2: "rameshbhai patel" -> Yes\n'
42
- 'Name 1: "vipin" | Name 2: "bipin" -> No\n'
43
- '[Target]\n'
44
- 'Name 1: "अनिल रजनी यादव" | Name 2: "रजनी अनिल यादव" -> Match?<|im_end|>\n'
45
- "<|im_start|>assistant\n"
46
- )
47
- inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
48
- out = model.generate(**inputs, max_new_tokens=8)
49
- print(tokenizer.decode(out[0][inputs.input_ids.shape[-1]:], skip_special_tokens=True))
50
- ```
51
-
52
- ## 评估结果
53
-
54
- 测试集(9581 对姓名):
55
-
56
- | 指标 | 数值 |
57
- | --- | --- |
58
- | Precision | 0.9997 |
59
- | Recall | 0.9997 |
60
- | F1 | 0.9997 |
61
- | Accuracy | 0.9998 |
62
-
63
- ## 注意
64
-
65
- - 基础模型为 Qwen/Qwen3.5-9B(多模态架构,Apache-2.0),文本主干为混合架构
66
- (full attention + Gated DeltaNet),LoRA 只微调文本层模块。
67
- - 本仓库存放的是合并后的完整模型(bf16,约 19GB,含视觉塔权重)。