pub trait BatchCapable: Model {
// Provided methods
fn extract_entities_batch(
&self,
texts: &[&str],
language: Option<&str>,
) -> Result<Vec<Vec<Entity>>, Error> { ... }
fn optimal_batch_size(&self) -> Option<usize> { ... }
}Expand description
Trait for models that support batch processing.
Models implementing this trait can process multiple texts efficiently, potentially using parallel processing or optimized batch operations.
Provided Methods§
Sourcefn extract_entities_batch(
&self,
texts: &[&str],
language: Option<&str>,
) -> Result<Vec<Vec<Entity>>, Error>
fn extract_entities_batch( &self, texts: &[&str], language: Option<&str>, ) -> Result<Vec<Vec<Entity>>, Error>
Sourcefn optimal_batch_size(&self) -> Option<usize>
fn optimal_batch_size(&self) -> Option<usize>
Get the optimal batch size for this model, if applicable.
Returns None if the model doesn’t have a specific optimal batch size,
or Some(n) if there’s a recommended batch size for best performance.
Implementors§
impl BatchCapable for ALBERTNER
impl BatchCapable for BiLstmCrfNER
impl BatchCapable for DeBERTaV3NER
impl BatchCapable for GLiNER2Onnx
Available on crate feature
onnx only.impl BatchCapable for GLiNERPoly
impl BatchCapable for BertNEROnnx
Available on crate feature
onnx only.impl BatchCapable for CrfNER
impl BatchCapable for EnsembleNER
impl BatchCapable for GLiNEROnnx
Available on crate feature
onnx only.