Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PROBLEM] Semantic text search using embeddings cookbook has confusing imports for embeddings_utils #1136

Open
chanonroy opened this issue Apr 5, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@chanonroy
Copy link

chanonroy commented Apr 5, 2024

[optional format]

Identify the file to be fixed
Semantic_text_search_using_embeddings.ipynb

Describe the problem

from utils.embeddings_utils import get_embedding, cosine_similarity

This import line is failing in the cookbook. Not sure if it's intended as a relative import

Describe a solution
A clear and concise description of what a fixed version should do.

For cosine_similarity, we could use scipy tools:

from scipy.spatial import distance

distance.cosine()

For get_embedding, we could write it out for clarity:

def get_embedding(text, model):
   ...

Screenshots
Screenshot 2024-04-05 at 2 05 45 PM

Additional context
General suggestion here is to remove the relative importing so that people can get to "Hello World" faster here

@chanonroy chanonroy added the bug Something isn't working label Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant