Skip to content

Commit

Permalink
Generalize input of NERModel::predict_full_entities (guillaume-be#329)
Browse files Browse the repository at this point in the history
  • Loading branch information
akeamc committed Jan 23, 2023
1 parent e1e8fc6 commit 80e0197
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/pipelines/ner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 80e0197

Please sign in to comment.