Journals / Case study

How Scribd pulled topics and names out of user-uploaded documents

In July 2021 Scribd's Applied Research team described the middle stage of a three-part system. Text-heavy uploads get two lists, keyphrases ranked by how often they appear and named entities with their aliases merged, and both go into one embedding space for discovery. The post has no accuracy or scale figures. Five years later Scribd describes an LLM pipeline with a person reviewing the disagreements.

18 NOV 20269 min readInformation extraction · NLP · Documents · Search Based on: Scribd, 2021
Our diagram titled Two lists per document, one shared space, in three bands. Route the upload: a type classifier looks at sample pages and sorts them into types such as sheet music, comics, tables and text-heavy; only text-heavy documents such as books, essays and study notes go on to extraction. Pull two lists, no labels needed: keyphrases, made by dropping stopwords, taking word pairs, growing them into longer noun phrases and ranking by count; and named entities, people, places and organisations, with aliases merged and unclear ones linked to a knowledge base. Use them downstream: one embedding space holding documents, keyphrases and entities side by side, used to find documents by analogy, name clusters and sort documents into a taxonomy. A note says the post gives no accuracy, scale or cost figures, so this is the Scribd-reported method only.
Diagram: MORARI. Source: Scribd

A document library is only as useful as what it knows about each document. A title and an upload date will not tell a search engine that an essay is about Victorian economics, or that "Mill" on page three and "John Stuart Mill" on page one are the same man.

Scribd, the document-sharing site, described how it fills that gap in a post on 21 July 2021 by Antonia Mouawad and Rafael Lacerda of its Applied Research team. The blog is licensed CC BY-SA 4.0, so we reuse one of its figures below with credit. It is part 2 of a series of three.

The problem: what is this document about?

"Extracting metadata from our documents is an important part of our discovery and recommendation pipeline, but discerning useful and relevant details from text-heavy user-uploaded documents can be challenging."

The team wanted two kinds of detail. "Keyphrases are phrases that represent major themes/topics, whereas entities are proper nouns such as people, places and organizations."

One limit matters for everything that follows. This post is about text that already exists, from books, essays and study material. It never mentions scanned pages, photos, forms or OCR.

The design: route first, then two lists

Scribd's flow diagram: a document goes into Type Classification, which branches to Comics, other types and Text Heavy; only Text Heavy goes on to Information Extraction, outlined in red, which feeds Downstream Discovery models
Extraction is one stage: a type classifier sends only text-heavy documents to it. Figure 1 from the post, Scribd Technology, CC BY-SA 4.0, converted to WebP only. Image: Scribd

Part 1 of the series, Identifying Document Types, is a page classifier: "We converged on 6 document types, which included sheet-music, text-heavy, comics and tables." Only text-heavy documents reach the extraction step. Its output goes to the discovery models and to part 3, categorisation. Our redraw of the whole stage is at the top.

How they built it: counts, rules and a linker

1. Skip the labels. "Training a decent supervised model to be able to extract keyphrases across a wide variety of topics would require a large amount of training data, and might generalize very poorly. For this reason, we decided to take the unsupervised approach."

2. Build phrases from pairs. "We simply start by filtering out stopwords and extracting the n-grams with a base n (bi-grams in our case, n=2)." A pair grows into a longer phrase when the longer one is common enough. Their example: "world health" becomes "world health organization" if the longer form appears at least half as often, and only for noun patterns.

3. Rank by count. "Finally we use the count of occurrences of the candidate keyphrase as a proxy to its importance." They add the condition: "This method is reliable for longer documents".

4. Merge the aliases. "Naively counting named entities through exact string matches surfaces an interesting problem: a single entity may go by many names or aliases, which means string frequency is an unreliable measurement of importance." Rules on shared tokens and initials decide which names match, and "we start by assuming the canonical alias is the longest alias in a text for a given entity".

5. Link the unclear ones. For a name like "Potter", "we built an Entity Linker, which determines which named entity is the most likely to match the alias given the context." Wikidata is named as an example knowledge base. If the entity is missing, the mention goes to the closest clear mention, such as "Harry".

6. Put everything in one space. Linked entities and keyphrases are embedded alongside the text, following a 2016 paper that maps words and entities into the same vector space.

Our diagram titled One person, three names, in three bands. Count the strings as written: Mill 5, John Stuart Mill 2, Robert Grosvenor 1, William Henry Smith 1, Stuart Mill 1; rules on shared tokens and initials decide that Mill, Stuart Mill and John Stuart Mill match and the other two do not. Merge and recount: John Stuart Mill 8, because the longest alias becomes the name and 5 plus 2 plus 1 mentions count together; the others stay at 1. When a name is ambiguous: an entity linker matches Potter from context to a knowledge-base entry such as Wikidata, and if it is not there, the mention is attached to the nearest clear mention, such as Harry.
The post's own toy example: merging three names lifts the main entity from 5 mentions to 8. Diagram: MORARI. Source: Scribd

How they measured it

