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

add metadata in similarity search #18

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Canada-wet
Copy link

Hi thanks for the brilliant video, just saw a comment asking for metadata like pages for similarity search. I played around it and made a bit changes, and this works for me. Please check if this can help

@yuvrajpowar
Copy link

why is purpose of this statment, metadata_input = [metadatas[i]]*len(texts_temp)?

@Canada-wet
Copy link
Author

why is purpose of this statment, metadata_input = [metadatas[i]]*len(texts_temp)?

So when we split the texts, we also need to duplicate the corresponding metadata to ensure they still match each other for FAISS vectorDB creation.

e.g.

initial_text = 'I love watching YouTube videos. I am also a YouTuber myself.'
initial_metadata = [{'source':'random_blog1', 'page': 6}]

split_text = ['I love watching YouTube videos.', 'I am also a YouTuber myself.']
split_metadata = [{'source':'random_blog1', 'page': 6}, {'source':'random_blog1', 'page': 6}]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants