AskAniela

Topic categories for pages and documents

Taxonomy Labeling

Your catalog lists thousands of sites. The owners picked their categories when they signed up, or someone on your team added them years ago. Some are empty, some are too broad, and some describe what the site was about before it changed topic. Taxonomy Labeling reads the text of each page (URL) or document and assigns a category from IAB Content Taxonomy 3.1, from Google Content Categories v2, or from both.

Who it is for

  • Publisher marketplaces and directories. Buyers filter sites by topic before they order a publication. With categories assigned from page content, buyers filter listings by what the sites actually publish.
  • SEO tools. You group domains and URLs from your reports by the topic of their content and need categories for millions of items, not a handful.
  • Ad networks. You check whether a page fits a campaign, or the category the publisher chose at sign-up.
  • Agencies with many client sites. Before an audit you want to know what each of several thousand pages is about and sort them by topic.

What it does

You send the page text, its HTML or a URL. If you send a URL, we fetch the page and keep the main content, without menus and cookie banners. The AskAniela taxonomy model reads up to 7,500 tokens of text and returns a category path from broad to specific (for example Health > Pharmacy > Drugs & Medications). Each level has a strength from 0 to 100. Next to the main path you get secondary categories, each with its own strength. If you send your own record ID in the ref field, it comes back with the result, so you can write the category straight into your database.

A single page is checked in one request and the result comes back in the response. Larger sets go in batches of up to 1,000 items, so a million pages is 1,000 batches. Batches run in the background, and you download the results through the API or as CSV.

Results from our tests (home pages of Polish sites, both taxonomies, strength 0-100 in brackets):

Site IAB Content Taxonomy 3.1 Google Content Categories v2
doz.pl (online pharmacy) Medical Health (97) > Pharmaceutical Drugs (47) Health (100) > Pharmacy (23) > Drugs & Medications (93)
x-kom.pl (electronics store) Technology & Computing (85) > Consumer Electronics (36) > Smartphones (46) Computers & Electronics (99) > Consumer Electronics (31) > Gadgets & Portable Electronics (19)
halinkagotuje.pl (food blog) Food & Drink (100) > Cooking (28) Food & Drink (100) > Cooking & Recipes (38) > Cuisines (41)
otodom.pl (property listings) Real Estate (100) > Real Estate Buying and Selling (30) Real Estate (100) > Real Estate Listings (35) > Residential Sales (38)
prawnikwniemczech.pl (legal advice) Law (100) Law & Government (100) > Legal (66) > Legal Education (29)
bolkow24h.pl (local news site) Crime (65) News (98) > Local News (52)

On the first level the strength refers to the broad category; on deeper levels it refers to the choice within the level above. If a specific category scores low, you can store the broader one: for doz.pl, Pharmacy scores 23, so Health (100) is enough for a filter.

API. A real call

Taxonomy Labeling is an API. You send one page or document to POST /v1/labels and get the result in the same response. You send up to 1,000 items at once to POST /v1/labels/batch. The batch runs in the background, you read its status and results from GET /v1/labels/batch/{id}, and a finished batch is also available as CSV. If you set webhook_url, we send a signed labels.finished notification to that address when the batch is done.

This is the call for the doz.pl home page, both taxonomies, no JavaScript rendering:

curl https://api.askaniela.com/v1/labels \
  -H "Authorization: Bearer $ASKANIELA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://www.doz.pl/", "taxonomies": ["iab", "google"], "render_js": false, "ref": "doz-home"}'

The response came back in 4.0 s, including the page fetch. Below is the same JSON, shortened: we left out index, error, run_id, primary and taxonomy_name, and cut the Google paths list from 7 to 3 items.

