[−][src]Struct nnsplit::NNSplitLogic
The logic by which texts are split.
Implementations
impl NNSplitLogic
[src]
pub fn new(options: NNSplitOptions, split_sequence: SplitSequence) -> Self
[src]
Create new logic from options and a split sequence.
Panics
- If the options are invalid, e. g. max_length % length_divisor != 0
pub fn options(&self) -> &NNSplitOptions
[src]
Get the underlying NNSplitOptions.
pub fn split_sequence(&self) -> &SplitSequence
[src]
Get the underlying SplitSequence.
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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Downcast for T where
T: Any,
T: Any,
pub fn into_any(self: Box<T>) -> Box<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn as_any(&self) -> &(dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
impl<T> DowncastSync for T where
T: Send + Sync + Any,
T: Send + Sync + Any,
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.
pub 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>,