You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have looked for existing issues (including closed) about this
Feature Request
Add feature to rig which can help users measure semantic similarity (or dissimilarity) between a prediction and a reference string.
Motivation
This feature is very related to LLMs and Embeddings and could be useful both Rig itself (improving the in-memory vector store) and for other projects that depend on Rig.
This makes a lot of sense! I think it makes more sense to have it part of rig-core directly since it's closely related to the existing embedding API. However, depending on how "heavy" the dependency is (it does depend on Rayon), this feature could be behind a feature flag
Alternatively, what could be interesting for both flexibility and completeness would be to rewrite the distance algorithms from semanticsimilarity_rs without using Rayon, and have rayon as a feature flag which would overwrite those implementations with the ones from semanticsimilarity_rs (or our own versions which uses rayon).
This can be done like using something like:
structEmbedding{...}#[cfg(feature = "rayon")]implEmbedding{pubfncosine_distance(&self,other:&Embedding) -> f64{// implementation using rayon or semanticsimilarity_rs}}#[cfg(not(feature = "rayon"))]implEmbedding{pubfncosine_distance(&self,other:&Embedding) -> f64{// implementation with stdlib (without rayon or semanticsimilarity_rs)}}
Feature Request
Add feature to rig which can help users measure semantic similarity (or dissimilarity) between a prediction and a reference string.
Motivation
This feature is very related to LLMs and Embeddings and could be useful both Rig itself (improving the in-memory vector store) and for other projects that depend on Rig.
Proposal
semanticsimilarity_rs
, copy only necessary codeDependencies:
semanticsimilarity_rs
Alternatives
The text was updated successfully, but these errors were encountered: