stm에서 텍스트 분석을위한 439 개의 관측치가있는 데이터 세트로 작업하고 있습니다. textProcessor를 사용하면 몇 가지 이유로 관측 수가 438로 변경됩니다. 나중에 findThoughts() 함수를 사용할 때 문제가 발생합니다.textProcessor는 내 corpus의 관측 수를 변경합니다 (R의 stm 패키지 사용)
##############################################
#PREPROCESSING
##############################################
#Process the data for analysis.
temp<-textProcessor(sovereigncredit$Content,sovereigncredit, customstopwords = customstop, stem=FALSE)
meta<-temp$meta
vocab<-temp$vocab
docs<-temp$documents
length(docs) # QUESTION: WHY IS THIS 438 instead of 439, like the original dataset?
length(sovereigncredit$Content) # See, this original one is 439.
out <- prepDocuments(docs, vocab, meta)
docs<-out$documents
vocab<-out$vocab
meta <-out$meta
이 선 아래로 문제가되는 예는 다음과 같습니다
thoughts1<-findThoughts(sovereigncredit1, texts=sovereigncredit$Content,n=5, topics=1)
하는 출력은 다음과 같습니다
"findThoughts (sovereigncredit1, 텍스트는 = sovereigncredit의 $ 내용의 오류 , : 제공되는 텍스트 수와 모델 수가 일치하지 않음 "
"sovereigncredit1"은 위의 "out"을 기반으로하는 주제 모델입니다.
내 해석이 정확하다면 (또 다른 실수를 저 지르지는 않을 것입니다.)이 문제는 전후 처리 관찰 수의 차이가있는 것으로 보입니다.
지금까지 원본 csv를 살펴본 결과 439 개의 유효 관측과 빈 행이 없는지 확인했습니다. 나는 무슨 일이 일어날 지 모르겠다. 어떤 도움을 주시면 감사하겠습니다!