pub trait StreamingCapable: Model {
// Provided methods
fn extract_entities_streaming(
&self,
chunk: &str,
offset: usize,
) -> Result<Vec<Entity>, Error> { ... }
fn recommended_chunk_size(&self) -> usize { ... }
}Expand description
Trait for models that support streaming/chunked extraction.
Useful for processing very long documents by splitting them into chunks and extracting entities from each chunk with proper offset tracking.
Provided Methods§
Sourcefn extract_entities_streaming(
&self,
chunk: &str,
offset: usize,
) -> Result<Vec<Entity>, Error>
fn extract_entities_streaming( &self, chunk: &str, offset: usize, ) -> Result<Vec<Entity>, Error>
Sourcefn recommended_chunk_size(&self) -> usize
fn recommended_chunk_size(&self) -> usize
Get the recommended chunk size for streaming extraction.
Returns the optimal number of characters per chunk for this model. Default implementation returns 10,000 characters.
Implementors§
impl StreamingCapable for ALBERTNER
impl StreamingCapable for DeBERTaV3NER
impl StreamingCapable for GLiNER2Onnx
Available on crate feature
onnx only.impl StreamingCapable for GLiNERPoly
impl StreamingCapable for BertNEROnnx
Available on crate feature
onnx only.impl StreamingCapable for CrfNER
impl StreamingCapable for EnsembleNER
impl StreamingCapable for GLiNEROnnx
Available on crate feature
onnx only.