{
  "ref": "doz-home",
  "url": "https://www.doz.pl/",
  "variant": "url",
  "status": "ok",
  "rendered": false,
  "low_content": false,
  "labels": {
    "iab": {
      "taxonomy": "iab",
      "primary_l1": {"id": "286", "name": "Medical Health", "strength": 100},
      "paths": [
        {"id": "320", "path": "Medical Health > Pharmaceutical Drugs", "strength": 11}
      ],
      "primary_path": [
        {"level": 1, "id": "286", "name": "Medical Health", "strength": 100},
        {"level": 2, "id": "320", "name": "Pharmaceutical Drugs", "strength": 50}
      ],
      "primary_confident": {"id": "320", "name": "Pharmaceutical Drugs", "strength": 50}
    },
    "google": {
      "taxonomy": "google",
      "primary_l1": {"id": "/Health", "name": "Health", "strength": 100},
      "paths": [
        {"id": "/Shopping/Discount & Outlet Stores", "path": "Shopping > Discount & Outlet Stores", "strength": 16},
        {"id": "/Health/Pharmacy/Drugs & Medications", "path": "Health > Pharmacy > Drugs & Medications", "strength": 7},
        {"id": "/Health/Pediatrics", "path": "Health > Pediatrics", "strength": 6}
      ],
      "primary_path": [
        {"level": 1, "id": "/Health", "name": "Health", "strength": 100},
        {"level": 2, "id": "/Health/Pharmacy", "name": "Pharmacy", "strength": 23},
        {"level": 3, "id": "/Health/Pharmacy/Drugs & Medications", "name": "Drugs & Medications", "strength": 97}
      ],
      "primary_confident": {"id": "/Health", "name": "Health", "strength": 100}
    }
  },
  "failed": [],
  "charged_usd": 0.001526,
  "model_usd": 0.000026,
  "fetch_usd": 0.0015,
  "render_usd": 0.0,
  "document_tokens": 856
}
  • primary_path is the main path with the strength of each level. primary_confident is the deepest level of that path with enough strength: Pharmaceutical Drugs in IAB, just Health in Google, because Pharmacy has 23.
  • paths holds the main path and the secondary categories, strongest first. For doz.pl, Google also pointed to a discount store (Shopping > Discount & Outlet Stores) next to health.
  • ref comes back unchanged, so you can write the result into the matching record in your database.
  • charged_usd is the price of this check. Almost all of it is the page fetch (fetch_usd). When you send text or HTML, you pay only model_usd.

The same result in the AskAniela panel, and a batch of the six home pages from the table above, checked the same day:

AskAniela panel screenshot: IAB 3.1 and Google v2 categories for the doz.pl home page with a 0-100 strength for each level

Result for the doz.pl home page: the main path in both taxonomies, the strength of each level and other topics on the page. AskAniela panel.

AskAniela panel screenshot: a batch of six home pages with the main IAB 3.1 and Google v2 category for each page

A batch of six home pages: the main category in both taxonomies and the level the result is sure down to. You can download the same result as CSV. AskAniela panel.

Request and response fields, Python and JavaScript examples, batches, CSV and webhook signature checks are in the Labeler API guide.

Raw model output

If you build your own category logic, POST /v1/labels/raw returns the taxonomy model output for a text as it comes from the model: the main node, the probability of each level given the level above, the top-level distribution, the best paths and the distributions at each level. You send the final text (100 to 50,000 characters) and taxonomy: iab, google or both. There is no page fetch, no HTML extraction and no stored result. No charge for now; available to selected partners on request, so write to us to enable it.

curl https://api.askaniela.com/v1/labels/raw \
  -H "Authorization: Bearer $ASKANIELA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "How to choose a tennis racket as a beginner? Weight, head size and balance matter most...", "taxonomy": "iab", "ref": "post-1842"}'

Shortened response (distributions cut to a few items):

{
  "results": {
    "iab": {
      "primary": "539",
      "primary_path": "Sports > Tennis",
      "primary_conditional": [{"node": "483", "level": 1, "p": 0.988}, {"node": "539", "level": 2, "p": 0.4244}],
      "primary_l1_probs": {"483": 0.988, "223": 0.0041, "473": 0.0034},
      "paths": [{"node": "473", "path": "Shopping", "confidence": 0.2204}, {"node": "539", "path": "Sports > Tennis", "confidence": 0.1295}],
      "dists": [{"level": 1, "parent": null, "choice": {"483": 0.3051, "473": 0.2204, "223": 0.2009}}],
      "document_tokens_read": 79,
      "truncated": false
    }
  },
  "failed": [],
  "document_tokens_read": 79,
  "truncated": false,
  "ref": "post-1842"
}

Your own questions to the model

Your own questions about a text go to POST /v1/labels/decide, the same model with a question you write: yes or no (yes_no, probability of yes), a pick from 2 to 20 of your options (choice, probability per option) or a position on a scale (score, expected level and the distribution). Up to 20 questions about one text in one call; the text is read once. No charge for now; available to selected partners on request, so write to us to enable it.

curl https://api.askaniela.com/v1/labels/decide \
  -H "Authorization: Bearer $ASKANIELA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "How to choose a tennis racket as a beginner? Weight, head size and balance matter most...", "questions": {"sells": {"mode": "yes_no", "question": "Does this page sell products?"}, "topic": {"mode": "choice", "question": "What is the main topic of the text?", "options": ["Sports", "Food", "Finance", "Travel"]}, "expertise": {"mode": "score", "question": "How much expertise does the author show?", "levels": ["none", "some", "expert"]}}}'

Response (numbers rounded):

{
  "answers": {
    "sells": {"mode": "yes_no", "yes": 0.7042},
    "topic": {"mode": "choice", "pick": "Sports", "probs": {"Sports": 0.9999, "Food": 0.00002, "Finance": 0.00002, "Travel": 0.00002}},
    "expertise": {"mode": "score", "pick": "none", "score": 1.33, "dist": [0.81, 0.05, 0.14], "levels": ["none", "some", "expert"]}
  },
  "document_tokens_read": 50,
  "truncated": false,
  "input_tokens": 98
}

