temsa commited on
Commit
f9ecbf3
·
verified ·
1 Parent(s): 89936ba

Upload IrishCorePII v2 RC1 full checkpoint

Browse files
.gitattributes CHANGED
@@ -1,35 +1,2 @@
1
- *.7z filter=lfs diff=lfs merge=lfs -text
2
- *.arrow filter=lfs diff=lfs merge=lfs -text
3
- *.bin filter=lfs diff=lfs merge=lfs -text
4
- *.bz2 filter=lfs diff=lfs merge=lfs -text
5
- *.ckpt filter=lfs diff=lfs merge=lfs -text
6
- *.ftz filter=lfs diff=lfs merge=lfs -text
7
- *.gz filter=lfs diff=lfs merge=lfs -text
8
- *.h5 filter=lfs diff=lfs merge=lfs -text
9
- *.joblib filter=lfs diff=lfs merge=lfs -text
10
- *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
- *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
- *.model filter=lfs diff=lfs merge=lfs -text
13
- *.msgpack filter=lfs diff=lfs merge=lfs -text
14
- *.npy filter=lfs diff=lfs merge=lfs -text
15
- *.npz filter=lfs diff=lfs merge=lfs -text
16
- *.onnx filter=lfs diff=lfs merge=lfs -text
17
- *.ot filter=lfs diff=lfs merge=lfs -text
18
- *.parquet filter=lfs diff=lfs merge=lfs -text
19
- *.pb filter=lfs diff=lfs merge=lfs -text
20
- *.pickle filter=lfs diff=lfs merge=lfs -text
21
- *.pkl filter=lfs diff=lfs merge=lfs -text
22
- *.pt filter=lfs diff=lfs merge=lfs -text
23
- *.pth filter=lfs diff=lfs merge=lfs -text
24
- *.rar filter=lfs diff=lfs merge=lfs -text
25
  *.safetensors filter=lfs diff=lfs merge=lfs -text
