Skip to content

h1-the-swan/jargon_distance

Repository files navigation

Jargon Distance

Jason Portenoy 2018

Implement the jargon distance measure from Vilhena et al. “Finding Cultural Holes: How Structure and Culture Diverge in Networks of Scholarly Communication.” (2014)

Installation

Install from PyPI:

pip install jargon-distance

Usage

Initialize a JargonDistance instance with a term_counts dict and (optionally) a group_map dict. term_counts is a mapping of document -> term counter (Counter object).

from jargon_distance import JargonDistance
j = JargonDistance(term_counts)

Then, calculate the jargon distances:

j.calculate_jargon_distance()
j.write_to_file('jargon_distance.csv')

The jargon_distance.analysis module can be used to visualize the jargon distance calculations. For example, below is a dendrogram showing the jargon distances between the text (unigrams) of different works of literature (from the demo.ipynb notebook).

Dendrogram showing the jargon distance between different works of literature.

See demo.ipynb for a more detailed example.

About

Calculate jargon distance metric between texts

Resources

License

Stars

Watchers

Forks

Packages

No packages published