URL: /configuration/classifier

---
title: "Page Classifier Configuration"
icon: "sparkles"
description: "Switch the bundled page classifier on or off: it names which part of a page a link sits in where the markup says nothing"
---

The `[classifier]` section controls the page classifier, a small model that is bundled with squirrel. Its weights are `treetop-pagetype-v1` (the file `classifier-v2.json`), MIT licensed like the rest of the repository, and ship inside the executable.

## What it does

When a finding names a link, squirrel can say where on the page that link sits: the footer, the navigation, the pagination, a related-content block. Most of that comes from the page's own markup (landmark tags, ARIA roles, comment threads). Plenty of pages have none of it, so the classifier looks at the page structure and fills the gap.

- It runs on your machine. There is no network call and no credit cost.
- The markup wins for the header, the footer and comment threads, which are never overridden, and comment threads are only ever read from markup. A section the classifier names (the pagination, the breadcrumbs) refines a navigation or sidebar landmark.
- It answers only when it is confident, using a per-class bar chosen for precision. An unsure link keeps no section.
- It also names a page type for each page (article, product page, docs page, legal page and so on).
- The model is about 9 MB, loaded the first time a page is classified. Commands that never audit never read it.

Two rules use the page type and the breadcrumb section today:

- `schema/expected-type`: a page the classifier is sure is a product, article, contact, about, docs or listing page, and that declares none of the structured data that type should carry. See [schema/expected-type](/rules/schema/expected-type).
- `schema/breadcrumb`: a page with a breadcrumb trail and no `BreadcrumbList` markup. See [schema/breadcrumb](/rules/schema/breadcrumb).

With the classifier off, `schema/expected-type` has no page type to read and reports nothing, and `schema/breadcrumb` keeps its info check.

## Configuration

```toml
[classifier]
enabled = true
```

## Options

### `enabled`

**Type:** `boolean`
**Default:** `true`

`false` switches the classifier off. Link sections then come from page markup alone, and no classification is stored.

For one run, `--no-classifier` does the same:

```bash
squirrel audit https://example.com --no-classifier
```

## Known limitations

The classifier is a model, and models guess. It answers only when it is confident, but these mistakes happen:

- On a single article, the previous and next post links can read as pagination.
- A "follow us" row of profile icons can read as social sharing links.
- The comments label comes from page markup only. A comment thread built with unusual class names or ids is not recognised, and the model never names one.
- On pages with good markup it rarely speaks, because the markup has already answered.
- Pages served from the crawl cache keep the sections stored when they were last fetched, until they are fetched again. An audit that reuses unchanged pages therefore shows the old sections for them.

A wrong phrase never hides a broken link. It only changes the words that say where the link sits.

## Check that it loads

`squirrel self doctor` reports the bundled artifact, the featurizer version it was built for and how long it took to load:

```text
[OK] Page classifier: artifact v1 (sha256 f0de5687de8b, 8.4 MB), featurizer v2.3.0, region+pageType+section heads, loaded in 21 ms
```

A warning means the model could not be used. Audits still run and link sections fall back to page markup.
