LoslegenKostenlos loslegen

Comparing text embeddings

Diese Übung ist Teil des Kurses

End-to-End RAG with Weaviate

Kurs anzeigen

Anleitung zur Übung

  • Embed the two texts provided about Weaviate and compute the cosine distance between the two vectors.
  • Embed a third text about a different topic, compute the cosine distance to e1, and compare this distance to the previous distance.
  • Embed the strings in texts along with the query_text variable, loop over embeddings, calculating the distance between the embedding and query_embedding, and sort the distances to find the top 2 most similar texts.
  • Return all of the texts with a cosine distance less than max_distance.


Note: If you’re running DataLab in Restricted Mode, this exercise isn’t supported yet. We’re actively working on making it available in the future.


Interaktive Übung

In dieser interaktiven Übung kannst du die Theorie in die Praxis umsetzen.

Übung starten