Digitising Roger Cooter's Biobibliography

History of Phrenology Research Environment


Digitising Roger Cooter's Biobibliography

Last update: 04 September 2026


This page documents the methodologies used to digitise and generate metadata from Roger Cooter's Phrenology in the British Isles (Scarecrow: London, 1989). It is an active, human-written working document and will be updated as the project develops.

Rationale behind the digitisation

The main reason for digitising Roger Cooter's biobibliography is to establish a metadata database that can be used to improve the HTR accuracy for the Combe correspondence and to aid with the process of Named Entity Recognition (NER) of that correspondence. Named entities are places, persons, societies, specimens etc. The field of NER was surveyed by Humbel, et.al (2019) at the eve of recent revolutionary LLM developments that made Ai technologies more powerful, affordable and widespread. They concluded that NER technologies require authoritative knowledgebases for NER, even though these knowledgebases were apt to inherit colonial and hegemonic views. More recently, Hiltmann, et.al. (2025) have demonstrated that the use of state-of-the-art LLMs for NER can be improved significantly more by providing contextual expert domain knowledge information, than by prompt engineering.

As a seed for a knowledgebase, we chose Roger Cooter's Phrenology in the British Isles (Scarecrow: London, 1989) because it is the most comprehensive biographical and bibliographical survey of British phrenology, and because its structured presentation makes it particularly suitable for digitisation into a database. Furthermore,  The digitisation and metadata extraction of this volume provided an opportunity to assess how well metadata extraction from a given OCR/HTR text performs using deterministic rules (Python Regex functions) vs using prompt-based black box LLM metadata extraction, and how metadata extraction can be improved via prompt design.

Going forward, we envision an extended iterative knowledgebase of relational NER data that informs and is informed by the HTR process. 

Metadata extraction details

A parallel metadata extraction pipeline was developed that used the output of an initial structural scanner and populated metadata fields of a predetermined scheme using RegEx and LLM methods (GPT-5-nano and GPT-5-mini). It should be clarified at the outset that a AI models (ChatGPT-5.5 and GPT-5.6-Luna) were used in coding assistance, debugging, project architecture and Entity scheme generation. While AI assistance has been employed conservatively and iteratively, it is recognised that this could introduce unidentified bias. Indeed, it would also have been possible to generate the database straight from agentic prompts, rather than establishing the pipeline below. In order to preserve a reproducible methodology, a more robust QA process and a more reliable audit trail, this option was not chosen.

The entirety of Roger Cooter's Phrenology in the British Isles (Scarecrow: London, 1989) was scanned as a PDF file using the vFlat Scan app on an Apple iPhone 16e. After deskewing, page reordering and text OCR using the vFlat Scan functions, the raw text was saved as a txt file. The extraction pipeline was implemented using Python 3.14. A Regex-based scanner extracted initial structural data from the txt file and created an "Entry" object. Using Cooter's numbering scheme and the PDF page information, the "Entry" object contained the following fields: identifier[e.g. 3.1], parent_identifier [e.g. 3.], major [number, e.g. 3], minor [number, e.g. 1], entry type [person, non-person, child], pdf_page, printed_page and raw text [from OCR]. Cooter's consistent numbering system made the separation of entries and their classification relatively straightforward. For instance, in Cooter's volume, all person entries are identified by an integer followed by a full stop (1., 2., etc.). Non-persons (e.g. societies and publications) are identified by an integer followed by a full stop, followed by a zero (15.0, 25.0 etc.). Bibliographic entries are child entries belonging to the corresponding person or non-person (3.1, 45.15, etc.). The scanner could easily identify these and logical operators have been implemented to minimise the impact of OCR errors. While the general principle has been to preserve the messy OCR output as it is, some small amendments to punctuation and line recognition were made to eliminate errors. LLM verification via ChatGPT was used to identify these errors and the total number of manual changes to the OCR text file is less than 50. The scanner extracted 1031 person entries, 203 non-person entries (152 publications and 51 societies) and 2,126 bibliographic entries. These numbers are slightly different from the numbers Roger Cooter gives in his introduction where he states that the book contains 1,029 person entries, 2,207 bibliographical references and 50 entries on phrenological institutions and societies. The exact source of this inconsistency has not been established, but since they are mostly concentrated in the less important bibliographical data, it was not deemed significant.

