L'art de poser de meilleures questions

Introduction à Databricks Genie

Gang Wang

Senior Data Scientist

Pourquoi l'affinage compte

$$ entonnoir : Question vague, Ajouter des filtres, Ajouter période, Ajouter tri, Réponse précise

Affiner le prompt = Meilleurs résultats

  • La 1re requête est rarement parfaite (c'est normal)
  • Ajoutez filtres, dates, regroupements
  • Plus précis = plus utile
Introduction à Databricks Genie

Résultats Genie pour « Show me my transactions » — trop de lignes et colonnes

« Show me my transactions »

Introduction à Databricks Genie

Résultats Genie pour « Show me transactions from the most recent month »

« Show me transactions from the most recent month »

Introduction à Databricks Genie

Résultats Genie pour « ...where amount over $100, grouped by franchise »

« Show me transactions from the most recent month where the amount was over $100, grouped by franchise »

Introduction à Databricks Genie

La formule

$$

sentence_builder_v3.png

Introduction à Databricks Genie

Assembleur de phrase

nanobanana : complet : Quatre blocs pour composer un bon prompt — bloc 1 WHAT avec une loupe, bloc 2 WHEN avec un calendrier, bloc 3 HOW avec un tri, bloc 4 CONSTRAINTS avec un filtre — les blocs s'assemblent pour former un prompt complet

Astuce : La plupart des débutants sont trop brefs : ils tapent juste « Sales ». Utilisez les quatre parties pour de meilleurs résultats.

Introduction à Databricks Genie

Autre exemple

Résultats Genie pour « revenue by franchise for May 2024, grouped by city » avec le panneau SQL ouvert

« Show me revenue by franchise for May 2024, grouped by city, only transactions over $50 »

Introduction à Databricks Genie

Esprit d'itération

$$

cycle itératif

$$

  1. Demander – Commencez par une question simple
  2. Examiner – Vérifiez les résultats
  3. Affiner – Ajoutez des contraintes une par une
  4. Répéter – Jusqu'à obtenir ce qu'il vous faut

À retenir : Le prompt n'a pas besoin d'être parfait du premier coup

Introduction à Databricks Genie

Passons à la pratique !

Introduction à Databricks Genie

Preparing Video For Download...