Update README.md
Browse files
README.md
CHANGED
|
@@ -64,7 +64,20 @@ model = GLiNER.from_pretrained("nvidia/gliner-pii")
|
|
| 64 |
|
| 65 |
# Sample text containing PII/PHI entities
|
| 66 |
text = """
|
|
|
|
| 67 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
"""
|
| 69 |
|
| 70 |
# Define the labels for PII/PHI entities
|
|
@@ -131,4 +144,58 @@ entities = model.predict_entities(text, labels, threshold=0.3)
|
|
| 131 |
|
| 132 |
# Display the detected entities
|
| 133 |
print(json.dumps(entities, indent=2))
|
| 134 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
|
| 65 |
# Sample text containing PII/PHI entities
|
| 66 |
text = """
|
| 67 |
+
**Claim Denial Letter**
|
| 68 |
|
| 69 |
+
**Date:** 2023-11-15
|
| 70 |
+
|
| 71 |
+
**Claimant Information:**
|
| 72 |
+
- **Claimant Name:** Nataly White
|
| 73 |
+
- **Medical Record Number:** 1842-75-3924
|
| 74 |
+
|
| 75 |
+
**Claim Denial Details:**
|
| 76 |
+
|
| 77 |
+
Dear Nataly White,
|
| 78 |
+
|
| 79 |
+
We are writing to inform you that your disability claim has been denied. The denial is based on the information provided in your medical record, numbered 1842-75-3924.
|
| 80 |
+
After a thorough review, it has been determined that the medical evidence does not meet the criteria outlined in your policy for disability benefits.
|
| 81 |
"""
|
| 82 |
|
| 83 |
# Define the labels for PII/PHI entities
|
|
|
|
| 144 |
|
| 145 |
# Display the detected entities
|
| 146 |
print(json.dumps(entities, indent=2))
|
| 147 |
+
|
| 148 |
+
# Expected output:
|
| 149 |
+
[
|
| 150 |
+
{
|
| 151 |
+
"start": 42,
|
| 152 |
+
"end": 52,
|
| 153 |
+
"text": "2023-11-15",
|
| 154 |
+
"label": "date",
|
| 155 |
+
"score": 0.9999942779541016
|
| 156 |
+
},
|
| 157 |
+
{
|
| 158 |
+
"start": 107,
|
| 159 |
+
"end": 113,
|
| 160 |
+
"text": "Nataly",
|
| 161 |
+
"label": "first_name",
|
| 162 |
+
"score": 0.9999998807907104
|
| 163 |
+
},
|
| 164 |
+
{
|
| 165 |
+
"start": 114,
|
| 166 |
+
"end": 119,
|
| 167 |
+
"text": "White",
|
| 168 |
+
"label": "last_name",
|
| 169 |
+
"score": 0.9999997615814209
|
| 170 |
+
},
|
| 171 |
+
{
|
| 172 |
+
"start": 152,
|
| 173 |
+
"end": 164,
|
| 174 |
+
"text": "1842-75-3924",
|
| 175 |
+
"label": "medical_record_number",
|
| 176 |
+
"score": 0.9999996423721313
|
| 177 |
+
},
|
| 178 |
+
{
|
| 179 |
+
"start": 204,
|
| 180 |
+
"end": 210,
|
| 181 |
+
"text": "Nataly",
|
| 182 |
+
"label": "first_name",
|
| 183 |
+
"score": 0.9999998807907104
|
| 184 |
+
},
|
| 185 |
+
{
|
| 186 |
+
"start": 211,
|
| 187 |
+
"end": 216,
|
| 188 |
+
"text": "White",
|
| 189 |
+
"label": "last_name",
|
| 190 |
+
"score": 0.9999998807907104
|
| 191 |
+
},
|
| 192 |
+
{
|
| 193 |
+
"start": 376,
|
| 194 |
+
"end": 388,
|
| 195 |
+
"text": "1842-75-3924",
|
| 196 |
+
"label": "medical_record_number",
|
| 197 |
+
"score": 0.999998927116394
|
| 198 |
+
}
|
| 199 |
+
]
|
| 200 |
+
```
|
| 201 |
+
|