[−][src]Struct nnsplit::NNSplitLogic
The logic by which texts are split.
Fields
options: NNSplitOptions
split_sequence: SplitSequence
Implementations
impl NNSplitLogic
[src]
pub fn new(options: NNSplitOptions) -> Self
[src]
Create new logic from options. The split sequence is not customizable at the moment.
pub fn get_inputs_and_indices(
&self,
texts: &[&str]
) -> (Array2<u8>, Vec<(usize, Range<usize>)>)
[src]
&self,
texts: &[&str]
) -> (Array2<u8>, Vec<(usize, Range<usize>)>)
Convert texts to neural network inputs. Returns:
- An
ndarray::Array2
which can be fed into the neural network as is. - A vector of indices with information which positions in the text the array elements correspond to.
pub fn split<'a>(
&self,
texts: &[&'a str],
slice_preds: Array3<f32>,
indices: Vec<(usize, Range<usize>)>
) -> Vec<Split<'a>>
[src]
&self,
texts: &[&'a str],
slice_preds: Array3<f32>,
indices: Vec<(usize, Range<usize>)>
) -> Vec<Split<'a>>
Splits the text, given predictions by a neural network and indices with information which positions in the text the predictions correspond to.
Auto Trait Implementations
impl RefUnwindSafe for NNSplitLogic
impl Send for NNSplitLogic
impl Sync for NNSplitLogic
impl Unpin for NNSplitLogic
impl UnwindSafe for NNSplitLogic
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,