I am trying to conduct LSA on interviews scripts and I get this error

Viewed 13

I am trying to conduct LSA on R on the text of 4 interviews I conducted. When I come to this code:

k_result <- many_models %>%
  mutate(exclusivity = map(topic_model, exclusivity),
         semantic_coherence = map(topic_model, semanticCoherence, textdfm),
         eval_heldout = map(topic_model, eval.heldout, heldout$missing),
         residual = map(topic_model, checkResiduals, textdfm),
         bound =  map_dbl(topic_model, function(x) max(x$convergence$bound)),
         lfact = map_dbl(topic_model, function(x) lfactorial(x$settings$dim$K)),
         lbound = bound + lfact,
         iterations = map_dbl(topic_model, function(x) length(x$convergence$bound)))

I get this error:

Error in `mutate()`:
! Problem while computing `eval_heldout = map(topic_model, eval.heldout, heldout$missing)`.
Caused by error in `missing$docs[[i]]`:
! subscript out of bounds

I don't know how to solve it, can anyone help me?

0 Answers
Related