Provide Examples by Linking a Dataset
Introduction #
This step involves providing examples from a linked dataset to enhance the model’s classification abilities.
Part 6: Provide Examples via a Linked Dataset #
Our Hugging Face dataset contains a series of articles and summaries for training the model on and passing them into the prompt using variables that map to the column names in our dataset (e.g., {{article}}
and {{summary}}
).
Link Dataset #
- From the project’s Snapshots tab, select your last saved snapshot.
- Open the dataset drawer, then in Load dataset, choose the
hpe-ai/demo-articles-and-summary
we imported earlier. - Select Load.
Our linked dataset contains two columns: article
and summary
. We’ll make use of these columns when we iterate on our prompt.
Update the Prompt #
This time we will update the prompt using fields from our linked dataset. To do this, type {{
to bring up a list of selectable fields from the dataset.
Supply the model with the following prompt:
Instruction
Summarize each "Article:" into a series of bullet points. Each bullet point must be 30 words or less. Put each bullet point on a new line. Respond only with the bullet points about the article.
Examples
Below are examples:
Article: {{article}}
Summary: {{summary}}
Input
Article: {{article}}
Summary:
Expected Output
{{summary}}
Observe Output Results #
- Select Generate to see the output generated by the model based on the prompt you provided.
By providing examples and linking a dataset, we can see the new output contains the original linked dataset with new columns including a column where the model has summarized each article according to our instructions.
The model is performing reasonably well and so we won’t need to fine-tune it.
Save the Snapshot #
- Select Save Snapshot > Save as new snapshot. Name it
news summarization snapshot2
. - Select Save.
Recap #
- We’ve improved our model’s performance by linking a dataset and providing the model with examples from the linked dataset.
- We learned how to use columns from a linked dataset to prompt the model.
What’s Next? #
To practice crafting complex prompts and fine-tuning, visit our other tutorials including:
Congratulations!
You've successfully completed the tutorial.
🎉