Skip to main content

reading-impact-model

Reading Impact Model for analyzing reading impact in online book reviews.

The Impact of Fiction

How does your favorite book make you feel?

If you’re an avid reader, this question might be hard to answer. Books can make us feel extatically happy or deeply sad. Books can inspire us, motivate us, or make us feel like we are a part of something that matters. As long as stories have existed, they have made people laugh, and they have made people cry.

In this research project, we are trying to measure the emotional impact of books and stories, by analyzing the kind of emotional responses that readers express in online reviews.

The Impact of Fiction is a project of the Huygens Institute and the KNAW Humanities Cluster, coordinated by Peter Boot (Huygens) and Marijn Koolen (KNAW Humanities Cluster).

Computational Analysis of Reading Impact

There are millions upon millions of reviews on the internet today. Because of the staggering number of online reviews available, computational analysis is the ideal tool for analyzing them. But emotional impact is not easy to detect computationally. That’s why we’ve created a list of words relating to features from literature (aspect-terms) and a list of words relating to literature’s emotional impact (impact-terms) and a set of rules formulated to measure impact in relation to specific aspects.

Here’s an example:

lovely + character = narrative engagement
[impact-term] + [aspect-term] = type of impact

By looking at examples from a large set of online reviews, we formulated more than 1300 rules of this kind, measuring different types of impact. For an explanation of our categories of impact, go to the “Explanation of impact” page.

Here’s another example: In 2020, researchers at the Huygens Institute completed a similar research project on Dutch online reviews. They found, among other things, that Harry Potter and the Half-Blood Prince scored exceptionally high on use of the word “magisch” (magical). Any human who knows Harry Potter could guess that this doesn’t mean an exceptionally high number of reviewers had a magical reading experience. Rather, in reference to Harry Potter, the word “magical” has little to do with emotional response because the plot is actually about magic.

There are lots of other fun and interesting things you could do if you had a clear sense of the emotional impact of books. For example, this previous study into Dutch reviews suggested that appreciation of a novel’s style is linked to reflection on that novel. On the other hand, narrative engagement and mentions of style or reflection are negatively correlated, meaning that books that are have a very engaging, often suspenseful narrative are less frequently described as having an affecting style or inviting reflection. Think of your favorite thriller: is this true in that case?

Installation and Usage

You can install the package via pip:

pip install reading-impact-model

Basic usage of the English language impact model:

from reading_impact_model.matchers.matcher import ImpactMatcher

matcher = ImpactMatcher(lang='en')

matcher.analyse_text('The book has beautiful writing.', doc_id='some_doc_id')

Which gives the following output:

[{'doc_id': 'some_doc_id',
  'sentence_index': None,
  'sentence': 'The book has beautiful writing.',
  'reflection': 0,
  'style': 1,
  'attention': 0,
  'humor': 0,
  'surprise': 0,
  'narrative': 0,
  'negative': 0,
  'positive': 1,
  'match_index': 3,
  'impact_term_type': 'term',
  'impact_term': 'beautiful',
  'impact_type': 'Style',
  'match_lemma': 'beautiful',
  'match_word': 'beautiful',
  'condition_match_index': 4,
  'condition_term': 'writing',
  'condition_match_lemma': 'writing',
  'condition_type': 'style',
  'condition_match_word': 'writing'}]

There are different matchers that can incorporate syntax parsers to add POS and lemma information to word tokens, for improved rule matching.

E.g. the SpacyMatcher accepts a Spacy parser (and requires you to have installed spacy and an appropriate language model.)

from reading_impact_model.matchers.spacy_matcher import SpacyMatcher
import spacy

nlp = spacy.load('en_core_web_trf') 
matcher = SpacyMatcher(parser=nlp)

Which matches the lemma sentence instead of the word sentences, which is not in the aspect dictionary.

[{'doc_id': 'some_doc_id',
  'sentence_index': 0,
  'sentence': 'The book contains some beautifully written sentences.',
  'style': 1,
  'surprise': 0,
  'negative': 0,
  'narrative': 0,
  'humor': 0,
  'attention': 0,
  'reflection': 0,
  'positive': 1,
  'match_index': 4,
  'impact_type': 'Style',
  'impact_term': 'beautifully',
  'match_word': 'beautifully',
  'impact_term_type': 'term',
  'match_lemma': 'beautifully',
  'condition_type': 'style',
  'condition_match_word': 'sentences',
  'condition_match_index': 6,
  'condition_match_lemma': 'sentence',
  'condition_term': 'sentence'}]

Citing

If you use this package, please cite the following publications:

Contributors

The reading-impact-model package was developed by Marijn Koolen. The rule set and dictionaries were created by Peter Boot, Julia Neugarten and Marijn Koolen.

The following people are or have been involved in the Impact & Fiction project:

  • Peter Boot
  • Marijn Koolen
  • Joris van Zundert
  • Julia Neugarten
  • Olivia Fialho
  • Willem van Hage
  • Ole Mussmann
  • Carsten Schnober

Metadata

Release files for reading-impact-model 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for reading-impact-model 1.0.3
File Size Uploaded Provenance Actions
reading_impact_model-1.0.3.tar.gz 785.7 kB Without provenance Details for reading_impact_model-1.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for reading-impact-model 1.0.3
File Interpreter ABI Platform Actions
reading_impact_model-1.0.3-py3-none-any.whl Python 3 none any Details for reading_impact_model-1.0.3-py3-none-any.whl

Total release size: 1.5 MB

Release files / reading_impact_model-1.0.3.tar.gz

Download URL reading_impact_model-1.0.3.tar.gz
Size 785.7 kB
Tags Source
SHA-256 checksum
How to use checksums
550aacabe0d1be4dc61bda3735113f6d306083cf559199143dc63f0355b4c675
BLAKE2b-256 checksum
How to use checksums
2e72f4c47e664670d357ffdba0a0e25ec6d5d55c33e96e68880e43992a24efa4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.9

Release files / reading_impact_model-1.0.3-py3-none-any.whl

Download URL reading_impact_model-1.0.3-py3-none-any.whl
Size 705.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b36b7139525ca0ff9f7dd248f9528082c366f35fcfcb9be1b63488e100d1eac0
BLAKE2b-256 checksum
How to use checksums
b01e783d4d0d5f9699a1197fcc3fd373993cffac7e33d54b1d9428f833f7b6c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.9

Security for reading-impact-model 1.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page