Skip to contents

Calculate the semantic similarity between one text and a list of other sentences by comparing their embeddings.

Usage

hf_sentence_similarity_payload(source_sentence, sentences)

Arguments

source_sentence

The string that you wish to compare the other strings with. This can be a phrase, sentence, or longer passage, depending on the model being used.

sentences

A list of strings which will be compared against the source_sentence.

Value

An inference payload

Examples

hf_sentence_similarity_payload(
  source_sentence = "A happy person",
  sentences = list("A joyful person", "A rainy day")
)
#> $inputs
#> $inputs$source_sentence
#> [1] "A happy person"
#> 
#> $inputs$sentences
#> $inputs$sentences[[1]]
#> [1] "A joyful person"
#> 
#> $inputs$sentences[[2]]
#> [1] "A rainy day"
#> 
#> 
#> 
#> $task
#> [1] "sentence-similarity"
#>