Sentiment analysis

AI and historical research at scale

For historians working with vast digital corpora, AI offers genuine transformative potential. It automates labour-intensive tasks and facilitates analyses that would be impossible for a single researcher to complete. This shift is already reshaping historical scholarship. Early digital humanities approaches used machine learning for text clustering, topic modelling, and vector-based analyses. Large language models (LLMs) have since widened the scope for qualitative inquiry, whilst foregrounding questions of bias in training data and irreducible uncertainty (Clavert and Muller 2024).

From ingestion to large-scale analysis

IWAC uses AI to speed up optical character recognition (OCR) and entity extraction. The next challenge is analysing large amounts of data. Although smartphones and inexpensive cameras generate an abundance of material digitised from archives, this sometimes exceeds the capacity of human attention. Frédérick Madore's experience is a case in point: he has thousands of digitised pages that remain unread. Computational methods can scan the corpus, identify patterns and highlight thematic shifts that manual workflows overlook. LLM-assisted distant reading then prioritises material, enabling historians to focus on contextualisation, source criticism and interpretation.

Experiment: AI as a research "partner"

This project explores the potential of AI as a research partner in analysing large bodies of sources. Specifically, the experiment involves assigning interpretative tasks to LLMs for the evaluation of over 10,000 articles on Islam in IWAC.

What sentiment analysis can add

Sentiment analysis reveals the tone and evaluative language used in texts. This makes it particularly useful for tracking how newspapers frame issues over time. In this study, two LLMs, guided by task-specific prompts, assessed the representation of Islam and Muslims in IWAC's newspaper corpus. Each article received three scores: (1) the overall emotional orientation (polarity), (2) the degree of journalistic objectivity, and (3) the centrality of Islam-related themes within the piece.

Method and outputs

The exercise began with a clear question: how do West African newspapers portray Islam and Muslims? Rather than spending months on manual coding, two LLMs were used to classify the full set of relevant articles. The prompt focused on media representations in Francophone West Africa. For each article, the models produced ratings of polarity (from very negative to very positive), subjectivity (from very objective to very subjective) and centrality, along with brief justifications, creating a traceable analytical record. An interactive dashboard organises the results for exploration and comparison, and importantly makes the utility and opacity of AI decision-making visible.

Why use AI here? A pragmatic rationale

Many scholars caution against integrating AI into historical research, citing environmental costs, the erosion of close-reading skills, and the risk of delegating analysis to opaque systems (cf. Penner 2024). Our use of LLMs is pragmatic. We treat them as an "intuition pump"—a tool for thinking with, not a substitute for scholarship (Bajohr 2025). LLM-enabled distant reading can rapidly and consistently triage large corpora, compressing months of screening into hours and identifying the most pertinent items for close examination. This hybrid workflow combines algorithmic pattern recognition with human interpretative depth: historians remain in the loop for contextualisation, source criticism, and argumentation. Classifications are provisional and auditable through stored prompts and rationales, and final claims are based on human evaluation.

Interactive findings: sentiment and framing across IWAC