File tree 2 files changed +9
-1
lines changed
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -44,10 +44,12 @@ paths:
44
44
- start : 15
45
45
end : 25
46
46
detection_type : pii
47
+ text : foo@bar.com
47
48
detection : EmailAddress
48
49
score : 0.99
49
50
- start : 105
50
51
end : 116
52
+ text : 123-456-7890
51
53
detection_type : pii
52
54
detection : SocialSecurity
53
55
score : 0.99
@@ -539,6 +541,10 @@ components:
539
541
type : integer
540
542
title : End
541
543
example : 26
544
+ text :
545
+ type : string
546
+ title : Text
547
+ example : foo@bar.com
542
548
detection :
543
549
type : string
544
550
title : Detection
Original file line number Diff line number Diff line change @@ -96,6 +96,8 @@ pub struct ContentAnalysisResponse {
96
96
pub start : usize ,
97
97
/// End index of detection
98
98
pub end : usize ,
99
+ /// Text corresponding to detection
100
+ pub text : String ,
99
101
/// Relevant detection class
100
102
pub detection : String ,
101
103
/// Detection type or aggregate detection label
@@ -112,7 +114,7 @@ impl From<ContentAnalysisResponse> for crate::models::TokenClassificationResult
112
114
Self {
113
115
start : value. start as u32 ,
114
116
end : value. end as u32 ,
115
- word : "" . to_string ( ) , // TODO: fill in when provided in the detector API in the next iteration
117
+ word : value . text ,
116
118
entity : value. detection ,
117
119
entity_group : value. detection_type ,
118
120
score : value. score ,
You can’t perform that action at this time.
0 commit comments