[][src]Struct nnsplit::NNSplitLogic

pub struct NNSplitLogic {
    pub options: NNSplitOptions,
    pub split_sequence: SplitSequence,
}

The logic by which texts are split.

Fields

options: NNSplitOptionssplit_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]

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]

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

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.