Skip to main content

Overview

This walkthrough demonstrates how to build a stock analysis and investment tips extraction model from YouTube financial content. You’ll learn how to:
  • Process 5 YouTube videos about stocks and investing
  • Use question/answer templates to extract simple, structured JSON output
  • Generate training data that captures stock tickers, actionable tips, and risks mentioned
  • Create train/validation splits and get model recommendations
  • Launch fine-tuning to create a specialized financial intelligence model
Why This Matters: Financial YouTube channels contain valuable insights, but this information is locked in video format. This workflow extracts structured intelligence from videos and transforms it into a model that can analyze financial content and output organized data. What You’ll Build: A model that analyzes financial video transcripts and outputs clean JSON with:
  • stocks_mentioned: Array of ticker symbols (e.g., [“AAPL”, “TSLA”])
  • investment_tips: List of actionable advice from the video
  • risks_mentioned: Warnings or cautionary statements discussed
  • video_topic: Brief description of the main topic
Export your Prem API key as API_KEY before running any script. The example uses 5 curated financial YouTube videos. You can modify the YOUTUBE_URLS array to use your own videos.
1

Setup: Define your YouTube URLs

Define the YouTube video URLs you want to process. You can replace these with any financial or educational videos.
2

Create project and generate synthetic dataset

Create a project, then submit 5 YouTube URLs about stocks and investing to generate synthetic Q&A pairs. The rules clearly define how each JSON field should be populated (stocks as tickers, tips as actionable advice, risks as warnings, topic as brief description). The generation can take 5-10 minutes.
3

Wait for dataset generation

Poll the dataset status every 5 seconds. Log progress every 30 seconds to avoid spam.
4

Create snapshot and get recommendations

Create a snapshot with 80/20 train/validation split, then request model recommendations.
5

Launch fine-tuning job

Filter recommended experiments and use them directly to launch the fine-tuning job.
6

Monitor job progress

Poll job status every 10 seconds. Each experiment shows its progress and final model ID.

Full Example