Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Cosine SimilarityMetricType #49

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions Milvus.Client/SimilarityMetricType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,29 @@ public enum SimilarityMetricType
/// For more details, see <see href="https://milvus.io/docs/metric.md#Substructure" />.
/// </remarks>
Substructure,

/// <summary>
/// <see cref="Cosine" /> is used to measure the cosine of the angle between two non-zero vectors in a multidimensional space,
/// reflecting the degree of similarity between them. The value ranges from -1 to 1, where 1 indicates that the vectors
/// are identical.
/// </summary>
/// <remarks>
/// <para>
/// This metric is particularly useful for measuring the similarity in text analysis and other types of data where
/// the magnitude of the vectors does not matter as much as the direction. In these cases, cosine similarity can
/// effectively capture the similarity between vectors, regardless of their size.
/// </para>
/// <para>
/// It's widely used in applications involving natural language processing, search engines, and recommendation systems
/// to calculate the similarity between documents or user preferences.
/// </para>
/// <para>
/// This metric type is valid for float vectors only.
/// </para>
/// <para>
/// For more details, see <see href="https://milvus.io/docs/metric.md#Cosine-Similarity" />.
/// </para>
/// </remarks>
Cosine,

}
Loading