langchain_experimental.text_splitter.calculate_cosine_distances

langchain_experimental.text_splitter.calculate_cosine_distances(sentences: List[dict]) Tuple[List[float], List[dict]][source]

Calculate cosine distances between sentences.

Parameters

sentences (List[dict]) – List of sentences to calculate distances for.

Returns

Tuple of distances and sentences.

Return type

Tuple[List[float], List[dict]]