|
a |
|
b/docs/assets/fragments/peptic-ulcer-disease-examples.md |
|
|
1 |
=== "1" |
|
|
2 |
```python |
|
|
3 |
text = "Beaucoup d'ulcères gastriques" |
|
|
4 |
doc = nlp(text) |
|
|
5 |
spans = doc.spans["peptic_ulcer_disease"] |
|
|
6 |
|
|
|
7 |
spans |
|
|
8 |
# Out: [ulcères gastriques] |
|
|
9 |
``` |
|
|
10 |
|
|
|
11 |
|
|
|
12 |
|
|
|
13 |
=== "2" |
|
|
14 |
```python |
|
|
15 |
text = "Présence d'UGD" |
|
|
16 |
doc = nlp(text) |
|
|
17 |
spans = doc.spans["peptic_ulcer_disease"] |
|
|
18 |
|
|
|
19 |
spans |
|
|
20 |
# Out: [UGD] |
|
|
21 |
``` |
|
|
22 |
|
|
|
23 |
|
|
|
24 |
|
|
|
25 |
=== "3" |
|
|
26 |
```python |
|
|
27 |
text = "La patient à des ulcères" |
|
|
28 |
doc = nlp(text) |
|
|
29 |
spans = doc.spans["peptic_ulcer_disease"] |
|
|
30 |
|
|
|
31 |
spans |
|
|
32 |
# Out: [] |
|
|
33 |
``` |
|
|
34 |
|
|
|
35 |
|
|
|
36 |
|
|
|
37 |
=== "4" |
|
|
38 |
```python |
|
|
39 |
text = "Au niveau gastrique: blabla blabla blabla blabla blabla quelques ulcères" |
|
|
40 |
doc = nlp(text) |
|
|
41 |
spans = doc.spans["peptic_ulcer_disease"] |
|
|
42 |
|
|
|
43 |
spans |
|
|
44 |
# Out: [gastrique: blabla blabla blabla blabla blabla quelques ulcères] |
|
|
45 |
|
|
|
46 |
span = spans[0] |
|
|
47 |
|
|
|
48 |
span._.assigned |
|
|
49 |
# Out: {'is_peptic': [gastrique]} |
|
|
50 |
``` |