hoailebads commited on
Commit
65a4d8e
·
verified ·
1 Parent(s): 52f3daa

Add VLSP legal reranker train (9994) + eval (296) data + dataset card

Browse files
Files changed (4) hide show
  1. .gitattributes +1 -0
  2. README.md +104 -0
  3. eval.json +0 -0
  4. train.jsonl +3 -0
.gitattributes CHANGED
@@ -58,3 +58,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
58
  # Video files - compressed
59
  *.mp4 filter=lfs diff=lfs merge=lfs -text
60
  *.webm filter=lfs diff=lfs merge=lfs -text
 
 
58
  # Video files - compressed
59
  *.mp4 filter=lfs diff=lfs merge=lfs -text
60
  *.webm filter=lfs diff=lfs merge=lfs -text
61
+ train.jsonl filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - vi
5
+ task_categories:
6
+ - text-ranking
7
+ tags:
8
+ - reranker
9
+ - cross-encoder
10
+ - legal
11
+ - vietnamese
12
+ - vlsp
13
+ - hard-negatives
14
+ pretty_name: VLSP Vietnamese Legal Reranker — Train + Eval
15
+ size_categories:
16
+ - 1K<n<10K
17
+ configs:
18
+ - config_name: train
19
+ data_files: train.jsonl
20
+ default: true
21
+ - config_name: eval
22
+ data_files: eval.json
23
+ ---
24
+
25
+ # VLSP Vietnamese Legal Reranker — Training + Eval data
26
+
27
+ Bộ dữ liệu **listwise reranking** cho truy hồi điều luật tiếng Việt (VLSP). Đây **chính xác** là
28
+ dữ liệu đã dùng để fine-tune 2 model reranker:
29
+
30
+ - 🤗 [`hoailebads/Qwen3-Reranker-8B-VLSP-Legal-LoRA`](https://huggingface.co/hoailebads/Qwen3-Reranker-8B-VLSP-Legal-LoRA) (bản chính, vượt SOTA VLSP)
31
+ - 🤗 [`hoailebads/Qwen3-Reranker-0.6B-VLSP-Legal-LoRA`](https://huggingface.co/hoailebads/Qwen3-Reranker-0.6B-VLSP-Legal-LoRA) (bản nhẹ)
32
+
33
+ 📦 Code, pipeline & script tạo dữ liệu: **https://github.com/hoaileba/Qwen-Retrieval-Tuning**
34
+ (file gốc: `dataset/train_rankllama_hn23_v3.jsonl`, tạo bằng `data_prep/mine_hard_negatives_v3.py`).
35
+
36
+ ---
37
+
38
+ ## Nội dung
39
+
40
+ | File | Split | Số dòng | Định dạng | Mô tả |
41
+ |---|---|---|---|---|
42
+ | `train.jsonl` | train | **9,994** | JSONL | mỗi dòng = 1 query + 1 positive + tối đa 23 hard negative |
43
+ | `eval.json` | eval | **296** | JSON array | query + 1 positive (dedup theo `aid` còn **219** query unique) |
44
+
45
+ ### `train.jsonl` — schema mỗi dòng
46
+
47
+ ```json
48
+ {
49
+ "id": "d9189b1cc63747b4e879984e5a72d190",
50
+ "question": "Những trường hợp nào không tiếp tục sử dụng đối với công trình hết thời hạn...",
51
+ "positive": {"id": "06/2021/nđ-cp|41", "text": "Điều 41. Xử lý đối với công trình..."},
52
+ "negatives": ["Điều 19. Vi phạm quy định về bảo hành...", "..."],
53
+ "_source": "zalo",
54
+ "_neg_source": "teacher_aiteamvn_v3"
55
+ }
56
+ ```
57
+
58
+ - `positive` là **điều luật đúng** (index 0 khi train listwise).
59
+ - `negatives` là **hard negative** mine bằng dense retriever + teacher reranker (23/query cho
60
+ phần lớn mẫu).
61
+ - Loss listwise: positive ở vị trí 0, negatives là các lựa chọn còn lại (InfoNCE, không dùng
62
+ in-batch negative).
63
+
64
+ ### `eval.json` — schema mỗi record
65
+
66
+ ```json
67
+ {"id": "11075", "question": "Người đi xe máy đâm vào xe ôtô...", "positive": {"id": 56886, "text": "Luật quy định về giao thông..."}}
68
+ ```
69
+
70
+ Query eval **chỉ có ground-truth positive**; ứng viên để rerank được sinh riêng bằng bi-encoder
71
+ (top-100), xem repo GitHub.
72
+
73
+ ---
74
+
75
+ ## Thống kê `train.jsonl`
76
+
77
+ | Thuộc tính | Giá trị |
78
+ |---|---|
79
+ | Tổng số mẫu | 9,994 |
80
+ | Nguồn (`_source`) | `synthetic` 5,530 · `zalo` 2,477 · `vlsp` 1,987 |
81
+ | Nguồn negative (`_neg_source`) | `teacher_aiteamvn_v3` (toàn bộ) |
82
+ | Số negative/mẫu | 23 (9,051 mẫu) · 19 (59) · các mức thấp hơn cho phần còn lại |
83
+
84
+ ## Cách nạp
85
+
86
+ ```python
87
+ from datasets import load_dataset
88
+
89
+ train = load_dataset("hoailebads/VLSP-Legal-Reranker-Train", "train", split="train")
90
+ eval_ = load_dataset("hoailebads/VLSP-Legal-Reranker-Train", "eval", split="train")
91
+ print(train[0]["question"], train[0]["positive"]["id"], len(train[0]["negatives"]))
92
+ ```
93
+
94
+ ## Giới hạn
95
+
96
+ - Miền hẹp: **điều luật tiếng Việt** (VLSP + Zalo legal). Không dùng cho miền khác mà không re-mine
97
+ hard negative.
98
+ - 55% mẫu train là `synthetic` (câu hỏi sinh tự động) — xem thảo luận về overfit/nhãn trong
99
+ [`results/`](https://github.com/hoaileba/Qwen-Retrieval-Tuning/tree/main/results) của repo.
100
+ - Hard negative là **teacher-mined**, có thể chứa false negative (điều luật thực ra liên quan).
101
+
102
+ ## License
103
+
104
+ Apache-2.0. Văn bản luật gốc thuộc phạm vi công (VLSP / Zalo legal corpus).
eval.json ADDED
The diff for this file is too large to render. See raw diff
 
train.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7364bad4edd336d6e983fef86cf09892626b5e6442611236ee015336b4aefaf5
3
+ size 541983610