Skip to content
Coding Script or NotebookGoogle ColabAcademy

Batch Anchor Text Generation Notebook with Gemini, Claude or OpenAI

ForInternal linkingContent analysis

By Sam Torres· Updated 5 Dec 2026

Writing anchor text for hundreds of link candidates is where a large language model earns its keep. This Google Colab notebook sends each source and target pair to the model you choose and brings back anchors you can review before anything is used.

What it helps you do

  • Pick Gemini, Claude or OpenAI, with your own key kept in Colab secrets
  • Start with a shortlist of your strongest candidates, about 20, and adjust the prompt until you like the output
  • Give the model the real page content, collected with a custom extraction crawl
  • Get anchors with confidence scores and QA flags for repetition, over-optimisation and irrelevance
  • Review them in the notebook, then run the rest and export one file

A written walkthrough of the lab comes with it.

Where it is used

Lesson 3.6, after the prompt design and cost lesson in 3.5. Expect to go back and forth on the prompt a few times; that is the point of the shortlist.

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

  • Choose Gemini, Claude or OpenAI as the model
  • Starts with a shortlist of about 20 candidates so you can tune the prompt
  • Anchors with confidence scores and QA flags for repetition and over-optimisation
  • Review inside the notebook, then export one file
  • Written walkthrough included