gliner/model/
mod.rs

1//! The core of `gline-rs`: everything about pre-/post-processing, and inferencing
2
3pub mod params;
4pub mod pipeline;
5pub mod input;
6pub mod output;
7
8use crate::util::result::Result;
9use orp::pipeline::Pipeline;
10use params::Parameters;
11use orp::model::Model;
12
13
14/// Basic GLiNER, to be parametrized by a specific pipeline (see implementations within the pipeline module)
15/// 
16/// This is just a convenience wrapper around a `Model`, a `Pipeline`, and some `Parameters`.
17pub struct GLiNER<P> {
18    params: Parameters,
19    model: Model,
20    pipeline: P,
21}
22
23
24impl<'a, P: Pipeline<'a, Parameters = Parameters>> GLiNER<P> {
25    pub fn inference(&'a self, input: P::Input) -> Result<P::Output> {
26        self.model.inference(input, &self.pipeline, &self.params)
27    }
28}
OSZAR »