gradientflow commited on
Commit
411df81
·
verified ·
1 Parent(s): 0e6eaeb

add dataset card

Browse files
Files changed (1) hide show
  1. README.md +113 -53
README.md CHANGED
@@ -1,4 +1,13 @@
1
  ---
 
 
 
 
 
 
 
 
 
2
  dataset_info:
3
  features:
4
  - name: id
@@ -6,60 +15,111 @@ dataset_info:
6
  - name: doc_id
7
  dtype: string
8
  - name: tokens
9
- list: string
10
  - name: ner_tags
11
- list:
12
  class_label:
13
  names:
14
- '0': B-ADR
15
- '1': B-COM
16
- '2': B-CONTACT
17
- '3': B-COURT
18
- '4': B-DATE
19
- '5': B-IDCOM
20
- '6': B-IDOTH
21
- '7': B-IDPER
22
- '8': B-IDTAX
23
- '9': B-INST
24
- '10': B-LAW
25
- '11': B-MISC
26
- '12': B-MONEY
27
- '13': B-NUMACC
28
- '14': B-NUMCAR
29
- '15': B-NUMDOC
30
- '16': B-NUMPLOT
31
- '17': B-ORGOTH
32
- '18': B-PER
33
- '19': B-REF
34
- '20': B-TOP
35
- '21': I-ADR
36
- '22': I-COM
37
- '23': I-COURT
38
- '24': I-DATE
39
- '25': I-INST
40
- '26': I-LAW
41
- '27': I-MISC
42
- '28': I-MONEY
43
- '29': I-NUMCAR
44
- '30': I-ORGOTH
45
- '31': I-PER
46
- '32': I-REF
47
- '33': I-TOP
48
- '34': O
49
- splits:
50
- - name: train
51
- num_bytes: 1538867
52
- num_examples: 3876
53
- - name: test
54
- num_bytes: 377209
55
- num_examples: 886
56
- download_size: 366051
57
- dataset_size: 1916076
58
- configs:
59
- - config_name: default
60
- data_files:
61
- - split: train
62
- path: data/train-*
63
- - split: test
64
- path: data/test-*
65
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ language:
3
+ - sr
4
+ license: cc-by-4.0
5
+ task_categories:
6
+ - token-classification
7
+ tags:
8
+ - ner
9
+ - legal
10
+ - conllu
11
  dataset_info:
12
  features:
13
  - name: id
 
15
  - name: doc_id
16
  dtype: string
17
  - name: tokens
18
+ sequence: string
19
  - name: ner_tags
20
+ sequence:
21
  class_label:
22
  names:
