Skip to main content

Calculate Similarity Node

Calculates the similarity between two strings using embeddings.

Inputs

LabelPropertyTypeDescriptionDefault ValueIs Required
text_input 1string1botdojo/types/stringFirst stringnull
text_input 2string2botdojo/types/stringSecond stringnull

Properties

LabelPropertyTypeDescriptionDefault ValueIs Required
Embedding Model ConfigurationembeddingModelConfigbotdojo/types/embedding_modelThe embedding provider and model configuration.Object

Output

LabelPropertyTypeDescriptionDefault Value
Similarity ScoresimilarityScorebotdojo/types/numberThe calculated similarity score between two stringsnull

Get Similarity Node

The Get Similarity Node calculates the similarity score between two text strings using specified embedding models. This is useful for text comparison applications such as content recommendation, duplicate detection, or semantic search.

How It Works

  • Receives two strings as input.
  • Retrieves the configured embedding model and computes embeddings for both strings.
  • Calculates the dot product of these embeddings to determine the similarity score.
  • Outputs the similarity score, which indicates how similar the two strings are.

Example Flow

An example flow diagram can be found at the provided URL. Example Flow

Use Cases

  • Content Recommendation: Recommend content similar to user preferences by comparing similarity between content pieces.
  • Duplicate Detection: Identify duplicate or similar text entries in a dataset.
  • Semantic Search: Find semantically similar search results, even if exact words differ.

This node enables advanced text analysis by leveraging machine learning models for natural language processing.