Skip to content

Instantly share code, notes, and snippets.

@elijahbenizzy
Created June 11, 2024 17:22
Show Gist options
  • Save elijahbenizzy/3e9c249ec31bf582ecac140e4dce8ed8 to your computer and use it in GitHub Desktop.
Save elijahbenizzy/3e9c249ec31bf582ecac140e4dce8ed8 to your computer and use it in GitHub Desktop.
def embeddings_df(urls: pd.DataFrame, embedder: URLEmbedder) -> pd.DataFrame:
"""Adds embeddings to the given URL DataFrame."""
urls["embeddings"] = [embedder.embed(url, normalize_embeddings=True) for url in urls["url"]]
return urls
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment