Getting repeated terms after Latent Dirichlet allocation
<p>I was trying this for Latent Dirichlet allocation implemenation but getting repeated terms.How can I unique terms from LDA?</p>
<blockquote>
<p>library(tm)<br />
Loading required package: NLP<br />
myCorpus &lt;- Corpus(VectorSource(tweets$text))<br />
myCorpus &lt;- tm_map(myCorpus, content_transformer(tolower))<br />
removeURL &lt;- function(x) gsub(&quot;http[^[:space:]]<em>&quot;, &quot;&quot;, x)<br />
myCorpus &lt;- tm_map(myCorpus, content_transformer(removeURL))<br />
removeNumPunct &lt;- function(x) gsub(&quot;[^[:alpha:][:space:]]</em>&quot;, &quot;&quot;, x)<br />
myCorpus &lt;- tm_map(myCorpus, content_transformer(removeNumPunct))<br />
myStopwords &lt;- c(stopwords('english'), &quot;available&quot;, &quot;via&quot;)<br />
myStopwords &lt;- setdiff(myStopwords, c(&quot;r&quot;, &quot;big&quot;))<br />
myCorpus &lt;- tm_map(myCorpus, removeWords, myStopwords)<br />
myCorpus &lt;- tm_map(myCorpus, stripWhitespace)<br />
myCorpusCopy &lt;- myCorpus<br />
myCorpus &lt;- tm_map(myCorpus, stemDocument)<br />
library('SnowballC')<br />
myCorpus &lt;- tm_map(myCorpus, stemDocument)<br />
dtm&lt;-DocumentTermMatrix(myCorpus)<br />
library(&quot;RTextTools&quot;, lib.loc=&quot;~/R/win-library/3.2&quot;)<br />
library(&quot;topicmodels&quot;, lib.loc=&quot;~/R/win-library/3.2&quot;)<br />
om1&lt;-LDA(dtm,30)<br />
terms(om1)</p>
</blockquote>
<p><img src="https://i.stack.imgur.com/KzecE.jpg" alt="This is the output" /></p>