Data quality, place by place
Coverage, freshness and sources per fact for Portugal, the Algarve and every town, computed at each build and served as JSON first.
On this page
What PrompTugal.news knows about each place, measured: how complete each fact is, how fresh the reads are, and how many independent sources the facts rest on. Every number is computed at each build from the place agents' files and served as JSON first: api/v1/places/quality.json for all the places, and api/v1/places/<id>/quality.json for one. This page draws that JSON; nothing here exists only in HTML.
The places
How it is measured
- facts: A fact is one local AI story, one AI map entry, one event or one figure in the place agent's file, after the checks the place page applies (http(s) links only).
- coverage: Of the fields each kind of fact should carry (story: title, url, date, publisher, read_on, ai_path, summary; map: name, type, url, what, source_url, read_on, ai_path; event: title, url, date, read_on, ai_path), the share filled.
- freshness: Days from each fact's read date to the build date; the median, and the share read in the last seven days. A score of 1 when the median read is today, falling to 0 at 30 days.
- sources: The host of each fact's source (source_url, else url). Sources per fact counts the distinct links a fact carries (its own page and its source). Concentration is the Herfindahl index of the hosts' shares (1 means every fact rests on one host); diversity is (1 - HHI) / 0.8, capped at 1.
- volume: Facts / 30, capped at 1.
- score: round(100 x (0.35 completeness + 0.25 freshness + 0.25 diversity + 0.15 volume)). A guide to where research is thin, not a judgement of a town.
The JSON-first audit
For every kind of page, how many of the sources it links to some served JSON file holds: api/v1/datasci/audit.json. For the by-place pages the rule is strict: the gate fails a build where a place page shows a source its own endpoints do not hold. The specs: Swagger.