Comparison with API models

We tested our model and five models available through APIs on the same pages: 367 pages labeled in IAB 3.1 and 298 in Google v2, in several languages. Each model got the same text excerpt and the same questions, and categories were accepted by the same rule. The price is the cost to a customer under each provider's price list; API models pay separately for each level of the tree, while our model reads the document once for the whole tree. Time covers the whole IAB tree for one page. Our model in the table is the version now running in production: it reads the document once and answers the following questions without reading it again, so the whole tree takes 0.07 s instead of 0.10 s in the previous version.

Model USD per 1M pages (IAB / Google) Time per page IAB: main L1 accuracy IAB L1 F1 Google L1 F1 Google L2 F1
AskAniela taxonomy model 48 / 48 0.10 s 0.755 0.683 0.740 0.587
Jev 1.14 346 / 302 1.00 s 0.796 0.751 0.614 0.436
Gemini Decision 1 648 / 553 1.40 s 0.798 0.746 0.608 0.406
Perplexity Decider v1.2 128 / 108 1.50 s 0.782 0.734 0.618 0.432
Liquid d1.1 115 / 97 1.30 s 0.768 0.722 0.607 0.381
Nace Drex v1.5 227 / 189 2.10 s 0.741 0.716 0.608 0.292

In Google v2 our model has the highest F1 on both levels. In IAB the API models have a higher F1 because our model returns more secondary categories, while main L1 accuracy is close. The test sets were labeled by our own process (language models plus verification), so they may favor the style of our labels. Our model is fine-tuned on these labels; the API models ran without fine-tuning.

How long a million documents takes

We only give numbers we measured:

Measurement Conditions Result One million documents
Batches in production, text or HTML sent by the client 31,383 documents in 122 minutes with more documents waiting in the queue (short pauses included), both taxonomies, about 2,300 tokens of text per document on average, 4 requests to the model at a time 257 documents per minute about 65 hours (2.7 days)
The taxonomy model alone, IAB tree lab, one document after another 0.068 s per document about 19 hours
A URL, single call production, 105 calls from the last 14 days, page fetch included median 4.3 s, 90% under 10.4 s not measured

The model time is a lower bound for one taxonomy. In production, text extraction, the second taxonomy and saving the results come on top, so we base the million-document figure on batch throughput. With URLs the time depends mostly on fetching the pages, and we have not yet measured batches made only of URLs at scale, so we do not give a time for a million URLs.

Why we built it

The companies we talked to about our API keep anywhere from tens of thousands to tens of millions of pages in their databases. People entered the categories at different times and from different lists, so one site can end up with three different topics. New sites arrive every day, so manual fixes cannot keep up, and sending every page to a large language model costs too much at millions of pages. So the AskAniela taxonomy model does only this one job and returns the full category path for each taxonomy in a single request.

What it does not do

  • IAB has no "news" or "encyclopedia" category. The IAB list describes topics, not types of sites. That is why the local news site in the table got Crime in IAB: the topic of the stories on its home page that day. Google Content Categories v2 has a News category, and there the same site landed in Local News. If you need to tell news sites apart from the rest, order the Google categories too.
  • A home page with changing content is labeled by what it shows on the day of the check. The home page of Polish Wikipedia got Video Gaming, because on the day of the check it featured an article about a game. For sites like that, send a few URLs of sections or articles.
  • A page with little text gets less certain categories. Below about 600 characters of readable text the result is marked low_content. Text shorter than 100 characters does not reach the model and you pay nothing.
  • Longer text is read up to 7,500 tokens. The result is then marked as truncated, and you pay only for the part that was read.
  • It does not judge quality or spam. A category says what a page is about. Whether the content is helpful or breaks Google's rules is what Content Risk Scanner checks.

Pricing

You pay for document tokens, separately for each taxonomy. Instructions for the model are not counted. If you send a URL instead of text, fetching the page is a separate item, and JavaScript rendering is only on request. Text or HTML you already have is therefore the cheapest option. The rates are below and on the Pricing page, in USD excluding VAT.

Before you send a batch you can get a free price estimate.

What you runUnit Price
Taxonomy Labeling: document tokens, per taxonomy 1M document tokens per taxonomy $0.0300
Taxonomy Labeling: page fetch address $0.0015
Taxonomy Labeling: JavaScript rendering address $0.0060

Prices in USD excluding VAT, pay as you go. Packages and top-ups have lower rates for some items; see the pricing page.

How to start

If you have a set to classify, write to us with the number of pages or documents and the taxonomy you need. Requests, response fields and code samples are in the API documentation.

AskAniela is not affiliated with Google or IAB Tech Lab. Ani matches pages to the category lists these organizations published; this is not a classification by Google or IAB. Licenses

Sources: IAB Content Taxonomy 3.1, Google Content Categories, the AskAniela lab measurement and the results shown above.