NLP and Graph-Theory-based Coding for Text (Corpus) Analysis. A Comparative Poetry and Philosophy Implementation Case Study

Tanasescu, Chris;et.al.
(2021) Digital Humanities Quarterly — (2021)

Files

No attached file found for this publication.

Details

Authors
  • Tanasescu, ChrisUCLouvain
    Author
  • et. al.
Abstract
The case study analyzes a Python script—written by the first author and adapted by the second for her own tasks—and its extra-functional relevance to two different research projects comparatively (extra-functional in the sense foregrounded in the CFP). The code combines natural language processing (NLP) and graph theory applications to represent textual corpora as networks and analyze the latter for features (mainly centralities) reflecting on the corpora and the relationships between their texts or between several corpora. The projects are the Graph Poem (UCLouvain and UOttawa) and The Normalization of Philosophy (U of Groningen). The code is used for analyzing poetry corpora in either English or French, and early modern European philosophical corpora in English and/or French and/or Latin, respectively. Yet while the poetry project explores English or French corpora that are compared cross-lingually only when the former consist of translations of the poems in the latter, the philosophy project deals with multilingual corpora on a regular basis, as there are either authors who wrote in two or three languages, or regions/communities/institutions in early modern Europe with significant bilingual or trilingual output. The comparative analysis comports therefore two main categories of aspects: genre and programming-language-related ones. For the former, the discussion briefly reviews the relevant facets of a couple of the NLP tools developed by the first author and his team for automated poetry analysis (mainly the diction and the rhyme classifiers) as well as the work done by the second author to adapt the code for her philosophy corpora (processing obsolete language or spellings, processing and analyzing multilingualism, etc.). In terms of the programming language used (Python), the study features a brief critique of the coding libraries and resources the script taps into, such as NLTK, a GitHub repo for bilingual NLP (which the second author repurposed for generally multilingual purposes), and the FastText word embeddings. While, for instance, the NLTK stop-word sets were altered differently for the two projects and the poetry implementation had the NLTK lemmatizing part commented out, running the code on philosophy corpora included combining NLTK with CLTK for the cases when one of the languages was Latin. The FastText embeddings turned out to generally work really well for philosophy tasks, and in certain respects even better than usually assessed. For example, setting the Latin embeddings as central and translating the vectors in the other languages to these ones (rather than the other way round) proved effective for corpora in which most of the texts were in Latin. The poetry project, not involving multilingual analysis within the same corpus, has not utilized FastText so far, but a version of the same code that does, has been used by the first author to generate bilingual (English and French) poetry.
Affiliations

Citations

Tanasescu, C., & et al. (2021). NLP and Graph-Theory-based Coding for Text (Corpus) Analysis. A Comparative Poetry and Philosophy Implementation Case Study. Digital Humanities Quarterly. Submitted. https://hdl.handle.net/2078.5/22612 (Original work published 2021)