From here, the RegEx and LLM pipelines diverged. Before the RegEx functions could be made to work on the cleaned OCR text, Roger Cooter's cross-cross references, which appeared throughout the volume at the end of individual entries with the identifier [See:], had to be separated, as they interfered with data extraction. For the LLM run, these cross referepnces were kept in the OCR data and explicitly ignored by the LLM prompt. Following this separation, the RegEx pipeline first separated the non-person entries into separate society and publication entries (via keyword identification) and then used separate metadata extractors for persons, journals, societies and bibliographical entries to extract a range of fields according to a pre-determined model for a new EditorialEntry object. Fields were populated by each extractor according to the type of objects and an SQL database was generated from the extracted structural and metadata. An initial list of fields included display_name; surname; forenames; birth_year; death_year; title_prefix; title_suffix; start_year; end_year; publication_frequency; founded_year; place; description; publication_type; publication_year_text; publication_year; publisher; edition; journal_title; volume; page_start; page_end; page_count, but the schema was subsequently expanded for the LLM extraction. The aim was not to achieve complete metadata extraction, nor perfectly accurate metadata but rather to produce a useful baseline for comparison with LLM metadata extraction. A full compiler parser paradigm using semantic analysis was not implemented at this stage, as the dataset was deemed too small to warrant it.

Once a RegEx baseline database was created, a separate and parallel AI pipeline was created using OpenAI's API, implemented via the University of Edinburgh's ELM platform. LLM queries were made using the output of the structural parser and the two most cost-effective models available by the OpenAI API - GPT-5-nano and GPT-5-mini (Temperature: Default - Reasoning: Minimal) - were chosen for the test runs. LLM queries emphasised a conservative approach in populating the metadata fields, and the LLMs were instructed not to touch the structural data, nor alter the raw data which was retained for QA and source tracing purposes. For the initial runs, the average input + output token use was less than 1,000.

Comparison between RegEx and LLM

All three SQL databases (RegEx, nano and mini) were then inspected visually via a data browser and via QA queries using ChatGPT-5. The rate of metadata extraction between RegEx and the LLM models was comparable for persons, but differed in journals and societies, and especially for the bibliographical entries, where the complexity of Cooter's nested bibliographical entries proved particularly difficult for the RegEx extraction.

The percentages below represent the proportion of applicable metadata fields populated across the records within each entry type.

Entry type Records Regex GPT-5-Mini GPT-5-Nano
People 1,031 56.0% 57.9% 54.9%
Journals / publications 152 41.7% 59.3% 50.5%
Societies 51 64.7% 71.9% 58.2%
Bibliographical entries 2,126 27.5% 56.2% 64.3%

Substantial differences were found between the three databases in metadata extraction as shown below. The following comparison excludes the 2,126 bibliographical entries, where the Regex extraction was substantially less complete. The figures represent the number of records in which the two databases contain different values for the specified field. However, a difference does not necessarily indicate an error.

Field Regex vs Mini Regex vs Nano Mini vs Nano
surname 25 215 230
forenames 180 214 143
birth_year 21 37 18
death_year 25 42 22
title_prefix 74 75 99
title_suffix 231 110 250
publication_frequency 31 19 37

Overall, the GPT-5-mini database agreed more closely with the deterministic RegEx baseline database, which indicated that there were fewer hallucinations in the data provided by the GPT-5-mini runs. Some of these differences were due to mini preserving capitalisation of surnames (BAYNES vs Baynes), which nano improperly normalised. In other cases, however, nano failed to extract a surname, or it extracted the wrong part of the name (e.g. EHN, Louis Henri: mini: EHN, nano: Henri). Overall, the nano model was found to extract metadata more aggressively than the mini model, including instances where it inferred information not supported by Cooter's text. For instance, for the very first entry "ABELL, Richard, MD Edin 1822; born in Ireland," nano interpreted 1822 as the year of birth (which was not given by Cooter). Mini left the birth_year field blank. On this basis, the GPT-5-nano model, although costing around 5 times less than the GPT-5-mini model was discarded and the RegEx database retained as a conservative reference model. 

Prompt Refinement

Further tests were made with the GPT-5-mini model to improve precision and recall of metadata. The main testing regime consisted of 20 runs of LLM metadata that randomly sampled 10-40 entries from Cooter's volume each, followed by human and AI assisted QA inspection and prompt engineering. In order to facilitate testing and generate clearer audit trail every full and partial run generated a separate SQL database file that included a timestamp, information about the llm model used and the full prompt wording. The testing run identified and addressed errors such as incorrect field population (for instance giving a founded_year or publication_frequency for person entries) and improved the accuracy of the overall extraction by prompt engineering. This increased the number of tokens used to around 1,600 input and output tokens per entry. It should be noted that due to the nature of LLMs this does not make the run entirely reproducible, even if the same prompts and schemes are used. 

Further testing and prompt refinement is ongoing and the most recently generated databases can be selected in the database viewer.