Datasets:
Upload folder using huggingface_hub
Browse files- .gitattributes +5 -4
- README.md +109 -0
- child_nodes.parquet +3 -0
- dedup/Readme.md +17 -0
- dedup/data_remapped/sft_tvpl +3 -0
- dedup/data_remapped/tvpl_dataset +3 -0
- dedup/data_remapped/zalo_legal_corpus +3 -0
- dedup/merged_corpus/filtered_corpus.parquet +3 -0
- dedup/merged_corpus/reindexed_corpus.parquet +3 -0
- dedup/tvpl_sft_dedup_and_resplit/DONOTUSE_tvpl_sft_reindexedbyquestion_notfiltered. +3 -0
- dedup/tvpl_sft_dedup_and_resplit/test.parquet +3 -0
- dedup/tvpl_sft_dedup_and_resplit/train.parquet +3 -0
- dedup/tvpl_sft_resplit/test.parquet +3 -0
- dedup/tvpl_sft_resplit/train.parquet +3 -0
- dedup/withtvplparent_corpus/withtvplparent_corpus_filtered.parquet +3 -0
- parent_nodes.parquet +3 -0
- structured_data_doc.parquet +3 -0
.gitattributes
CHANGED
|
@@ -9,7 +9,6 @@
|
|
| 9 |
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
*.lz4 filter=lfs diff=lfs merge=lfs -text
|
| 12 |
-
*.mds filter=lfs diff=lfs merge=lfs -text
|
| 13 |
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 14 |
*.model filter=lfs diff=lfs merge=lfs -text
|
| 15 |
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
|
@@ -54,6 +53,8 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 54 |
*.jpg filter=lfs diff=lfs merge=lfs -text
|
| 55 |
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
| 56 |
*.webp filter=lfs diff=lfs merge=lfs -text
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
|
|
|
|
|
|
|
|
| 9 |
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
*.lz4 filter=lfs diff=lfs merge=lfs -text
|
|
|
|
| 12 |
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 13 |
*.model filter=lfs diff=lfs merge=lfs -text
|
| 14 |
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
|
|
|
| 53 |
*.jpg filter=lfs diff=lfs merge=lfs -text
|
| 54 |
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
| 55 |
*.webp filter=lfs diff=lfs merge=lfs -text
|
| 56 |
+
tvpl_dataset_filtered filter=lfs diff=lfs merge=lfs -text
|
| 57 |
+
dedup/data_remapped/sft_tvpl filter=lfs diff=lfs merge=lfs -text
|
| 58 |
+
dedup/data_remapped/tvpl_dataset filter=lfs diff=lfs merge=lfs -text
|
| 59 |
+
dedup/data_remapped/zalo_legal_corpus filter=lfs diff=lfs merge=lfs -text
|
| 60 |
+
dedup/tvpl_sft_dedup_and_resplit/DONOTUSE_tvpl_sft_reindexedbyquestion_notfiltered. filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
task_categories:
|
| 4 |
+
- text-generation
|
| 5 |
+
language:
|
| 6 |
+
- vi
|
| 7 |
+
tags:
|
| 8 |
+
- legal
|
| 9 |
+
size_categories:
|
| 10 |
+
- 1B<n<10B
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# TVPL (thuvienphapluat.vn)
|
| 14 |
+
|
| 15 |
+
2. `structured_data_doc.parquet`: preprocessed version from only needed doc from tvpl . Please read by Datasets library
|
| 16 |
+
3. `parent_nodes.parquet`: parent nodes from [1] by chunking with `SentenceSplitter, chunk_overlap=0, chunk_size=800, tokenizer="Viet-Mistral/Vistral-7B-Chat"`
|
| 17 |
+
4. `child_nodes.parquet`: child nodes from [2] by chunking with `SentenceSplitter, chunk_overlap=30, chunk_size=190` and using Word Segmentation, vietnamese-bi-encoder
|
| 18 |
+
|
| 19 |
+
# Dedup
|
| 20 |
+
|
| 21 |
+
WARNING: IF YOU TRAIN PLEASE ONLY CONSIDER `dedup/filtered_corpus.parquet` and `dedup/newtraintestdivide/filtered_corpus.parquet`
|
| 22 |
+
|
| 23 |
+
1. `filtered_corpus.parquet`: Merged dataset [SFT-Law]+[TVPL-structured]+[Zalo-corpus]. Clustered and then filtered. Items with the longest text are kept.
|
| 24 |
+
- `text`: str
|
| 25 |
+
- `oid`: Item's unique ID among 3 merged dataset, int
|
| 26 |
+
- `__cluster__`: int
|
| 27 |
+
- `dataset`: Original dataset where the item is extracted from, str
|
| 28 |
+
- `__cluster_member__`: oid of cluster members from the original 3.
|
| 29 |
+
|
| 30 |
+
eg:
|
| 31 |
+
|
| 32 |
+
```
|
| 33 |
+
{
|
| 34 |
+
"text": "Thông tư này hướng dẫn tuần...",
|
| 35 |
+
"dataset": "zalo_legal_corpus",
|
| 36 |
+
"oid": 0,
|
| 37 |
+
"__cluster__": 0
|
| 38 |
+
}
|
| 39 |
+
```
|
| 40 |
+
2. newtraintestdivide folder contains newly divided SFT_law with 10k tests. `oid` and `__cluster__` has the same meaning as in `filtered_corpus.parquet`.
|
| 41 |
+
|
| 42 |
+
3. `data_remapped/{file_name}.parquet`: data files taken from other repoes, added 2 fields: `oid` (Item's unique ID among 3 merged dataset, int) and `__cluster__` (Cluster ID, int).
|
| 43 |
+
- sft_test+sft_train taken from [SFT-Law]
|
| 44 |
+
```
|
| 45 |
+
{
|
| 46 |
+
"reference": [
|
| 47 |
+
"https://thuvienphapluat.vn/..."
|
| 48 |
+
],
|
| 49 |
+
"answer": "Sinh viên học nghệ thuật ca trù ....",
|
| 50 |
+
"question": "Sinh viên học nghệ thuật ca trù tại ...?",
|
| 51 |
+
"domain": ["Tài chính nhà nước"],
|
| 52 |
+
"text": "Căn cứ tại khoản 1 Điều 3 T....",
|
| 53 |
+
"oid": 61425,
|
| 54 |
+
"__cluster__": 219110
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
```
|
| 58 |
+
|
| 59 |
+
- tvpl_dataset taken from [TVPL-structured] (only the `structured_data_doc.parquet` file)
|
| 60 |
+
|
| 61 |
+
```
|
| 62 |
+
{
|
| 63 |
+
"meta_data": {
|
| 64 |
+
"base": "Căn cứ Luật Tổ chức Chính phủ ngày 19 tháng 6 năm ...",
|
| 65 |
+
"content": "QUY ĐỊNH XỬ PHẠT VI PHẠM HÀNH CHÍNH...",
|
| 66 |
+
"date": "31/12/2021",
|
| 67 |
+
"department": "Chính phủ",
|
| 68 |
+
"doc_type": "Nghị định",
|
| 69 |
+
"file_name": "Decree_No._139_2021_ND-CP_dated_December_31,_2021_.json",
|
| 70 |
+
"id_doc": "139/2021/ND-CP",
|
| 71 |
+
"location": "Hà Nội",
|
| 72 |
+
"title": "Decree No. 139/2021/ND-CP dated December 31, 2021 on Administrative penalties for inland waterway navigation violations",
|
| 73 |
+
"updated": 1710417820
|
| 74 |
+
},
|
| 75 |
+
"child_data": [
|
| 76 |
+
{
|
| 77 |
+
"__cluster__": 253403,
|
| 78 |
+
"header": [
|
| 79 |
+
"Decree No. 139/2021/ND-CP dated...",
|
| 80 |
+
"Chương I. NHỮNG QUY ĐỊNH CHUNG"
|
| 81 |
+
],
|
| 82 |
+
"len_tokenizer": 157,
|
| 83 |
+
"lower_segmented_text": "điều 1 . phạm_vi điều_chỉnh...",
|
| 84 |
+
"oid": 232323,
|
| 85 |
+
"pointer_link": ["Chương I", "Điều 1"],
|
| 86 |
+
"text": "Điều 1. Phạm vi điều chỉnh\n1. ..."
|
| 87 |
+
}
|
| 88 |
+
]
|
| 89 |
+
}
|
| 90 |
+
```
|
| 91 |
+
|
| 92 |
+
- zalo_legal_corpus from [Zalo-corpus] (only the ` legal_corpus.json` file). `law_id` is append to articles.
|
| 93 |
+
|
| 94 |
+
```
|
| 95 |
+
{
|
| 96 |
+
"article_id": "1",
|
| 97 |
+
"text": "Thông tư này hướng dẫn tuần tra,...",
|
| 98 |
+
"title": "Điều 1. Phạm vi áp dụng",
|
| 99 |
+
"law_id": "01/2009/tt-bnn",
|
| 100 |
+
"oid": 0,
|
| 101 |
+
"__cluster__": 0
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
```
|
| 105 |
+
Please refer to the corresponding repositories for document on the data.
|
| 106 |
+
|
| 107 |
+
[SFT-Law]: https://huggingface.co/datasets/bkai-foundation-models/SFT-Law
|
| 108 |
+
[TVPL-structured]:https://huggingface.co/datasets/bkai-foundation-models/TVPL/blob/main/structured_data_doc.parquet
|
| 109 |
+
[Zalo-corpus]: https://huggingface.co/datasets/bkai-foundation-models/zalo_legal_2021/blob/main/original/legal_corpus.json
|
child_nodes.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:458671dbee858872bb8d8d88633e09db36535dbad032451b40d199bf0968a85b
|
| 3 |
+
size 355597148
|
dedup/Readme.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[Update 18/03/2024: an assessment file at lower threshold added in the eval folder]
|
| 2 |
+
1. `merged_corpus/filtered_corpus.parquet`: Merged corpus with contexts from [SFT-Law]+[TVPL-structured]+[Zalo-corpus]. Clustered and then filtered. The filtering process prefers candidates from SFT and the longer ones. `merged/reindexed_corpus.parquet` contains the clustered (without filtering) version. Short contexts are thrown away from these 2 files.
|
| 3 |
+
|
| 4 |
+
2. `data_remapped/{file_name}`: data files taken from other repoes, added 2 fields: `oid` (Item's unique ID among 3 merged dataset, int) and `__cluster__` (Cluster ID, int, the index of the cluster that is assigned to the item based on the `text` column). File format is `parquet`.
|
| 5 |
+
|
| 6 |
+
EXCEPTION: In `sft_tvpl`, context are stored in list.
|
| 7 |
+
Hence, `__context_cluster__` and `contextoid` are the list equivalent of `__cluster__` and `oid`.
|
| 8 |
+
|
| 9 |
+
Please refer to the corresponding repositories for document on the data.
|
| 10 |
+
|
| 11 |
+
3. `tvpl_sft_resplit`: `tpvl_sft` reindexed by question and divided into train&test set (Duplicating candidates in a cluster are put in text or train set but not both at the same time). Test set has the MIN size of 10000. `__context_cluster__` is a mapping of `context` to the corpus.
|
| 12 |
+
|
| 13 |
+
<!-- [tpvl_sft]: Ask pham son -->
|
| 14 |
+
|
| 15 |
+
[TVPL-structured]:https://huggingface.co/datasets/bkai-foundation-models/TVPL/blob/main/structured_data_doc.parquet
|
| 16 |
+
|
| 17 |
+
[Zalo-corpus]: https://huggingface.co/datasets/bkai-foundation-models/zalo_legal_2021/blob/main/original/legal_corpus.json
|
dedup/data_remapped/sft_tvpl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:40f10da252e5c304997eb55824ed68dad861abd799c0b97e6476ed24a30f0882
|
| 3 |
+
size 292008748
|
dedup/data_remapped/tvpl_dataset
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a586270cbb6d71f9ea1f837ffe6de46f83f612a236cfa7c3a73af60bf792fb53
|
| 3 |
+
size 188955250
|
dedup/data_remapped/zalo_legal_corpus
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:11dab48ba17152e7635fdc163a96318ea3a9c5ebe73bfbc944c206150aa7bd21
|
| 3 |
+
size 34462728
|
dedup/merged_corpus/filtered_corpus.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f5309782801141e3d9c4b1c454bd00d1cb3ab27f58a8ca1a1ff7ff4fbbe93b6b
|
| 3 |
+
size 123638447
|
dedup/merged_corpus/reindexed_corpus.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e41c3fd9e6cf823302622835502be55164a7ea0b18edf050779c22a02928afe8
|
| 3 |
+
size 150583431
|
dedup/tvpl_sft_dedup_and_resplit/DONOTUSE_tvpl_sft_reindexedbyquestion_notfiltered.
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8d22d88780fe1f3e1c8863f9ff40fb1114e468067edb8d20d5b933740313bf37
|
| 3 |
+
size 361358782
|
dedup/tvpl_sft_dedup_and_resplit/test.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:84c76e94ab368ea287045727e84fbb8376e4e8b576eb6941812d52336acff70b
|
| 3 |
+
size 24082622
|
dedup/tvpl_sft_dedup_and_resplit/train.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:039918348e220d4e7c9f93add5fde6caf53054a636206ebccf116d0b109e3975
|
| 3 |
+
size 406983617
|
dedup/tvpl_sft_resplit/test.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f455ce53758099a5096b14f5feba578bd28bcfb54f2b55f5cb463ade642cd93f
|
| 3 |
+
size 16845859
|
dedup/tvpl_sft_resplit/train.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e83becc4e7f088cd4c2bc26683a01eee241b55a50bdb54158e9db0b45dd88463
|
| 3 |
+
size 262701615
|
dedup/withtvplparent_corpus/withtvplparent_corpus_filtered.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a269599cb763aae69a0a7320a019c611769ccb4b34bde7bd8f3c569cd8611de6
|
| 3 |
+
size 131414669
|
parent_nodes.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:38b964564707e9d66093b0a4e5fdeaec8c6b7c1a400782f4fd2ccd5d8d4cc849
|
| 3 |
+
size 148522671
|
structured_data_doc.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:591c64e6c04a201a794096a88381617cb16070f03ef372045256f2bb8778d0b8
|
| 3 |
+
size 186781959
|