Skip to content

Example code producing novelty, transience, and resonance for a sample of legislative speech during the French Revolution.

Notifications You must be signed in to change notification settings

CogentMentat/NTRexample_FRevNCA

Repository files navigation

NTRexample_FRevNCA

Example code producing novelty, transience, and resonance for a sample of legislative speech during the French Revolution, as documented in Individuals, Institutions, and Innovation in the Debates of the French Revolution.

See also the associated dataset!

Data

Scripts

Get help on arguments for each python file via python <script name>.py -h.

  • calculate_novelty_transience_resonance.py takes a text file of topic mixtures as rows and produces the three named measures.
  • learn_topics.py produces topics, topic mixtures, and vocabulary given a text file, one document per row. In this example, documents are speeches.
  • text_topic_ntr.py is a convenience script taking a file of documents, producing topics, and creating novelty, transience, and resonance in succession.
    • make_example_NTR.sh provides a command-line example for using this script.

Notebooks

  • density_plots_TvN_RvN.ipynb creates density plots for transience v. novelty and resonance v. novelty.

Script requirements (versions used)

  • python (2.7)
  • numpy (1.13.1)
  • scikit-learn (0.19.0)
  • lda (1.0.5)

Notebook requirements

  • jupyter (1.0.0)
  • matplotlib (2.0.2)
  • pandas (0.20.3)

About

Example code producing novelty, transience, and resonance for a sample of legislative speech during the French Revolution.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published