Skip to content

Commit

Permalink
Removed not used files and corrected the function calls in retriever …
Browse files Browse the repository at this point in the history
…component
  • Loading branch information
pallavijaini0525 committed Aug 7, 2024
1 parent c6d5a96 commit 4224709
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Binary file removed comps/dataprep/pinecone/data/nke-10k-2023.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion comps/retrievers/langchain/pinecone/ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def ingest_documents():
contains Edgar 10k filings data for Nike."""
# Load list of pdfs
company_name = "Nike"
data_path = "../data/"
data_path = "data/"
doc_path = [os.path.join(data_path, file) for file in os.listdir(data_path)][0]

print("Parsing 10k filing doc for NIKE", doc_path)
Expand Down
4 changes: 2 additions & 2 deletions comps/retrievers/langchain/pinecone/retriever_pinecone.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ def retrieve(input: EmbedDoc) -> SearchedDoc:
if input.distance_threshold is None:
raise ValueError("distance_threshold must be provided for " + "similarity_distance_threshold retriever")
docs_and_similarities = vector_db.similarity_search_by_vector_with_score(
embedding=input.embedding, k=input.k, distance_threshold=input.distance_threshold
embedding=input.embedding, k=input.k
)
search_res = [doc for doc, similarity in docs_and_similarities if similarity > input.distance_threshold]
elif input.search_type == "similarity_score_threshold":
docs_and_similarities = vector_db.similarity_search_by_vector_with_score(
query=input.text, k=input.k, score_threshold=input.score_threshold
query=input.text, k=input.k
)
search_res = [doc for doc, similarity in docs_and_similarities if similarity > input.score_threshold]
elif input.search_type == "mmr":
Expand Down

0 comments on commit 4224709

Please sign in to comment.