Skip to content

Commit 702f73e

Browse files
committed
Add text in detectors API
Signed-off-by: gkumbhat <kumbhat.gaurav@gmail.com>
1 parent 753c3ce commit 702f73e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/clients/detector.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ pub struct ContentAnalysisResponse {
9696
pub start: usize,
9797
/// End index of detection
9898
pub end: usize,
99+
/// Text corresponding to detection
100+
pub text: String,
99101
/// Relevant detection class
100102
pub detection: String,
101103
/// Detection type or aggregate detection label
@@ -112,7 +114,7 @@ impl From<ContentAnalysisResponse> for crate::models::TokenClassificationResult
112114
Self {
113115
start: value.start as u32,
114116
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,
116118
entity: value.detection,
117119
entity_group: value.detection_type,
118120
score: value.score,

0 commit comments

Comments
 (0)