Pinecone vectorization after splitting text chunks not working

Create an empty vector store or index using the appropriate method

index_name = “medical-chatbot”

# # Create embeddings for each text chunk

embeddings = HuggingFaceEmbeddings(model_name=“sentence-transformers/all-MiniLM-L6-v2”)

chunk_vectors =
for chunk in text_chunks:
chunk_embedding = embeddings.embed_documents(chunk.page_content)

Upsert individual vectors with unique IDs

for i, chunk_vector in enumerate(chunk_vectors):
vector_id = f"chunk-{i}"
index.upsert(index_name, vector_id, chunk_vector,batch_size=100)

Requirement: PDF is loaded,extracted, spliited into text_chunks and hugging face embedding i have downloaded. Now I want to move the embeddings to be applied on the input chunks and store vectors in the data base but not able to do so.

Problem :My code is running but I cannot see Vectors being created in the Pinecone Database Index. What could be the reason?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.