Update README.md
Browse files
README.md
CHANGED
|
@@ -143,59 +143,23 @@ labels = [
|
|
| 143 |
entities = model.predict_entities(text, labels, threshold=0.3)
|
| 144 |
|
| 145 |
# Display the detected entities
|
| 146 |
-
print(
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
[
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 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 |
|
|
|
|
| 143 |
entities = model.predict_entities(text, labels, threshold=0.3)
|
| 144 |
|
| 145 |
# Display the detected entities
|
| 146 |
+
print(f"{'start':>5} {'end':>5} {'text':<16} {'label'}")
|
| 147 |
+
print("-" * 60)
|
| 148 |
+
for e in entities:
|
| 149 |
+
print(f"{e['start']:>5} {e['end']:>5} {e['text']:<16} {e['label']}")
|
| 150 |
+
|
| 151 |
+
```
|
| 152 |
+
Expected output:
|
| 153 |
+
|
| 154 |
+
```Markdown
|
| 155 |
+
start end text label
|
| 156 |
+
------------------------------------------------------------
|
| 157 |
+
42 52 2023-11-15 date
|
| 158 |
+
107 113 Nataly first_name
|
| 159 |
+
114 119 White last_name
|
| 160 |
+
152 164 1842-75-3924 medical_record_number
|
| 161 |
+
204 210 Nataly first_name
|
| 162 |
+
211 216 White last_name
|
| 163 |
+
376 388 1842-75-3924 medical_record_number
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 164 |
```
|
| 165 |
|