IDEAS home Printed from https://ideas.repec.org/a/sae/somere/v54y2025i3p794-848.html
   My bibliography  Save this article

From Codebooks to Promptbooks: Extracting Information from Text with Generative Large Language Models

Author

Listed:
  • Oscar Stuhler
  • Cat Dang Ton
  • Etienne Ollion

Abstract

Generative AI (GenAI) is quickly becoming a valuable tool for sociological research. Already, sociologists employ GenAI for tasks like classifying text and simulating human agents. We point to another major use case: the extraction of structured information from unstructured text. Information Extraction (IE) is an established branch of Natural Language Processing, but leveraging the affordances of this paradigm has thus far required familiarity with specialized models. GenAI changes this by allowing researchers to define their own IE tasks and execute them via targeted prompts. This article explores the potential of open-source large language models for IE by extracting and encoding biographical information (e.g., age, occupation, origin) from a corpus of newspaper obituaries. As we proceed, we discuss how sociologists can develop and evaluate prompt architectures for such tasks, turning codebooks into “promptbooks.†We also evaluate models of different sizes and prompting techniques. Our analysis showcases the potential of GenAI as a flexible and accessible tool for IE while also underscoring risks like non-random error patterns that can bias downstream analyses.

Suggested Citation

  • Oscar Stuhler & Cat Dang Ton & Etienne Ollion, 2025. "From Codebooks to Promptbooks: Extracting Information from Text with Generative Large Language Models," Sociological Methods & Research, , vol. 54(3), pages 794-848, August.
  • Handle: RePEc:sae:somere:v:54:y:2025:i:3:p:794-848
    DOI: 10.1177/00491241251336794
    as

    Download full text from publisher

    File URL: https://journals.sagepub.com/doi/10.1177/00491241251336794
    Download Restriction: no

    File URL: https://libkey.io/10.1177/00491241251336794?utm_source=ideas
    LibKey link: if access is restricted and if your library uses this service, LibKey will redirect you to where you can use your library subscription to access this item
    ---><---

    More about this item

    Keywords

    ;
    ;
    ;
    ;
    ;

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:sae:somere:v:54:y:2025:i:3:p:794-848. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    We have no bibliographic references for this item. You can help adding them by using this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: SAGE Publications (email available below). General contact details of provider: .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.