Generalize input of NERModel::predict_full_entities (#329)

This commit is contained in:
Åke Amcoff 2023-01-23 21:24:18 +01:00 committed by GitHub
parent e1e8fc615d
commit 80e0197e2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -274,7 +274,10 @@ impl NERModel {
/// ]]
/// # ;
/// ```
pub fn predict_full_entities(&self, input: &[&str]) -> Vec<Vec<Entity>> {
pub fn predict_full_entities<S>(&self, input: &[S]) -> Vec<Vec<Entity>>
where
S: AsRef<str>,
{
let tokens = self.token_classification_model.predict(input, true, false);
let mut entities: Vec<Vec<Entity>> = Vec::new();