> For the complete documentation index, see [llms.txt](https://krke-project.gitbook.io/exploring-f.-scott-fitzgerald-novels-with-ta/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://krke-project.gitbook.io/exploring-f.-scott-fitzgerald-novels-with-ta/text-analysis.md).

# Text Analysis

<mark style="background-color:yellow;">A descriptive analytics approach to 3 novels by</mark> [<mark style="background-color:yellow;"><mark style="color:blue;">**F. Scott Fitzgerald**<mark style="color:blue;"></mark>](https://en.wikipedia.org/wiki/F._Scott_Fitzgerald) <mark style="background-color:yellow;">-</mark> <mark style="background-color:yellow;"></mark><mark style="background-color:yellow;">**«This Side of Paradise»**</mark><mark style="background-color:yellow;">,</mark> <mark style="background-color:yellow;"></mark><mark style="background-color:yellow;">**«The Beautiful and Damned»**</mark> <mark style="background-color:yellow;"></mark><mark style="background-color:yellow;">and</mark> <mark style="background-color:yellow;"></mark><mark style="background-color:yellow;">**«The Great Gatsby»**</mark><mark style="background-color:yellow;">. Includes</mark> <mark style="background-color:yellow;"></mark>*<mark style="background-color:yellow;">Vocabulary Comparison</mark>*<mark style="background-color:yellow;">,</mark> <mark style="background-color:yellow;"></mark>*<mark style="background-color:yellow;">Conversation Frequencies</mark>*<mark style="background-color:yellow;">,</mark> <mark style="background-color:yellow;"></mark>*<mark style="background-color:yellow;">Word Frequencies</mark>*<mark style="background-color:yellow;">,</mark> <mark style="background-color:yellow;"></mark>*<mark style="background-color:yellow;">Sentiment Analysis</mark>*<mark style="background-color:yellow;">,</mark> <mark style="background-color:yellow;"></mark>*<mark style="background-color:yellow;">Topic Modelling</mark>* <mark style="background-color:yellow;"></mark><mark style="background-color:yellow;">and</mark> <mark style="background-color:yellow;"></mark>*<mark style="background-color:yellow;">Lexical Despersion Plot</mark>*<mark style="background-color:yellow;">.</mark>

I used Python, relying primarily on the [pandas](https://pandas.pydata.org/), [re](https://docs.python.org/2/library/re.html) and [nltk](https://www.nltk.org/) libraries. I used R language only to create Lexical Dispersion Plots. The majority of visualizations were generated using the [plotly](https://plotly.com/) website.

<figure><img src="/files/WJkl8BjZAfoTHjicM1ZA" alt=""><figcaption></figcaption></figure>

Raw text files for the novels were acquired courtesy of [Project Gutenberg](https://www.gutenberg.org/), a website that hosts books not protected by U.S. copyright law, usually due to copyright expiration.

I downloaded the Plain Text UTF-8 options for each book:

1. [«This Side of Paradise»](https://www.gutenberg.org/ebooks/805)
2. [«The Beautiful and Damned»](https://www.gutenberg.org/ebooks/9830)
3. [«The Great Gatsby»](https://www.gutenberg.org/ebooks/64317)

[Project Gutenberg](https://www.gutenberg.org/) adds extra license and disclaimer information before and after the actual text of each novel, so it was necessary to split the text files on the delimiters, such as the title/author and 'the end'. Next, I decoded the text, and made some substitutions using the [re library](https://docs.python.org/2/library/re.html), like replacing double hyphens, which Fitzgerald sometimes uses when a new speaker starts talking, with a space, and some odd quotation marks with their regular counterparts.

Additionally, the Project Gutenberg versions of both **«This Side of Paradise»** and **«The Beautiful and Damned»** are split by books and chapters, which I decided to ignore, handling plain text only. **«The Great Gatsby»** is split only by Roman numerals as indicators of chapters.

{% hint style="info" %} <mark style="color:red;">**Disclaimer**</mark>\
The purpose of this gitbook is to conduct text analysis on F. Fitzgerald's novels , as an end-of-course project for the "Digital Text in the Humanities: Theories, Methodologies and Applications" course of the Master's Degree in Digital Humanities and Digital Knowledge of the University of Bologna, held by professor Tiziana Mancinelli. All the materials were downloaded from [Project Gutenberg](https://www.gutenberg.org/) and are used exclusively for educational purpose.
{% endhint %}

{% file src="/files/Qox6GciMrw2hlIUaPAuC" %}

{% embed url="<https://github.com/anitavishinskaite/F.-Scott-Fitzgerald>" %}
