Dustin S. Stoltz and Marshall A. Taylor
If you are interested in using Concept Mover's Distance, please use the following R package:
install.packages("text2map")
And, see the CMDist
vignette.
This is the original code and data to reproduce the measures, graphs, and plots for Stoltz and Taylor (2019) "Concept Mover's Distance," forthcoming in the Journal of Computational Social Science. A preprint is available on SocArxiv at https://osf.io/preprints/socarxiv/5hc4z/.
In the paper, we propose a method for measuring a text's engagement with a focal concept using distributional representations of the meaning of words. In our approach, which we call Concept Mover's Distance, a document is measured by the minimum distance the words in the document need to travel to arrive at the position of a "pseudo document" consisting of only words denoting a focal concept.
To reproduce the figures in the paper, download all scripts and CSVs to a local folder, and load the packages in the 1_cmd_jcss_packages.R script. The remaining scripts are self-contained, and refer to the respective section of the paper. Some of the figures require downloading text from Project Gutenberg which may take some time.
Note that the CMDist
function in this repository is the original, and is likely outdated.