They did not, at least not in print. The post reports no precision, recall, labelled test set or baseline. Its numbers are settings (word pairs, a 50 percent example threshold) and a toy example on a Wikipedia excerpt, where Mill "is referred to a total of 8 times instead of 5." One chart of cluster topics was "confirmed by manually inspecting the documents", with no sample size.

The judgement is qualitative: "We found the combination of keyphrase and entity extraction to provide a rich semantic description of each document." No model names, corpus size, speed or cost are given. All of it is Scribd's own account.

What it delivered

"Embedding documents, keyphrases and entities in the same space allowed us to discover documents by analogy." Keyphrases also named clusters: "By extracting the most common keyphrases of a cluster, we can derive a common theme for the cluster’s content". Part 3 says its classifier "leverages the extracted key phrases and entities discussed in part II".

The honest summary: a cheap, label-free way to describe long documents, adopted downstream, with its quality never measured in public.

What has changed since

Scribd now describes a different pattern. A July 2026 post, Stop Building Models. Start Building Systems., covers classification rather than extraction, with the steps "Fast Model → Judge Model → SME Review → Ingest → Iterate". It says Scribd "scanned hundreds of millions of documents with a small cross-functional team" in about two months, with a "0.1% random sample for judge review". It does not name the models or give accuracy. In February 2026 Scribd added a trust score built on "128-dimensional semantic embeddings for every document". The company says Scribd "hosts over 200 million documents in 261 languages".

The field moved to the problem this post skipped: pages as images. LayoutLM models "interactions between text and layout information across scanned document images". Donut dropped the separate OCR step, citing "OCR error propagation to the subsequent process." olmOCR put the cost of the best hosted vision models at "over 6,240 USD per million PDF pages for GPT-4o". Google's Document AI made its generative custom extractor generally available on 9 January 2024 and in the Singapore region on 29 February 2024. Its newer Gemini-based extractor models are still in Preview.

Why it matters for your business

Indonesian insurers, clinic networks and distributors live on paper turned into PDFs: claim forms, invoices, KTP copies, lab results. Unlike Scribd's essays, the value sits in fields, not themes. We found no published figure for how much of this paperwork is scanned or photographed, so we will not guess.

Language support is uneven. Google says its OCR reads text, "including handwritten text, from documents in more than 200 languages". Microsoft's language page lists Indonesian for printed text, but not in its handwriting table. Amazon's FAQ says "Handwriting, Invoices, and Receipts, Identity documents, and Queries processing are in English only." Test on your own documents.

The law already treats this as serious. Under UU 11/2008, Pasal 5 says "Informasi Elektronik dan/atau Dokumen Elektronik dan/atau hasil cetaknya merupakan alat bukti hukum yang sah", and Pasal 6 adds the condition that it can be "diakses, ditampilkan, dijamin keutuhannya, dan dapat dipertanggungjawabkan". Under UU 27/2022 (PDP), health data is specific personal data, and Pasal 29(1) requires the controller to ensure "akurasi, kelengkapan, dan konsistensi Data Pribadi". Pasal 34 asks for an impact assessment when processing specific data or using new technology. Our reading: an extraction error is a data-quality problem with a legal edge. Not legal advice; check with counsel.

How we would build it today

Our diagram titled Fields first, a person on the misses, for an Indonesian insurer, clinic network or distributor, in three bands. Sort and define: classify the document type, such as claim form, invoice, KTP, lab result or other, then keep a field list per type with required or optional, format and allowed values. Extract and check: a layout-aware model, a managed service or hosted vision model, returns fields in your schema; plain rules check that totals add up, dates parse and the NIK has 16 digits; a person reviews only the failures and low-confidence results. Measure and keep the trail: a golden set of a few hundred real documents with field accuracy reported every month, and one record holding the original file, extracted fields, model version and the reviewer's change. A note says under UU PDP health data is specific data, so check the Pasal 34 impact assessment before launch.
Write the field list before choosing a model, and send only the misses to a person. Diagram: MORARI. Source: Scribd

Picture an insurer or clinic network handling a few thousand claim documents a month.

  1. Write the field list first. Per document type: claim number, date, total, provider, with format and allowed values.
  2. Classify before extracting. Scribd's routing step, applied to claim form, invoice, KTP, lab result and other.
  3. Rent the model. At this volume a managed extractor or hosted vision model beats training your own. Price it on your own page count.
  4. Test Indonesian handwriting and phone photos. Run 50 to 100 real documents through two or three engines before choosing.
  5. Validate with plain rules. Totals add up, dates parse, a NIK has 16 digits.
  6. Send only the misses to a person. Failures and low confidence go to review, the same idea as Scribd's 2026 judge and reviewer.
  7. Keep a golden set. A few hundred documents labelled by the people who know the paperwork, with field accuracy reported monthly. Scribd's 2021 post published none; do better.
  8. Protect IDs and health data. Redact or crop before anything leaves your systems, and set retention up front.
  9. Keep the trail. Original file, fields, model version and the reviewer's change in one record, for Pasal 6 and for comparing model upgrades.

Start with one document type beside the manual process for a month. For one type, steps 1 to 6 are probably two to three weeks of work.