I used LDA to build a topic model for 2 text documents say A and B. document A is highly related to say computer science and document B is highly related to say geo-science. Then I trained an lda using this command :
text<- c(A,B) # introduced above
r <- Corpus(VectorSource(text)) # create corpus object
r <- tm_map(r, tolower) # convert all text to lower case
r <- tm_map(r, removePunctuation)
r <- tm_map(r, removeNumbers)
r <- tm_map(r, removeWords, stopwords("english"))
r.dtm <- TermDocumentMatrix(r, control = list(minWordLength = 3))
my_lda <- LDA(r.dtm,2)
now i want to use my_lda to predict the context of a new document say C and i want to see if it is related to computer Science or geo-science. i know if i use this code for prediction
x<-C# a new document (a long string) introduced above for prediction
rp <- Corpus(VectorSource(x)) # create corpus object
rp <- tm_map(rp, tolower) # convert all text to lower case
rp <- tm_map(rp, removePunctuation)
rp <- tm_map(rp, removeNumbers)
rp <- tm_map(rp, removeWords, stopwords("english"))
rp.dtm <- TermDocumentMatrix(rp, control = list(minWordLength = 3))
test.topics <- posterior(my_lda,rp.dtm)
It will give me a label 1 or 2 and I don't have any idea what 1 or 2 represents... How can I realize if it means computer science related or geo-science related?