File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ def load_model(use_rule_based=False):
26
26
nlp .add_pipe ("eds_pseudo.context" )
27
27
else :
28
28
nlp = edsnlp .load ("AP-HP/eds-pseudo-public" )
29
+ nlp .pipes .ner .compute_confidence_score = True
29
30
model_load_state .empty ()
30
31
return nlp
31
32
@@ -68,7 +69,8 @@ def apply_model(text, use_rule_based):
68
69
label = ent .label_ ,
69
70
normalized_value = str (ent ._ .value or "" ),
70
71
)
71
-
72
+ if not use_rule_based :
73
+ d ["ner_confidence_score" ] = ent ._ .ner_confidence_score
72
74
data .append (d )
73
75
return data , html
74
76
@@ -127,7 +129,7 @@ def apply_model(text, use_rule_based):
127
129
if data :
128
130
df = pd .DataFrame .from_records (data )
129
131
df .normalized_value = df .normalized_value .replace ({"None" : "" })
130
- st .dataframe (df )
132
+ st .dataframe (df , use_container_width = True )
131
133
132
134
else :
133
135
st .markdown ("The model did not match any entity..." )
You can’t perform that action at this time.
0 commit comments