pub struct SemanticBoost {
pub distance_factor: f32,
pub phrase: String,
}Expand description
SemanticBoost : Distance phrase is useful for moving the embedding vector of the chunk in the direction of the distance phrase. I.e. you can push a chunk with a chunk_html of "iphone" 25% closer to the term "flagship" by using the distance phrase "flagship" and a distance factor of 0.25. Conceptually it’s drawing a line (euclidean/L2 distance) between the vector for the innerText of the chunk_html and distance_phrase then moving the vector of the chunk_html distance_factor*L2Distance closer to or away from the distance_phrase point along the line between the two points.
Fields§
§distance_factor: f32Arbitrary float (positive or negative) specifying the multiplicate factor to apply before summing the phrase vector with the chunk_html embedding vector
phrase: StringTerms to embed in order to create the vector which is weighted summed with the chunk_html embedding vector
Implementations§
Source§impl SemanticBoost
impl SemanticBoost
Sourcepub fn new(distance_factor: f32, phrase: String) -> SemanticBoost
pub fn new(distance_factor: f32, phrase: String) -> SemanticBoost
Distance phrase is useful for moving the embedding vector of the chunk in the direction of the distance phrase. I.e. you can push a chunk with a chunk_html of "iphone" 25% closer to the term "flagship" by using the distance phrase "flagship" and a distance factor of 0.25. Conceptually it’s drawing a line (euclidean/L2 distance) between the vector for the innerText of the chunk_html and distance_phrase then moving the vector of the chunk_html distance_factor*L2Distance closer to or away from the distance_phrase point along the line between the two points.
Trait Implementations§
Source§impl Clone for SemanticBoost
impl Clone for SemanticBoost
Source§fn clone(&self) -> SemanticBoost
fn clone(&self) -> SemanticBoost
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SemanticBoost
impl Debug for SemanticBoost
Source§impl Default for SemanticBoost
impl Default for SemanticBoost
Source§fn default() -> SemanticBoost
fn default() -> SemanticBoost
Source§impl<'de> Deserialize<'de> for SemanticBoost
impl<'de> Deserialize<'de> for SemanticBoost
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for SemanticBoost
impl PartialEq for SemanticBoost
Source§fn eq(&self, other: &SemanticBoost) -> bool
fn eq(&self, other: &SemanticBoost) -> bool
self and other values to be equal, and is used by ==.