Filling the Temporal Void: Recovering Missing Publication Years in the P roject G utenberg Corpus Using LLM s (2025)

Abstract: Analysing texts spanning long periods of time is critical for researchers in historical linguistics and related disciplines. However, publicly available corpora suitable for such analyses are scarce. The Project Gutenberg (PG) corpus presents a significant yet underutilized opportunity in this context, due to the absence of accurate temporal metadata. We take advantage of language models and information retrieval to explore four sources of information – Open Web, Wikipedia, Open Library API, and PG books texts – to add missing temporal metadata to the PG corpus. Through 20 experiments employing state-of-the-art Large Language Models (LLMs) and Retrieval-Augmented Generation (RAG) methods, we estimate the production years of all PG books. We curate an enriched metadata repository for the PG corpus and propose a refined version for it, which includes 53,774 books with a total of 3.8 billion tokens in 11 languages, produced between 1600 and 2000. This work provides a new resource for computational linguistics and humanities studies focusing on diachronic analyses. The final dataset and all experiments data are publicly available (https://github.com/OmarMomen14/pg-dates).

## introduction diachronic text analysis (dta) is a pivotal area of study that encompasses various disciplines and objectives. linguists examine the evolution of language over time, analyzing changes in word meanings @xcite , morphological structures @xcite , and syntactic patterns @xcite . natural language processing (nlp) practitioners engage with texts from different historical periods to develop models that can handle language variation over time @xcite . humanities scholars study social, political, and cultural trends by analyzing texts from specific time periods (dinu and uban, 2023). to facilitate effective dta studies, it is essential to have access to a publicly available corpus of texts annotated with their time of production. texts that can only be roughly dated are ultimately worthless to dta when it comes to performing analyses based on precise time periods. although project gutenberg (pg) foot_1 offers a high potential corpus for dta, it is rarely considered in many studies. pg is a widely recognized digital library that provides access to a large collection of free ebooks. established in 1971 by michael s. hart, pg aims to promote the creation and distribution of digital literature. as of february 2025, pg offers over 75 000 free ebooks in more than 60 languages, covering a diverse range of literary works, including classic novels, historical texts, and reference materials. despite its extensive size, linguistic diversity, and historical depth, pg has not been widely adopted as a standard corpus in dta. a key limitation is the absence of temporal metadata specifying the year of writing or publishing each book in the corpus. the only temporal information available in the pg records is the release date of the book on the pg web portal, which does not correspond to the book's time of writing or publication. this lack of temporal annotation not only undermines the potential of the pg corpus, but also introduces ambiguity and leads to misinterpretation. one reason is that external platforms and web crawlers of online libraries and bibliographic databases often misattribute the pg release date as the publication date of the book, hampering efforts to fill this gap. this paper addresses the problem of missing temporal metadata in pg books by highlighting its core challenges ( § 3) and exploring potential solutions ( § 4). we conduct a comprehensive set of experiments ( § 5) on all the pg books published before 01.09.2024 (our cut-off date), leveraging a we then experiment with 3 methods of information retrieval, a search engine, rag pipelines, and curated retrieving strategies based on our own observations. we feed the retrieved contents as contexts within prompts to 3 variants of llms @xcite . we then retrieve the temporal answer from the llms responses and validate them. eventually, we get 20 temporal estimations for 72 103 pg books, with varying degrees of time accuracy that is measured based on our proposed validation set. the key contributions of this work are: ## related work accurate time-labeling of books remains a critical yet underexplored challenge in the study of language change. researchers investigating diachronic changes in texts usually rely on standard historical corpora, but these corpora are often constrained by issues such as licensing restrictions, coarse temporal granularity, limited time intervals, and narrow genre representation. for example, the corpus of historical american english (coha) @xcite ) contains about 406 million words from 1810-2009 with year labels; but it contains only english texts, and its use is limited by fees. while the corpus of contemporary american english (coca) @xcite offers a collection of texts containing about one billion words from 1990-2020, it is also not freely available, and its time interval is not sufficient for many studies. freely accessible resources such as the corpus of late modern english texts (cl-met) @xcite , which includes 34 million words from 1710-1920 with year labels, and the hansard uk parliament corpus @xcite , with 1.6 billion words from 1803-2005, provide valuable alternatives, even though they suffer from either limited size or limited genres. comparable efforts in other languages further underscore these challenges: gerparcor @xcite and deuparl @xcite compile extensive collections of german parliamentary debates with detailed metadata that enable fine-grained analyses of formal language change. all these resources highlight the inherent limitations of current corpora and emphasize the need for a large, diverse, freely available corpus with accurate time labels to robustly track language change. before the era of llms, few approaches have been developed to assign a precise production year to a document. early methods, such as @xcite , estimated publication dates by analyzing time-series features derived from a text's content. @xcite reframed document dating as a multi-class text classification problem, leveraging bidirectional gated recurrent units to capture subtle temporal cues. more recently, @xcite propose employing graph convolutional networks to jointly exploit syntactic and temporal structures within documents. nonetheless, the overall accuracy of these methods remains very modest relative to the precision required for robust dta, highlighting the need for further improvements in document dating techniques. to the best of our knowledge, only one prior study has addressed the problem of temporal labelling of the pg books. @xcite attempted to standardize pg by annotating the pg books with estimated time labels derived from the author's lifespan. however, this sole study resulted in coarse estimations (author's lifespan) of the production year of a book, rather than an exact year of production. it also failed to find any time estimations for books of unknown authors, or for authors of unknown lifespan. ## core challenges determining the exact year when a book was written varies in difficulty from book to book, depending on factors such as the popularity of the book or its author, the number of its editions, or its published metadata in freely accessible sources. the books in the pg vary drastically in this regard. in literary records, the most commonly documented temporal attribute of a book is its date of publication, rather than its date of creation. however, a book may be republished multiple times, resulting in different publication dates in different editions. consequently, it is difficult to determine a single authoritative year for a book's publication, let alone its original creation date. in practice, the earliest known year of publication is often used as an approximation of the creation date. to avoid confusion between the creation year and the publication year of a book, we consider the earliest known publication year of a book and call it the book's production year. estimating the production year of a book is particularly challenging due to the scarcity and fragmentation of relevant information. for wellknown books or authors, this information can be inferred from the book's metadata in open access sources, and it can also be validated by evidence from biographies or literary studies. however, such sources are limited and often unavailable for lesserknown works. moreover, the available records are often inconsistent, incomplete, or even contradictory. the process of aggregating and reconciling these scattered data points is non-trivial, especially when dealing with large collections spanning multiple genres and languages. to further analyze the task of determining a book's production year, identify its challenges, and gain insight into potential solutions, we conducted a preliminary study: we randomly selected 15 book titles (10 in english and 5 in german) from the pg corpus and attempted to determine their production years. the primary goal was to assess the availability and reliability of temporal information in different sources. to maximize coverage, we leveraged a variety of information sources known to contain bibliographic and historical data. specifically, we examined online libraries represented by the library of congress, google books, worldcat, and open library, knowledge bases represented by wikipedia, llms with web search represented by chatgpt-4o, and the book's content itself by skimming the first and last pages of the book. by manually querying these sources, we evaluated their effectiveness in retrieving accurate production years and highlight the key challenges associated with our task. the detailed annotations and queries/prompts used in this experiment are presented in appendix a. according to this preliminary study, we find that online libraries often lack information about books, and in many cases only provide the same metadata available in pg, which unfortunately adds a confusing layer to the problem. wikipedia generally contains fairly accurate information, but only for well-known books or authors who have their own pages. chatgpt-4o demonstrates great capability in identifying accurate production years by leveraging its web search capabilities alongside its reasoning capabilites. a source # successful determination loc catalog 5 worldcat 7 open library 8 google books 9 wikipedia 8 chatgpt 13 book content 12 from this preliminary study, we conclude that no source alone provides accurate temporal information about a book's publication year. in order to obtain an accurate dating, the results from different sources should be aggregated and heuristics should be applied to select the most likely correct result. ## methods figure 1 outlines our approach; in this section, we elaborate and justify it. we discuss the three main layers in our methodology: knowledge sources, information retrievers and temporal reasoners. knowledge sources based on our preliminary study, we decide to use four knowledge sources in our temporal labelling experiments: (1) the open web, since temporal metadata can be found in numerous types of web pages (e.g., online libraries, online bookstores, genre-specific book platforms); information retrievers to retrieve the most relevant information regarding the production year of a book from the open web, we use searxng 3 an open-source search engine that aggregates the 3 https://docs.searxng.org/ search results of more than 80 search engines including google search. additionally, we use rag pipelines to retrieve the most relevant texts from the wikipedia dumps and the books contents. finally, we use our own observations from our preliminary study that the usual locations of production year mentions in pg books are on their first and last pages. temporal reasoners the retrieved content for a given book -which is not structured data -needs to be reasonably processed to get a valid estimate of its production year. a human can easily do such processing, but we are interested in processing the whole pg corpus. we decide to use state-of-the-art (sota) llms, which have good temporal reasoning capabilities. studies such as @xcite show a significant lag between humans and llms in many temporal reasoning skills, however, they show satisfactory performance when asked to identify the oldest or most recent year in a passage. we use variants of llama3.1 (meta, 2024), gemma2 @xcite , and mistral nemo (mistral ai team, 2024). validation method a central result of our preliminary study is the discovery of metadata fields in the biography tables on the pg web portal that are not included in the metadata files provided by the maintainers. first, for books uploaded to the pg web portal after january 2022, there is a new field, original publication, which contains information about the publisher and publication year of the book. second, we observe that most books contain a recently added field with an automatically generated summary. these summaries can provide an approximate period in which the book was written, such as "early 19th century" or "late 18th century". third, we identify a metadata field recording the reading ease score, which quantifies the linguistic complexity of the book. these metadata provide valuable information for solving our detection task, so we collect the summaries and the readability scores to investigate their relevance to our study. we extract the original publication years for books uploaded after january 2022, resulting in a subset of 7 168 books, which represents about 10% of the entire pg collection at our cutoff date. we use this subset as a validation set in our study. experiment val. acc. err. baselines base llama .65 .09 13y base gemma .77 .09 11y base mistral .99 .10 14y open web llm web .72 .78 9y rag rag wikipedia .93 .29 20y rag book .99 .57 10y context based on observations llm first .95 .65 9y llm first/last .99 .84 6y llm first/last/summary .99 .83 7y llm whole .71 .78 9y llm first/last with different prompts llm detailed-prompt .98 .70 24y llm lifespan .99 .79 8y llm first/last with different models llama .99 .81 7y llama full precision .99 .77 10y llama 70b .99 .82 8y mistral nemo .98 .84 7y wizardlm .94 .66 26y online queries open library api .76 .53 17y coarse estimations author lifespan (33s) .84 .63 -author lifespan (100s) .84 .79 -summary (33s) .99 .81 -summary (100s) .99 .91 -llm first/last (10s) .99 .90 -llm first/last (20s) .99 .92 -llm first/last (33s) .99 .95 -llm first/last (50s) .99 .96 -llm first/last (100s) .99 .97 - ## experiments we evaluate several variations of our approach using a strict metric that measures the exact match between the estimated production year and the year annotated in our validation set. results of all experiments are presented in ## extended pg corpus we release the results of all experiments for 72 103 pg books, along with the cleaned raw text used as context. for each book, we provide a tokenized version and a sentence-split version. this dataset serves as a valuable resource for dta studies and research on llms' temporal reasoning capabilities.