Using Document to perform question answering task#11
Open
aaroosh-07 wants to merge 3 commits intomainfrom
Open
Using Document to perform question answering task#11aaroosh-07 wants to merge 3 commits intomainfrom
aaroosh-07 wants to merge 3 commits intomainfrom
Conversation
3 tasks
|
|
||
| Activate the python virtual environment | ||
|
|
||
| ### hfQnA.py |
Collaborator
There was a problem hiding this comment.
You need to give a hint to the reader what these two different scripts are used for?
| import os | ||
| import sys | ||
|
|
||
| def load_and_split_doc(path: str): |
Collaborator
There was a problem hiding this comment.
You should be type hinting at the returns of each method too
| return context | ||
|
|
||
| def run_rag(): | ||
| choice = input("Do you want to load the document(y/n): ") |
Collaborator
There was a problem hiding this comment.
Is this not - Do you want to upload a new document?
| chunks = text_splitter.split_documents(docs) | ||
| return chunks | ||
|
|
||
| def load_chunks_to_vectorstore(chunks): |
Collaborator
There was a problem hiding this comment.
What type is chunks?
prattyushmangal
requested changes
Sep 7, 2024
Collaborator
prattyushmangal
left a comment
There was a problem hiding this comment.
Good work, but almost all the functions in DocQnA are unit testable - so please add them along withsome other minor changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In this PR, we are adding a script to perform question answering task using document pdf file provided by the user. To achieve this we have implemented a RAG which breaks down document into multiple chunks and stores them in Chroma DB using hugging Face embedding model. and uses question to query for relevant chunks and perform QnA task on those chunks.