pub struct QuantumTextClassifier { /* private fields */ }Expand description
Quantum text classifier for sentiment analysis and text classification
Implementations§
Source§impl QuantumTextClassifier
impl QuantumTextClassifier
Sourcepub fn new(config: QNLPConfig, num_classes: usize) -> Self
pub fn new(config: QNLPConfig, num_classes: usize) -> Self
Create a new quantum text classifier
Sourcepub fn classify(&self, word_ids: &[usize]) -> QuantRS2Result<Vec<f64>>
pub fn classify(&self, word_ids: &[usize]) -> QuantRS2Result<Vec<f64>>
Classify a text sequence
Sourcepub fn build_circuit(
&self,
word_ids: &[usize],
) -> QuantRS2Result<Vec<Box<dyn GateOp>>>
pub fn build_circuit( &self, word_ids: &[usize], ) -> QuantRS2Result<Vec<Box<dyn GateOp>>>
Generate the full circuit for text classification
Auto Trait Implementations§
impl Freeze for QuantumTextClassifier
impl RefUnwindSafe for QuantumTextClassifier
impl Send for QuantumTextClassifier
impl Sync for QuantumTextClassifier
impl Unpin for QuantumTextClassifier
impl UnwindSafe for QuantumTextClassifier
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more