RAG approach - Generate predictions

To complete

1 Get labelled data

import duckdb
con = duckdb.connect(database=":memory:")

con.execute("INSTALL httpfs;")
con.execute("LOAD httpfs;")

# query_definition = f"SELECT * FROM read_parquet('s3://projet-formation/diffusion/funathon/2026/project2/generation_None_temp08.parquet')"
query_definition = f"SELECT * FROM read_parquet('https://minio.lab.sspcloud.fr/projet-formation/diffusion/funathon/2026/project2/generation_None_temp08.parquet')"
annotations = con.sql(query_definition).to_df()
annotations.head()
code name label
0 01.11 Growing of cereals, other than rice, leguminou... Pulses cultivation for market
1 01.11 Growing of cereals, other than rice, leguminou... Legume crop production activities
2 01.11 Growing of cereals, other than rice, leguminou... Broad bean farming operations
3 01.11 Growing of cereals, other than rice, leguminou... Chickpea harvesting and processing
4 01.11 Growing of cereals, other than rice, leguminou... Production of dried beans and peas
import os
from dotenv import load_dotenv
from qdrant_client import QdrantClient

load_dotenv()

client_qdrant = QdrantClient(
    url=os.environ["QDRANT_URL"],
    api_key=os.environ["QDRANT_API_KEY"],
    port=os.environ["QDRANT_API_PORT"]
)

collections = client_qdrant.get_collections()
NoteAttention

To complete

Tip Exercice 1: To complete
  1. To complete.
Cliquer pour voir la réponse
print("Hello")
Hello
  1. To complete.
Cliquer pour voir la réponse
print("Hello")
Hello
  1. To complete.
Clue here To complete.