From 80e0197e2c820784b2c6052afe29db4235c2c225 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=85ke=20Amcoff?= Date: Mon, 23 Jan 2023 21:24:18 +0100 Subject: [PATCH] Generalize input of NERModel::predict_full_entities (#329) --- src/pipelines/ner.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pipelines/ner.rs b/src/pipelines/ner.rs index 690350f59..a91e07d7a 100644 --- a/src/pipelines/ner.rs +++ b/src/pipelines/ner.rs @@ -274,7 +274,10 @@ impl NERModel { /// ]] /// # ; /// ``` - pub fn predict_full_entities(&self, input: &[&str]) -> Vec> { + pub fn predict_full_entities(&self, input: &[S]) -> Vec> + where + S: AsRef, + { let tokens = self.token_classification_model.predict(input, true, false); let mut entities: Vec> = Vec::new();