Soenneker.Utils.String.CosineSimilarity 4.0.1101

Prefix Reserved
dotnet add package Soenneker.Utils.String.CosineSimilarity --version 4.0.1101
                    
NuGet\Install-Package Soenneker.Utils.String.CosineSimilarity -Version 4.0.1101
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soenneker.Utils.String.CosineSimilarity" Version="4.0.1101" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Utils.String.CosineSimilarity" Version="4.0.1101" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Utils.String.CosineSimilarity" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.Utils.String.CosineSimilarity --version 4.0.1101
                    
#r "nuget: Soenneker.Utils.String.CosineSimilarity, 4.0.1101"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Soenneker.Utils.String.CosineSimilarity@4.0.1101
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.Utils.String.CosineSimilarity&version=4.0.1101
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Utils.String.CosineSimilarity&version=4.0.1101
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

alternate text is missing from this package README image Soenneker.Utils.String.CosineSimilarity

A utility library for comparing strings via Cosine Similarity

Installation

dotnet add package Soenneker.Utils.String.CosineSimularity

Why?

Imagine you have two sentences or documents. Cosine similarity helps you figure out how similar they are by looking at the -words- they share. Here's why it's handy:

Easy to Understand:

Cosine similarity is easy to understand. It's a number between 0 and 1 that represents how similar two documents are. The closer to 1, the more similar they are.

Not Bothered by Length:

Whether a text is long or short doesn't throw off cosine similarity. It cares more about the words and their relationships than the total number of words.

Meaning, Not Just Frequency:

It focuses on the meaning of words, not just how often they show up. So, even if one document has a lot more words than another, they might still be considered similar if they share important terms.

Efficient for Big Tasks:

When you're dealing with lots of documents or a ton of text, cosine similarity is efficient. It doesn't get bogged down by complicated calculations, making it a practical choice for large datasets.

Usage

var text1 = "This is a test";
var text2 = "This is another test";

double result = CosineSimilarityStringUtil.CalculateSimilarityPercentage(text1, text2); // 75
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.1101 72 4/23/2026
4.0.1100 92 4/23/2026
4.0.1099 82 4/23/2026
4.0.1098 95 4/23/2026
4.0.1097 89 4/21/2026
4.0.1096 91 4/20/2026
4.0.1095 88 4/14/2026
4.0.1094 103 3/31/2026
4.0.1093 99 3/19/2026
4.0.1092 100 3/19/2026
4.0.1091 99 3/15/2026
4.0.1090 106 3/13/2026
4.0.1088 100 3/12/2026
4.0.1085 97 3/11/2026
4.0.1084 101 3/11/2026
4.0.1083 100 3/11/2026
4.0.1082 105 3/11/2026
4.0.1081 97 3/10/2026
4.0.1080 99 3/10/2026
4.0.1079 99 3/10/2026
Loading failed

Update dependency Soenneker.Extensions.String to 4.0.673 (#1453)