23
+ 0: B-ADR
24
+ 1: B-COM
25
+ 2: B-CONTACT
26
+ 3: B-COURT
27
+ 4: B-DATE
28
+ 5: B-IDCOM
29
+ 6: B-IDOTH
30
+ 7: B-IDPER
31
+ 8: B-IDTAX
32
+ 9: B-INST
33
+ 10: B-LAW
34
+ 11: B-MISC
35
+ 12: B-MONEY
36
+ 13: B-NUMACC
37
+ 14: B-NUMCAR
38
+ 15: B-NUMDOC
39
+ 16: B-NUMPLOT
40
+ 17: B-ORGOTH
41
+ 18: B-PER
42
+ 19: B-REF
43
+ 20: B-TOP
44
+ 21: I-ADR
45
+ 22: I-COM
46
+ 23: I-COURT
47
+ 24: I-DATE
48
+ 25: I-INST
49
+ 26: I-LAW
50
+ 27: I-MISC
51
+ 28: I-MONEY
52
+ 29: I-NUMCAR
53
+ 30: I-ORGOTH
54
+ 31: I-PER
55
+ 32: I-REF
56
+ 33: I-TOP
57
+ 34: O
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  ---
59
+
60
+ # Dataset Card for Legal NER dataset
61
+
62
+ ## Dataset Description
63
+
64
+ This dataset is based on **COMtext.SR.legal**, the first corpus of legal-administrative texts in Serbian that has been manually annotated for **Named Entities (NER)** according to the IOB2 standard.
65
+
66
+ The corpus was created during 2023. The selection of representative legal texts of various types (contracts, judgments, conclusions, decisions, requests, appeals, rulebooks, laws, decrees, statutes, etc.) was conducted with the assistance of the lawyers.
67
+
68
+ The corpus includes **79 documents**, comprising **4,762 sentences** or **105,470 tokens**.
69
+
70
+ ## NER Statistics
71
+
72
+ Out of a total of 105,470 tokens, **14,113 (13.4%)** belong to named entities.
73
+
74
+ Systematization and frequency of entity types:
75
+
76
+ | Category | Subcategory | Tag | Count / Percentage | Avg. Length in Tokens |
77
+ | :--- | :--- | :--- | :--- | :--- |
78
+ | **Persons** | | **PER** | 694 (19.2%) | 1.89 |
79
+ | **Locations** | Toponyms | **TOP** | 294 (8.1%) | 1.24 |
80
+ | | Addresses | **ADR** | 203 (5.6%) | 6.96 |
81
+ | **Organizations** | Courts | **COURT** | 148 (4.1%) | 3.59 |
82
+ | | Institutions | **INST** | 395 (10.9%) | 2.75 |
83
+ | | Companies | **COM** | 337 (9.3%) | 2.28 |
84
+ | | Other Organizations | **ORGOTH** | 97 (2.7%) | 2.27 |
85
+ | **Legal Docs** | General Legal Acts | **LAW** | 395 (10.9%) | 9.17 |
86
+ | | Individual Legal Acts | **REF** | 227 (6.3%) | 10.52 |
87
+ | **Sensitive Data** | Personal ID (JMBG) | **IDPER** | 21 (0.6%) | 1.0 |
88
+ | | Company Reg. No. | **IDCOM** | 33 (0.9%) | 1.0 |
89
+ | | Tax ID (PIB) | **IDTAX** | 16 (0.4%) | 1.0 |
90
+ | | Bank Account No. | **NUMACC** | 6 (0.2%) | 1.0 |
91
+ | | ID Card/Passport No. | **NUMDOC** | 9 (0.2%) | 1.0 |
92
+ | | Car Plate/Chassis | **NUMCAR** | 6 (0.2%) | 2.67 |
93
+ | | Cadastral Plot No. | **NUMPLOT** | 67 (1.9%) | 1.0 |
94
+ | | Other IDs | **IDOTH** | 18 (0.5%) | 1.0 |
95
+ | | Contact (Email, Phone) | **CONTACT** | 8 (0.2%) | 1.0 |
96
+ | **Time/Money** | Dates | **DATE** | 352 (9.7%) | 4.1 |
97
+ | | Monetary Amounts | **MONEY** | 246 (6.8%) | 2.32 |
98
+ | **Other** | | **MISC** | 39 (1.1%) | 5.0 |
99
+
100
+ ## Structure & Usage
101
+
102
+ The data has been converted from CoNLL-U format to Hugging Face columnar format.
103
+
104
+ ### Train/Test Split
105
+
106
+ The split into training and testing sets was performed using the **GroupShuffleSplit** strategy on the `doc_id` attribute. This guarantees that sentences from the same document do not appear simultaneously in both sets, preventing data leakage and ensuring realistic model evaluation.
107
+
108
+ ### Usage Example
109
+
110
+ ```python
111
+ from datasets import load_dataset
112
+
113
+ # Load the dataset
114
+ dataset = load_dataset("gradientflow/legal-ner")
115
+
116
+ # Display the first example from the train set
117
+ print(dataset['train'][0])
118
+
119
+ # Display all available tags
120
+ print(dataset['train'].features['ner_tags'].feature.names)
121
+ ```
122
+
123
+ ## Source Data
124
+ The original annotated corpus is available on GitHub:
125
+ * [COMtext.SR](https://github.com/ICEF-NLP/COMtext.SR/tree/main/data)