26
- saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
- *.tar.* filter=lfs diff=lfs merge=lfs -text
28
- *.tar filter=lfs diff=lfs merge=lfs -text
29
- *.tflite filter=lfs diff=lfs merge=lfs -text
30
- *.tgz filter=lfs diff=lfs merge=lfs -text
31
- *.wasm filter=lfs diff=lfs merge=lfs -text
32
- *.xz filter=lfs diff=lfs merge=lfs -text
33
- *.zip filter=lfs diff=lfs merge=lfs -text
34
- *.zst filter=lfs diff=lfs merge=lfs -text
35
- *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  *.safetensors filter=lfs diff=lfs merge=lfs -text
2
+ *.bin filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
.gitignore ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ __pycache__/
2
+ .venv/
3
+ *.pyc
LICENSE ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
10
+
11
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
12
+
13
+ "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
14
+
15
+ "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
16
+
17
+ "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
18
+
19
+ "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
20
+
21
+ "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
22
+
23
+ "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
24
+
25
+ "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
26
+
27
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
28
+
29
+ 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
30
+
31
+ 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
32
+
33
+ 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
34
+
35
+ (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
36
+
37
+ (b) You must cause any modified files to carry prominent notices stating that You changed the files; and
38
+
39
+ (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
40
+
41
+ (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
42
+
43
+ You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
44
+
45
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
46
+
47
+ 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
48
+
49
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
50
+
51
+ 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
52
+
53
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
54
+
55
+ END OF TERMS AND CONDITIONS
56
+
57
+ APPENDIX: How to apply the Apache License to your work.
58
+
59
+ To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
60
+
61
+ Copyright [yyyy] [name of copyright owner]
62
+
63
+ Licensed under the Apache License, Version 2.0 (the "License");
64
+ you may not use this file except in compliance with the License.
65
+ You may obtain a copy of the License at
66
+
67
+ http://www.apache.org/licenses/LICENSE-2.0
68
+
69
+ Unless required by applicable law or agreed to in writing, software
70
+ distributed under the License is distributed on an "AS IS" BASIS,
71
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
72
+ See the License for the specific language governing permissions and
73
+ limitations under the License.
NOTICE ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ This release is derived from OpenMed/OpenMed-PII-mLiteClinical-Base-135M-v1 (Apache-2.0).
2
+
3
+ Additional training/evaluation data attribution:
4
+ - joelniklaus/mapa (CC-BY-4.0)
5
+ - gretelai/synthetic_pii_finance_multilingual (Apache-2.0)
6
+ - synthetic Irish PPSN/Eircode/PII data created in this workspace (Apache-2.0)
7
+
8
+ This repo distributes model artifacts and synthetic benchmark summaries. It does not redistribute third-party dataset rows.
README.md ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ - ga
5
+ license: apache-2.0
6
+ library_name: transformers
7
+ pipeline_tag: token-classification
8
+ tags:
9
+ - pii
10
+ - token-classification
11
+ - de-identification
12
+ - ireland
13
+ - irish
14
+ - gaelic
15
+ - ppsn
16
+ - eircode
17
+ - phone-number
18
+ - iban
19
+ - passport
20
+ - release-candidate
21
+ base_model:
22
+ - OpenMed/OpenMed-PII-mLiteClinical-Base-135M-v1
23
+ ---
24
+
25
+ # temsa/OpenMed-mLiteClinical-IrishCorePII-135M-v2-rc1
26
+
27
+ QA release candidate for Irish core PII detection with OpenMed mLiteClinical.
28
+
29
+ This RC is a full merged checkpoint built from the `v15` weak-context PPSN recovery adapter. It is the first raw-model candidate in this line that closes the exact reported PPSN weak-context misses:
30
+
31
+ - `1234567T` at sentence start
32
+ - `... provide my number 1234567T ...`
33
+ - lowercase `1234567tw` in weaker English support context
34
+
35
+ ## Coverage
36
+
37
+ - `PPSN`
38
+ - `account_number`
39
+ - `bank_routing_number`
40
+ - `credit_debit_card`
41
+ - `PASSPORT_NUMBER`
42
+ - `postcode`
43
+ - `phone_number`
44
+ - `email`
45
+ - `first_name`
46
+ - `last_name`
47
+ - `swift_bic`
48
+
49
+ ## Recommended Inference
50
+
51
+ Use the bundled `inference_mask.py` with split thresholds:
52
+
53
+ ```bash
54
+ python3 inference_mask.py \
55
+ --model temsa/OpenMed-mLiteClinical-IrishCorePII-135M-v2-rc1 \
56
+ --ppsn-min-score 0.5 \
57
+ --other-min-score 0.4 \
58
+ --text "I was told to provide my number 1234567T when applying, what do I do next?" \
59
+ --json
60
+ ```
61
+
62
+ ## PPSN-Only Comparison
63
+
64
+ | Model | User Raw | Core PPSN | Edge PPSN | QA v8 PPSN | Irish Large PPSN |
65
+ |---|---:|---:|---:|---:|---:|
66
+ | Current public | 0.8000 | 0.0800 | 0.4211 | 0.7385 | 0.8980 |
67
+ | Previous internal best (`v14`) | 0.5000 | 0.9091 | 0.5000 | 0.7188 | 0.9384 |
68
+ | This RC (`v15`) | 1.0000 | 0.8571 | 0.8571 | 0.7353 | 0.9403 |
69
+
70
+ ## Main Tradeoff
71
+
72
+ Relative to `v14`, this RC materially improves weak-context PPSN recall, but gives up a small amount of broader Irish-core multilabel quality.
73
+
74
+ At the recommended thresholds:
75
+
76
+ - Irish core overall F1: `0.9487`
77
+ - Irish edge overall F1: `0.8205`
78
+ - phone_number core F1: `0.9167`
79
+ - postcode core F1: `0.7500`
80
+
81
+ So this RC is the right choice if the blocking issue is weak-context PPSN reliability.
82
+
83
+ ## Included Files
84
+
85
+ - full `transformers` checkpoint in the repo root
86
+ - `inference_mask.py`
87
+ - `qa_config.json`
88
+ - `training_sources.json`
89
+ - clean benchmark summaries in `eval/`
90
+
91
+ ## License And Attribution
92
+
93
+ - release license: Apache-2.0
94
+ - base model: `OpenMed/OpenMed-PII-mLiteClinical-Base-135M-v1`
95
+ - upstream attributed data: `joelniklaus/mapa`, `gretelai/synthetic_pii_finance_multilingual`
96
+ - synthetic Irish training data created in this workspace
97
+
98
+ See `NOTICE` for attribution details.
config.json ADDED
@@ -0,0 +1,248 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "activation": "gelu",
3
+ "architectures": [
4
+ "DistilBertForTokenClassification"
5
+ ],
6
+ "attention_dropout": 0.1,
7
+ "dim": 768,
8
+ "dropout": 0.1,
9
+ "dtype": "float32",
10
+ "hidden_dim": 3072,
11
+ "id2label": {
12
+ "0": "O",
13
+ "1": "B-account_number",
14
+ "2": "B-age",
15
+ "3": "B-api_key",
16
+ "4": "B-bank_routing_number",
17
+ "5": "B-biometric_identifier",
18
+ "6": "B-blood_type",
19
+ "7": "B-certificate_license_number",
20
+ "8": "B-city",
21
+ "9": "B-company_name",
22
+ "10": "B-coordinate",
23
+ "11": "B-country",
24
+ "12": "B-county",
25
+ "13": "B-credit_debit_card",
26
+ "14": "B-customer_id",
27
+ "15": "B-cvv",
28
+ "16": "B-date",
29
+ "17": "B-date_of_birth",
30
+ "18": "B-date_time",
31
+ "19": "B-device_identifier",
32
+ "20": "B-education_level",
33
+ "21": "B-email",
34
+ "22": "B-employee_id",
35
+ "23": "B-employment_status",
36
+ "24": "B-fax_number",
37
+ "25": "B-first_name",
38
+ "26": "B-gender",
39
+ "27": "B-health_plan_beneficiary_number",
40
+ "28": "B-http_cookie",
41
+ "29": "B-ipv4",
42
+ "30": "B-ipv6",
43
+ "31": "B-language",
44
+ "32": "B-last_name",
45
+ "33": "B-license_plate",
46
+ "34": "B-mac_address",
47
+ "35": "B-medical_record_number",
48
+ "36": "B-occupation",
49
+ "37": "B-password",
50
+ "38": "B-phone_number",
51
+ "39": "B-pin",
52
+ "40": "B-political_view",
53
+ "41": "B-postcode",
54
+ "42": "B-race_ethnicity",
55
+ "43": "B-religious_belief",
56
+ "44": "B-sexuality",
57
+ "45": "B-ssn",
58
+ "46": "B-state",
59
+ "47": "B-street_address",
60
+ "48": "B-swift_bic",
61
+ "49": "B-tax_id",
62
+ "50": "B-time",
63
+ "51": "B-unique_id",
64
+ "52": "B-url",
65
+ "53": "B-user_name",
66
+ "54": "B-vehicle_identifier",
67
+ "55": "I-account_number",
68
+ "56": "I-api_key",
69
+ "57": "I-biometric_identifier",
70
+ "58": "I-blood_type",
71
+ "59": "I-certificate_license_number",
72
+ "60": "I-city",
73
+ "61": "I-company_name",
74
+ "62": "I-coordinate",
75
+ "63": "I-country",
76
+ "64": "I-county",
77
+ "65": "I-credit_debit_card",
78
+ "66": "I-customer_id",
79
+ "67": "I-date",
80
+ "68": "I-date_of_birth",
81
+ "69": "I-date_time",
82
+ "70": "I-device_identifier",
83
+ "71": "I-education_level",
84
+ "72": "I-email",
85
+ "73": "I-employee_id",
86
+ "74": "I-employment_status",
87
+ "75": "I-fax_number",
88
+ "76": "I-first_name",
89
+ "77": "I-gender",
90
+ "78": "I-health_plan_beneficiary_number",
91
+ "79": "I-http_cookie",
92
+ "80": "I-ipv4",
93
+ "81": "I-ipv6",
94
+ "82": "I-language",
95
+ "83": "I-last_name",
96
+ "84": "I-license_plate",
97
+ "85": "I-mac_address",
98
+ "86": "I-medical_record_number",
99
+ "87": "I-occupation",
100
+ "88": "I-password",
101
+ "89": "I-phone_number",
102
+ "90": "I-pin",
103
+ "91": "I-political_view",
104
+ "92": "I-postcode",
105
+ "93": "I-race_ethnicity",
106
+ "94": "I-religious_belief",
107
+ "95": "I-sexuality",
108
+ "96": "I-ssn",
109
+ "97": "I-state",
110
+ "98": "I-street_address",
111
+ "99": "I-swift_bic",
112
+ "100": "I-tax_id",
113
+ "101": "I-time",
114
+ "102": "I-unique_id",
115
+ "103": "I-url",
116
+ "104": "I-user_name",
117
+ "105": "I-vehicle_identifier",
118
+ "106": "B-PPSN",
119
+ "107": "I-PPSN",
120
+ "108": "B-PASSPORT_NUMBER",
121
+ "109": "I-PASSPORT_NUMBER"
122
+ },
123
+ "initializer_range": 0.02,
124
+ "label2id": {
125
+ "B-PASSPORT_NUMBER": 108,
126
+ "B-PPSN": 106,
127
+ "B-account_number": 1,
128
+ "B-age": 2,
129
+ "B-api_key": 3,
130
+ "B-bank_routing_number": 4,
131
+ "B-biometric_identifier": 5,
132
+ "B-blood_type": 6,
133
+ "B-certificate_license_number": 7,
134
+ "B-city": 8,
135
+ "B-company_name": 9,
136
+ "B-coordinate": 10,
137
+ "B-country": 11,
138
+ "B-county": 12,
139
+ "B-credit_debit_card": 13,
140
+ "B-customer_id": 14,
141
+ "B-cvv": 15,
142
+ "B-date": 16,
143
+ "B-date_of_birth": 17,
144
+ "B-date_time": 18,
145
+ "B-device_identifier": 19,
146
+ "B-education_level": 20,
147
+ "B-email": 21,
148
+ "B-employee_id": 22,
149
+ "B-employment_status": 23,
150
+ "B-fax_number": 24,
151
+ "B-first_name": 25,
152
+ "B-gender": 26,
153
+ "B-health_plan_beneficiary_number": 27,
154
+ "B-http_cookie": 28,
155
+ "B-ipv4": 29,
156
+ "B-ipv6": 30,
157
+ "B-language": 31,
158
+ "B-last_name": 32,
159
+ "B-license_plate": 33,
160
+ "B-mac_address": 34,
161
+ "B-medical_record_number": 35,
162
+ "B-occupation": 36,
163
+ "B-password": 37,
164
+ "B-phone_number": 38,
165
+ "B-pin": 39,
166
+ "B-political_view": 40,
167
+ "B-postcode": 41,
168
+ "B-race_ethnicity": 42,
169
+ "B-religious_belief": 43,
170
+ "B-sexuality": 44,
171
+ "B-ssn": 45,
172
+ "B-state": 46,
173
+ "B-street_address": 47,
174
+ "B-swift_bic": 48,
175
+ "B-tax_id": 49,
176
+ "B-time": 50,
177
+ "B-unique_id": 51,
178
+ "B-url": 52,
179
+ "B-user_name": 53,
180
+ "B-vehicle_identifier": 54,
181
+ "I-PASSPORT_NUMBER": 109,
182
+ "I-PPSN": 107,
183
+ "I-account_number": 55,
184
+ "I-api_key": 56,
185
+ "I-biometric_identifier": 57,
186
+ "I-blood_type": 58,
187
+ "I-certificate_license_number": 59,
188
+ "I-city": 60,
189
+ "I-company_name": 61,
190
+ "I-coordinate": 62,
191
+ "I-country": 63,
192
+ "I-county": 64,
193
+ "I-credit_debit_card": 65,
194
+ "I-customer_id": 66,
195
+ "I-date": 67,
196
+ "I-date_of_birth": 68,
197
+ "I-date_time": 69,
198
+ "I-device_identifier": 70,
199
+ "I-education_level": 71,
200
+ "I-email": 72,
201
+ "I-employee_id": 73,
202
+ "I-employment_status": 74,
203
+ "I-fax_number": 75,
204
+ "I-first_name": 76,
205
+ "I-gender": 77,
206
+ "I-health_plan_beneficiary_number": 78,
207
+ "I-http_cookie": 79,
208
+ "I-ipv4": 80,
209
+ "I-ipv6": 81,
210
+ "I-language": 82,
211
+ "I-last_name": 83,
212
+ "I-license_plate": 84,
213
+ "I-mac_address": 85,
214
+ "I-medical_record_number": 86,
215
+ "I-occupation": 87,
216
+ "I-password": 88,
217
+ "I-phone_number": 89,
218
+ "I-pin": 90,
219
+ "I-political_view": 91,
220
+ "I-postcode": 92,
221
+ "I-race_ethnicity": 93,
222
+ "I-religious_belief": 94,
223
+ "I-sexuality": 95,
224
+ "I-ssn": 96,
225
+ "I-state": 97,
226
+ "I-street_address": 98,
227
+ "I-swift_bic": 99,
228
+ "I-tax_id": 100,
229
+ "I-time": 101,
230
+ "I-unique_id": 102,
231
+ "I-url": 103,
232
+ "I-user_name": 104,
233
+ "I-vehicle_identifier": 105,
234
+ "O": 0
235
+ },
236
+ "max_position_embeddings": 512,
237
+ "model_type": "distilbert",
238
+ "n_heads": 12,
239
+ "n_layers": 6,
240
+ "output_past": true,
241
+ "pad_token_id": 0,
242
+ "qa_dropout": 0.1,
243
+ "seq_classif_dropout": 0.2,
244
+ "sinusoidal_pos_embds": false,
245
+ "tie_weights_": true,
246
+ "transformers_version": "4.57.6",
247
+ "vocab_size": 119547
248
+ }
eval/benchmark_summary.md ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Irish Core v15 Weak-Context PPSN Recovery
2
+
3
+ ## Candidate
4
+
5
+ - model: `models/openmed-mliteclinical-irish-core-v15_weakctx_lora_s160`
6
+ - base: `models/openmed-mliteclinical-irish-core-v14_userboost_cls_s50`
7
+ - training mix: `data/ppsn_recover_v4_mix`
8
+ - setup: LoRA recovery with `v14` as teacher, PPSN classifier rows left mutable, encoder updated through LoRA
9
+ - recommended operating point: `--min-score 0.4 --ppsn-min-score 0.5 --ppsn-decoder word_aligned`
10
+
11
+ ## Exact Weak-Context PPSN Result
12
+
13
+ At `--ppsn-min-score 0.5`, the exact previously failing user PPSN cases are fixed:
14
+
15
+ - `p1`: `1234567T - am I eligible for the housing grant?` -> detected
16
+ - `p2`: `I was told to provide my number 1234567T when applying, what do I do next?` -> detected
17
+ - `p3`: `My ppsn is 1234567tw and I need to know about carer's allowance` -> detected
18
+ - `n1`: `123456T ...` -> no PPSN prediction
19
+ - `n2`: `12345678T ...` -> no PPSN prediction
20
+ - `n3`: `0871234567 ...` -> no PPSN prediction
21
+ - `n4`: `2024T ...` -> no PPSN prediction
22
+
23
+ Reference: `reports/benchmark_user_v15_ppsnonly_t050.json`
24
+
25
+ ## PPSN-Only Comparison
26
+
27
+ | Model | Threshold | User Raw | Core PPSN | Edge PPSN | QA v8 PPSN | Irish Large PPSN |
28
+ |---|---:|---:|---:|---:|---:|---:|
29
+ | `release/OpenMed-mLiteClinical-IrishPPSN-135M-v1` | `0.40` | `0.8000` | `0.0800` | `0.4211` | `0.7385` | `0.8980` |
30
+ | `models/openmed-mliteclinical-irish-core-v14_userboost_cls_s50` | `0.35` | `0.5000` | `0.9091` | `0.5000` | `0.7188` | `0.9384` |
31
+ | `models/openmed-mliteclinical-irish-core-v15_weakctx_lora_s160` | `0.50` | `1.0000` | `0.8571` | `0.8571` | `0.7353` | `0.9403` |
32
+
33
+ Reference files:
34
+
35
+ - `reports/current_core_ppsnonly.json`
36
+ - `reports/current_edge_ppsnonly.json`
37
+ - `reports/v14_core_ppsnonly.json`
38
+ - `reports/v14_edge_ppsnonly.json`
39
+ - `reports/benchmark_user_v15_ppsnonly_t050.json`
40
+ - `reports/benchmark_core_ppsn_v15_ppsnonly_t050.json`
41
+ - `reports/benchmark_edge_ppsn_v15_ppsnonly_t050.json`
42
+ - `reports/benchmark_v8_v15_ppsnonly_t050.json`
43
+ - `reports/benchmark_large_v15_ppsnonly_t050.json`
44
+
45
+ ## Multilabel Tradeoff
46
+
47
+ At the recommended split thresholds (`--min-score 0.4 --ppsn-min-score 0.5`):
48
+
49
+ - Irish core overall F1: `0.9487`
50
+ - Irish edge overall F1: `0.8205`
51
+ - PPSN on `eval/irish_core_pii_v1.jsonl`: precision `0.75`, recall `1.0`, F1 `0.8571`
52
+ - PPSN on `eval/irish_ppsn_phone_edge_v1.jsonl`: precision `0.75`, recall `1.0`, F1 `0.8571`
53
+ - phone number on `eval/irish_core_pii_v1.jsonl`: F1 `0.9167`
54
+ - postcode on `eval/irish_core_pii_v1.jsonl`: F1 `0.7500`
55
+
56
+ Compared with `v14`, this is the tradeoff:
57
+
58
+ - better: weak-context PPSN recall and the reported `1234567T` / `1234567tw` failures
59
+ - better: edge PPSN F1 (`0.8571` vs `0.5000`)
60
+ - slightly worse: broad Irish-core multilabel F1 (`0.9487` vs `0.9677`)
61
+ - slightly worse: phone/postcode retention in the small Irish core suite
62
+
63
+ Reference files:
64
+
65
+ - `reports/benchmark_user_v15_m040_p050.json`
66
+ - `reports/benchmark_core_v15_m040_p050.json`
67
+ - `reports/benchmark_edge_v15_m040_p050.json`
68
+ - `reports/benchmark_v8_v15_m040_p050.json`
69
+ - `reports/benchmark_large_v15_m040_p050.json`
70
+ - `reports/tmp_core_v14_035.json`
71
+ - `reports/tmp_edge_v14_035.json`
72
+
73
+ ## Decision
74
+
75
+ `v15` is the first raw model in this line that cleanly fixes the exact weak-context PPSN misses.
76
+
77
+ It is a viable release candidate if weak-context PPSN reliability is now the priority.
78
+
79
+ It is not strictly dominant over `v14`, because `v14` still holds a small advantage on the broader Irish-core multilabel suite.
eval/multilabel_summary.json ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "recommended_thresholds": {
3
+ "ppsn_min_score": 0.5,
4
+ "other_min_score": 0.4
5
+ },
6
+ "current_public": {
7
+ "overall_core_f1": 0.515,
8
+ "overall_edge_f1": 0.2326
9
+ },
10
+ "previous_internal_best": {
11
+ "name": "v14",
12
+ "overall_core_f1": 0.9677419355,
13
+ "overall_edge_f1": 0.8823529412
14
+ },
15
+ "this_rc": {
16
+ "name": "v15",
17
+ "overall_core_f1": 0.9487179487,
18
+ "overall_edge_f1": 0.8205128205,
19
+ "phone_core_f1": 0.9166666667,
20
+ "postcode_core_f1": 0.75,
21
+ "ppsn_core_f1": 0.8571428571,
22
+ "ppsn_edge_f1": 0.8571428571
23
+ }
24
+ }
eval/ppsn_only_summary.json ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "recommended_threshold": 0.5,
3
+ "current_public": {
4
+ "repo": "temsa/OpenMed-mLiteClinical-IrishPPSN-135M-v1",
5
+ "user_raw_f1": 0.8,
6
+ "core_ppsn_f1": 0.08,
7
+ "edge_ppsn_f1": 0.4210526316,
8
+ "v8_ppsn_f1": 0.7384615385,
9
+ "irish_large_ppsn_f1": 0.898
10
+ },
11
+ "previous_internal_best": {
12
+ "name": "v14",
13
+ "user_raw_f1": 0.5,
14
+ "core_ppsn_f1": 0.9090909091,
15
+ "edge_ppsn_f1": 0.5,
16
+ "v8_ppsn_f1": 0.71875,
17
+ "irish_large_ppsn_f1": 0.9383658468
18
+ },
19
+ "this_rc": {
20
+ "name": "v15",
21
+ "user_raw_f1": 1.0,
22
+ "core_ppsn_f1": 0.8571428571,
23
+ "edge_ppsn_f1": 0.8571428571,
24
+ "v8_ppsn_f1": 0.7352941176,
25
+ "irish_large_ppsn_f1": 0.9403132496
26
+ }
27
+ }
inference_mask.py ADDED
@@ -0,0 +1,181 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ import argparse
3
+ import json
4
+ import os
5
+
6
+ os.environ.setdefault("TRANSFORMERS_NO_TF", "1")
7
+ os.environ.setdefault("TRANSFORMERS_NO_FLAX", "1")
8
+ os.environ.setdefault("TRANSFORMERS_NO_TORCHVISION", "1")
9
+ os.environ["USE_TF"] = "0"
10
+ os.environ["USE_FLAX"] = "0"
11
+ os.environ["USE_TORCH"] = "1"
12
+
13
+ import torch
14
+ from transformers import AutoModelForTokenClassification, AutoTokenizer, pipeline
15
+
16
+ import regex as re
17
+
18
+
19
+ TOKEN_RE = re.compile(r"[A-Za-z0-9]+|[^\w\s]", re.UNICODE)
20
+ EIRCODE_RE = re.compile(r"^(?:[ACDEFHKNPRTVWXY]\d{2}|D6W)\s?[0-9ACDEFHKNPRTVWXY]{4}$", re.IGNORECASE)
21
+ ALLOWED = {
22
+ "PPSN",
23
+ "ACCOUNT_NUMBER",
24
+ "BANK_ROUTING_NUMBER",
25
+ "CREDIT_DEBIT_CARD",
26
+ "PASSPORT_NUMBER",
27
+ "POSTCODE",
28
+ "PHONE_NUMBER",
29
+ "EMAIL",
30
+ "FIRST_NAME",
31
+ "LAST_NAME",
32
+ "SWIFT_BIC",
33
+ }
34
+
35
+
36
+ def tokenize_with_spans(text: str):
37
+ return [(m.group(0), m.start(), m.end()) for m in TOKEN_RE.finditer(text)]
38
+
39
+
40
+ def normalize_label(label: str) -> str:
41
+ label = (label or "").strip()
42
+ if label.startswith("B-") or label.startswith("I-"):
43
+ label = label[2:]
44
+ return label.upper()
45
+
46
+
47
+ def looks_like_eircode(value: str) -> bool:
48
+ return EIRCODE_RE.match(value.strip()) is not None
49
+
50
+
51
+ def ppsn_label_ids(model):
52
+ ids = []
53
+ for raw_id, raw_label in model.config.id2label.items():
54
+ label_id = int(raw_id)
55
+ label = str(raw_label or "").strip()
56
+ if label.endswith("PPSN"):
57
+ ids.append(label_id)
58
+ return sorted(ids)
59
+
60
+
61
+ def word_aligned_ppsn_spans(text: str, model, tokenizer, threshold: float):
62
+ pieces = tokenize_with_spans(text)
63
+ if not pieces:
64
+ return []
65
+ words = [word for word, _, _ in pieces]
66
+ encoded = tokenizer(words, is_split_into_words=True, return_tensors="pt", truncation=True)
67
+ word_ids = encoded.word_ids(batch_index=0)
68
+ device = next(model.parameters()).device
69
+ encoded = {k: v.to(device) for k, v in encoded.items()}
70
+ with torch.no_grad():
71
+ logits = model(**encoded).logits[0]
72
+ probs = torch.softmax(logits, dim=-1)
73
+ label_ids = ppsn_label_ids(model)
74
+ word_scores = []
75
+ for word_index in range(len(pieces)):
76
+ score = 0.0
77
+ for token_index, wid in enumerate(word_ids):
78
+ if wid != word_index:
79
+ continue
80
+ for label_id in label_ids:
81
+ score = max(score, float(probs[token_index, label_id]))
82
+ word_scores.append(score)
83
+ spans = []
84
+ active = None
85
+ for (_, start, end), score in zip(pieces, word_scores):
86
+ if score >= threshold:
87
+ if active is None:
88
+ active = {"start": start, "end": end, "score": score}
89
+ else:
90
+ active["end"] = end
91
+ active["score"] = max(active["score"], score)
92
+ elif active is not None:
93
+ spans.append(active)
94
+ active = None
95
+ if active is not None:
96
+ spans.append(active)
97
+ for span in spans:
98
+ span["label"] = "PPSN"
99
+ span["text"] = text[span["start"]:span["end"]]
100
+ return spans
101
+
102
+
103
+ def merge_spans(text: str, general_spans: list[dict], ppsn_spans: list[dict], other_min_score: float):
104
+ out = []
105
+ for span in general_spans:
106
+ label = normalize_label(span.get("entity_group") or span.get("entity") or "")
107
+ if label not in ALLOWED or label == "PPSN":
108
+ continue
109
+ if float(span.get("score", 0.0)) < other_min_score:
110
+ continue
111
+ out.append({
112
+ "label": label,
113
+ "start": int(span["start"]),
114
+ "end": int(span["end"]),
115
+ "score": float(span["score"]),
116
+ "text": text[int(span["start"]):int(span["end"])],
117
+ })
118
+ def overlaps(a, b):
119
+ return not (a["end"] <= b["start"] or b["end"] <= a["start"])
120
+ for span in ppsn_spans:
121
+ if looks_like_eircode(span["text"]):
122
+ continue
123
+ if any(overlaps(span, existing) for existing in out):
124
+ continue
125
+ out.append(span)
126
+ out.sort(key=lambda item: (item["start"], item["end"]))
127
+ return out
128
+
129
+
130
+ def mask_text(text: str, spans: list[dict]) -> str:
131
+ out = text
132
+ for span in sorted(spans, key=lambda item: (item["start"], item["end"]), reverse=True):
133
+ out = out[:span["start"]] + f"[{span['label']}]" + out[span["end"]:]
134
+ return out
135
+
136
+
137
+ def main():
138
+ parser = argparse.ArgumentParser()
139
+ parser.add_argument("--model", default=".")
140
+ parser.add_argument("--text", required=True)
141
+ parser.add_argument("--device", choices=["auto", "cpu", "cuda"], default="auto")
142
+ parser.add_argument("--ppsn-min-score", type=float, default=0.5)
143
+ parser.add_argument("--other-min-score", type=float, default=0.4)
144
+ parser.add_argument("--json", action="store_true")
145
+ args = parser.parse_args()
146
+
147
+ try:
148
+ tokenizer = AutoTokenizer.from_pretrained(args.model, use_fast=True, fix_mistral_regex=True)
149
+ except Exception:
150
+ try:
151
+ tokenizer = AutoTokenizer.from_pretrained(args.model, use_fast=True, fix_mistral_regex=False)
152
+ except TypeError:
153
+ tokenizer = AutoTokenizer.from_pretrained(args.model, use_fast=True)
154
+ model = AutoModelForTokenClassification.from_pretrained(args.model)
155
+ if args.device == "auto":
156
+ device = "cuda" if torch.cuda.is_available() else "cpu"
157
+ else:
158
+ device = args.device
159
+ model.to(device)
160
+ model.eval()
161
+
162
+ nlp = pipeline("token-classification", model=model, tokenizer=tokenizer, aggregation_strategy="simple", device=0 if device == "cuda" else -1)
163
+ general = nlp(args.text)
164
+ ppsn = word_aligned_ppsn_spans(args.text, model, tokenizer, threshold=args.ppsn_min_score)
165
+ spans = merge_spans(args.text, general, ppsn, other_min_score=args.other_min_score)
166
+ result = {
167
+ "model": args.model,
168
+ "masked_text": mask_text(args.text, spans),
169
+ "spans": spans,
170
+ "ppsn_decoder": "word_aligned",
171
+ "ppsn_min_score": args.ppsn_min_score,
172
+ "other_min_score": args.other_min_score,
173
+ }
174
+ if args.json:
175
+ print(json.dumps(result, indent=2, ensure_ascii=False))
176
+ else:
177
+ print(result["masked_text"])
178
+
179
+
180
+ if __name__ == "__main__":
181
+ main()
label_meta.json ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "base_model": "models/openmed-mliteclinical-irish-core-v14_userboost_cls_s50",
3
+ "label_list": [
4
+ "O",
5
+ "B-account_number",
6
+ "B-age",
7
+ "B-api_key",
8
+ "B-bank_routing_number",
9
+ "B-biometric_identifier",
10
+ "B-blood_type",
11
+ "B-certificate_license_number",
12
+ "B-city",
13
+ "B-company_name",
14
+ "B-coordinate",
15
+ "B-country",
16
+ "B-county",
17
+ "B-credit_debit_card",
18
+ "B-customer_id",
19
+ "B-cvv",
20
+ "B-date",
21
+ "B-date_of_birth",
22
+ "B-date_time",
23
+ "B-device_identifier",
24
+ "B-education_level",
25
+ "B-email",
26
+ "B-employee_id",
27
+ "B-employment_status",
28
+ "B-fax_number",
29
+ "B-first_name",
30
+ "B-gender",
31
+ "B-health_plan_beneficiary_number",
32
+ "B-http_cookie",
33
+ "B-ipv4",
34
+ "B-ipv6",
35
+ "B-language",
36
+ "B-last_name",
37
+ "B-license_plate",
38
+ "B-mac_address",
39
+ "B-medical_record_number",
40
+ "B-occupation",
41
+ "B-password",
42
+ "B-phone_number",
43
+ "B-pin",
44
+ "B-political_view",
45
+ "B-postcode",
46
+ "B-race_ethnicity",
47
+ "B-religious_belief",
48
+ "B-sexuality",
49
+ "B-ssn",
50
+ "B-state",
51
+ "B-street_address",
52
+ "B-swift_bic",
53
+ "B-tax_id",
54
+ "B-time",
55
+ "B-unique_id",
56
+ "B-url",
57
+ "B-user_name",
58
+ "B-vehicle_identifier",
59
+ "I-account_number",
60
+ "I-api_key",
61
+ "I-biometric_identifier",
62
+ "I-blood_type",
63
+ "I-certificate_license_number",
64
+ "I-city",
65
+ "I-company_name",
66
+ "I-coordinate",
67
+ "I-country",
68
+ "I-county",
69
+ "I-credit_debit_card",
70
+ "I-customer_id",
71
+ "I-date",
72
+ "I-date_of_birth",
73
+ "I-date_time",
74
+ "I-device_identifier",
75
+ "I-education_level",
76
+ "I-email",
77
+ "I-employee_id",
78
+ "I-employment_status",
79
+ "I-fax_number",
80
+ "I-first_name",
81
+ "I-gender",
82
+ "I-health_plan_beneficiary_number",
83
+ "I-http_cookie",
84
+ "I-ipv4",
85
+ "I-ipv6",
86
+ "I-language",
87
+ "I-last_name",
88
+ "I-license_plate",
89
+ "I-mac_address",
90
+ "I-medical_record_number",
91
+ "I-occupation",
92
+ "I-password",
93
+ "I-phone_number",
94
+ "I-pin",
95
+ "I-political_view",
96
+ "I-postcode",
97
+ "I-race_ethnicity",
98
+ "I-religious_belief",
99
+ "I-sexuality",
100
+ "I-ssn",
101
+ "I-state",
102
+ "I-street_address",
103
+ "I-swift_bic",
104
+ "I-tax_id",
105
+ "I-time",
106
+ "I-unique_id",
107
+ "I-url",
108
+ "I-user_name",
109
+ "I-vehicle_identifier",
110
+ "B-PPSN",
111
+ "I-PPSN",
112
+ "B-PASSPORT_NUMBER",
113
+ "I-PASSPORT_NUMBER"
114
+ ],
115
+ "num_labels": 110,
116
+ "target_label": "PPSN",
117
+ "extra_labels": [
118
+ "PPSN"
119
+ ]
120
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9dab6ee4b0741197492483c27aead122e91702371ea9958167ebb4c3b9688abd
3
+ size 539287048
pyproject.toml ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [project]
2
+ name = "openmed-mliteclinical-irishcorepii-rc"
3
+ version = "0.2.0rc1"
4
+ description = "QA release candidate for Irish core PII detection with OpenMed mLiteClinical"
5
+ requires-python = ">=3.10"
6
+ readme = "README.md"
7
+ license = { text = "Apache-2.0" }
8
+ dependencies = [
9
+ "transformers>=4.41.0",
10
+ "torch",
11
+ "regex>=2024.5.15",
12
+ ]
13
+
14
+ [tool.uv]
15
+ package = false
qa_config.json ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "repo_id": "temsa/OpenMed-mLiteClinical-IrishCorePII-135M-v2-rc1",
3
+ "recommended_inference": {
4
+ "ppsn_decoder": "word_aligned",
5
+ "ppsn_min_score": 0.5,
6
+ "other_min_score": 0.4,
7
+ "device": "cpu"
8
+ },
9
+ "smoke_texts": [
10
+ "I was told to provide my number 1234567T when applying, what do I do next?",
11
+ "My ppsn is 1234567tw and I need to know about carer's allowance",
12
+ "Please call me at 0871234567 tomorrow.",
13
+ "My Eircode is D02 X285 and my phone is 087 123 4567."
14
+ ]
15
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cls_token": {
3
+ "content": "[CLS]",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "mask_token": {
10
+ "content": "[MASK]",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": {
17
+ "content": "[PAD]",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "sep_token": {
24
+ "content": "[SEP]",
25
+ "lstrip": false,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ },
30
+ "unk_token": {
31
+ "content": "[UNK]",
32
+ "lstrip": false,
33
+ "normalized": false,
34
+ "rstrip": false,
35
+ "single_word": false
36
+ }
37
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "[PAD]",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "100": {
12
+ "content": "[UNK]",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "101": {
20
+ "content": "[CLS]",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "102": {
28
+ "content": "[SEP]",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "103": {
36
+ "content": "[MASK]",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "clean_up_tokenization_spaces": false,
45
+ "cls_token": "[CLS]",
46
+ "do_lower_case": false,
47
+ "extra_special_tokens": {},
48
+ "fix_mistral_regex": true,
49
+ "mask_token": "[MASK]",
50
+ "max_length": 512,
51
+ "model_max_length": 512,
52
+ "pad_token": "[PAD]",
53
+ "sep_token": "[SEP]",
54
+ "stride": 0,
55
+ "strip_accents": null,
56
+ "tokenize_chinese_chars": true,
57
+ "tokenizer_class": "DistilBertTokenizer",
58
+ "truncation_side": "right",
59
+ "truncation_strategy": "longest_first",
60
+ "unk_token": "[UNK]"
61
+ }
training_sources.json ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "base_model": "OpenMed/OpenMed-PII-mLiteClinical-Base-135M-v1",
3
+ "release_line": "IrishCorePII raw-model recovery candidate",
4
+ "recovery_parent": "internal v14 candidate derived from the same base model",
5
+ "recovery_adapter": "v15 weak-context PPSN recovery adapter",
6
+ "recommended_thresholds": {
7
+ "ppsn_min_score": 0.5,
8
+ "other_min_score": 0.4
9
+ },
10
+ "mix": {
11
+ "name": "ppsn_recover_v4_mix",
12
+ "sources": [
13
+ {
14
+ "name": "user_raw_boost_v1",
15
+ "weight": 7.0,
16
+ "kind": "synthetic_eval_duplication"
17
+ },
18
+ {
19
+ "name": "irish_ppsn_phone_edge_v1",
20
+ "weight": 3.0,
21
+ "kind": "synthetic_manual_suite"
22
+ },
23
+ {
24
+ "name": "ppsns_focus_v7",
25
+ "weight": 2.0,
26
+ "kind": "synthetic_ppsn_focus"
27
+ },
28
+ {
29
+ "name": "ppsns_mid_context_v6g",
30
+ "weight": 2.0,
31
+ "kind": "synthetic_ppsn_focus"
32
+ },
33
+ {
34
+ "name": "irish_core_release_v2_mix",
35
+ "weight": 5.0,
36
+ "kind": "synthetic_replay_mix"
37
+ },
38
+ {
39
+ "name": "irish_ppsn_eircode_spec_v1",
40
+ "weight": 1.0,
41
+ "kind": "synthetic_spec_dataset"
42
+ }
43
+ ]
44
+ },
45
+ "upstream_attribution": [
46
+ {
47
+ "name": "joelniklaus/mapa",
48
+ "license": "CC-BY-4.0"
49
+ },
50
+ {
51
+ "name": "gretelai/synthetic_pii_finance_multilingual",
52
+ "license": "Apache-2.0"
53
+ }
54
+ ]
55
+ }
vocab.txt ADDED
The diff for this file is too large to render. See raw diff