pub struct DistMult { /* private fields */ }Expand description
DistMult embedding model
Implementations§
Trait Implementations§
Source§impl KnowledgeGraphEmbedding for DistMult
impl KnowledgeGraphEmbedding for DistMult
Source§fn generate_embeddings<'life0, 'life1, 'async_trait>(
&'life0 self,
triples: &'life1 [Triple],
) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<f32>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn generate_embeddings<'life0, 'life1, 'async_trait>(
&'life0 self,
triples: &'life1 [Triple],
) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<f32>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Generate embeddings for entities and relations
Source§fn score_triple<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
head: &'life1 str,
relation: &'life2 str,
tail: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<f32>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn score_triple<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
head: &'life1 str,
relation: &'life2 str,
tail: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<f32>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Score a triple (head, relation, tail)
Source§fn predict_links<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
entities: &'life1 [String],
relations: &'life2 [String],
) -> Pin<Box<dyn Future<Output = Result<Vec<(String, String, String, f32)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn predict_links<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
entities: &'life1 [String],
relations: &'life2 [String],
) -> Pin<Box<dyn Future<Output = Result<Vec<(String, String, String, f32)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Predict missing links
Source§fn get_entity_embedding<'life0, 'life1, 'async_trait>(
&'life0 self,
entity: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<f32>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_entity_embedding<'life0, 'life1, 'async_trait>(
&'life0 self,
entity: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<f32>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get entity embedding
Source§fn get_relation_embedding<'life0, 'life1, 'async_trait>(
&'life0 self,
relation: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<f32>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_relation_embedding<'life0, 'life1, 'async_trait>(
&'life0 self,
relation: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<f32>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get relation embedding
Source§fn train<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
triples: &'life1 [Triple],
_config: &'life2 TrainingConfig,
) -> Pin<Box<dyn Future<Output = Result<TrainingMetrics>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn train<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
triples: &'life1 [Triple],
_config: &'life2 TrainingConfig,
) -> Pin<Box<dyn Future<Output = Result<TrainingMetrics>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Train the embedding model
Auto Trait Implementations§
impl Freeze for DistMult
impl !RefUnwindSafe for DistMult
impl Send for DistMult
impl Sync for DistMult
impl Unpin for DistMult
impl UnsafeUnpin for DistMult
impl !UnwindSafe for DistMult
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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