pub trait INLModel: PNSObject {
// Provided methods
fn m_model_with_mlmodel(model: &MLModel) -> Result<Self, NSError>
where Self: Sized + FromId { ... }
fn m_model_with_contents_of_url(url: &NSURL) -> Result<Self, NSError>
where Self: Sized + FromId { ... }
fn m_predicted_label_for_string(
&self,
string: &NSString,
) -> Option<NSString> { ... }
fn m_predicted_labels_for_tokens(
&self,
tokens: &NSArray<NSString>,
) -> NSArray<NSString> { ... }
fn m_predicted_label_hypotheses_for_string_maximum_count(
&self,
string: &NSString,
max_count: UInt,
) -> NSDictionary<NSString, NSNumber> { ... }
fn m_predicted_label_hypotheses_for_tokens_maximum_count(
&self,
tokens: &NSArray<NSString>,
max_count: UInt,
) -> NSArray<NSDictionary<NSString, NSNumber>> { ... }
fn p_configuration(&self) -> NLModelConfiguration { ... }
}Expand description
A trait containing all the methods for NLModel
Provided Methods§
Sourcefn m_model_with_mlmodel(model: &MLModel) -> Result<Self, NSError>
fn m_model_with_mlmodel(model: &MLModel) -> Result<Self, NSError>
Creates a new natural language model based on the given Core ML model instance.
Sourcefn m_model_with_contents_of_url(url: &NSURL) -> Result<Self, NSError>
fn m_model_with_contents_of_url(url: &NSURL) -> Result<Self, NSError>
Creates a new natural language model based on the given Core ML model instance.
Sourcefn m_predicted_label_for_string(&self, string: &NSString) -> Option<NSString>
fn m_predicted_label_for_string(&self, string: &NSString) -> Option<NSString>
Predicts a label for the given input string.
Sourcefn m_predicted_labels_for_tokens(
&self,
tokens: &NSArray<NSString>,
) -> NSArray<NSString>
fn m_predicted_labels_for_tokens( &self, tokens: &NSArray<NSString>, ) -> NSArray<NSString>
Predicts a label for each string in the given array.
Sourcefn m_predicted_label_hypotheses_for_string_maximum_count(
&self,
string: &NSString,
max_count: UInt,
) -> NSDictionary<NSString, NSNumber>
fn m_predicted_label_hypotheses_for_string_maximum_count( &self, string: &NSString, max_count: UInt, ) -> NSDictionary<NSString, NSNumber>
Predicts multiple possible labels for the given input string.
Sourcefn m_predicted_label_hypotheses_for_tokens_maximum_count(
&self,
tokens: &NSArray<NSString>,
max_count: UInt,
) -> NSArray<NSDictionary<NSString, NSNumber>>
fn m_predicted_label_hypotheses_for_tokens_maximum_count( &self, tokens: &NSArray<NSString>, max_count: UInt, ) -> NSArray<NSDictionary<NSString, NSNumber>>
Predicts multiple possible labels for each token in the given array.
Sourcefn p_configuration(&self) -> NLModelConfiguration
fn p_configuration(&self) -> NLModelConfiguration
A configuration describing the natural language model.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.