1. Apprendre
  2. /
  3. Cours
  4. /
  5. Baze de date vectoriale pentru embeddings cu Pinecone

Connected

Exercice

Inserarea transcrierilor YouTube

În exercițiile următoare, vei crea un chatbot care poate răspunde la întrebări despre videoclipuri YouTube, prin ingestia transcrierilor video și a metadatelor suplimentare în indexul 'pinecone-datacamp'.

Pentru început, vei pregăti datele din fișierul youtube_rag_data.csv și vei insera vectorii împreună cu toate metadatele lor în indexul 'pinecone-datacamp'. Datele sunt disponibile în DataFrame-ul youtube_df.

Iată un exemplu de transcriere din DataFrame-ul youtube_df:

id: 
35Pdoyi6ZoQ-t0.0

title:
Training and Testing an Italian BERT - Transformers From Scratch #4

text: 
Hi, welcome to the video. So this is the fourth video in a Transformers from Scratch 
mini series. So if you haven't been following along, we've essentially covered what 
you can see on the screen. So we got some data. We built a tokenizer with it...

url: 
https://youtu.be/35Pdoyi6ZoQ

published: 
01-01-2024

Instructions

100 XP
  • Inițializează clientul Pinecone cu cheia ta API (clientul OpenAI este disponibil ca client).
  • Extrage metadatele 'id', 'text', 'title', 'url' și 'published' din fiecare row.
  • Codifică texts folosind modelul 'text-embedding-3-small' de la OpenAI.
  • Inserează vectorii și metadatele într-un namespace numit 'youtube_rag_dataset'.