Closed gsalfourn closed 4 years ago
The code in the paper is using an older API. I recently released version 3.0.0 of cleanNLP on CRAN. I also posted a revised set of code replicating the analyses in the R Journal paper on the State of the Union Addresses here:
https://statsmaths.github.io/cleanNLP/state-of-union.html
It uses the new versions' functions and should work if you reinstall a new version of cleanNLP.
I am using the following: R version 3.6.1 (2019-07-05) RStudio Version 1.2.1335 cleanNLP version 2.3.0
the code for what I am running is below: it's from the 2017 publication of Taylor Arnold. i haven't made any modifications to it. when i ran the code to get estimate of speech length, it throws an error: "Error in FUN(X[[i]], ...) : object 'year' not found"
my thought is that for some reason the meta data file sotu_meta is not being appended to the sotu_text file
see sequence of codes below
intiliaze the spacy backend
cnlp_init_spacy()
run the annotator
sotu <- cleanNLP::cnlp_annotate(sotu_text, as_strings = TRUE, meta = sotu_meta)
estimate length of sotu speeches
Joining, by = "id"
the error message
Error in FUN(X[[i]], ...) : object 'year' not found