Embedding and Link Candidate Scoring Notebook (OpenAI, Gemini or Screaming Frog Embeddings)
This Google Colab notebook turns your pages into embeddings and scores how closely every page relates to every other, so you get a ranked list of link candidates that no keyword rule would have found.
What it helps you do
- Choose your path: create embeddings in the notebook with an OpenAI or Gemini key, or reuse the embeddings Screaming Frog made during your crawl
- Run on sample data first, and see a cost estimate before any API call
- Score every page pair with cosine similarity in one step
- Rank the candidates, tune the threshold, and decide which near-identical pairs are duplicates
- Export the candidates, and keep the embeddings for the clustering lab
It comes with a written step-by-step walkthrough with a troubleshooting list, and a guide to getting an OpenAI or Gemini API key.
Where it is used
Lesson 3.2, where Sam Torres runs both paths. The outputs feed the topic clustering and anchor text labs that follow.
It comes with the AI-powered Internal Linking Audit and Automation course, led by Sam Torres. If you want to build the whole pipeline from audit to measured links with her, that is the place to start.
What’s included
- Two paths: embed in the notebook (OpenAI or Gemini) or reuse Screaming Frog embeddings
- Cost estimate before any API call
- Cosine similarity for every page pair in one step
- Ranked link candidates with an adjustable threshold
- Step-by-step walkthrough and an API key setup guide included
Where this resource is used on MLforSEO
Walkthroughs on the blog
Concepts behind it
More internal linking resources
- Coding Script or NotebookLink Blocks for WordPress: Related Posts, Topic Cards, Siblings and Mentions
- Coding Script or NotebookLink Menu to Linking Rules: Python Script for Auto-linking Plugins
- ChecklistBefore You Build: A Checklist for Internal Linking Tools
- Coding Script or NotebookInternal Linking QA and Holdout Group Notebook
- Visualization TemplateInternal Linking Impact Dashboard (Data Studio Template) with Setup Guide
- Coding Script or NotebookInternal Link Menu Notebook: Priority Score and Versioned Recommendations
See all 26 internal linking resources →See all 29 content analysis resources →See all 73 coding script or notebook resources →
