Comments (4)
I apologize my code does not seem to be rendering correctly. Please let me know if I can clarify better
from textminer.
Hi @Frank5547. I can't reproduce your example without data, but I think I know what's going on. Your trigram matrix is huge. Fortunately, you can get rid of many of the columns without impacting your end result. Because of Zipf's law, most of your trigrams will only appear once or twice throughout the entire corpus. You can get rid of them by typing
dtm <- dtm[, colSums(dtm) > 1]
or
dtm <- dtm[, colSums(dtm > 0) > 1]
The first prunes trigrams that only appear once. The second prunes trigrams that only appear in one document.
But you may not need trigrams. I generally don't use them because the risk of building a model that does not generalize is too high. I noticed you set ngram_window = c(3,3)
, which only gives you trigrams and not unigrams or bigrams. Try ngram_window = c(1,2)
. That's what I usually use and there's usually lots of signal there. (You should still prune infrequent tokens as they will make training time much longer without adding anything worthwhile to the model.)
I'm going to close as this isn't really an issue with textmineR. But please feel free to comment again if you have any questions. I'll help out where I can.
from textminer.
You were right it turns out I only needed bigrams after all. I know this reply comes in late, but I wanted to thank you for your comment to my post. It came in handy later on to be reminded of Zipf's Law and that I can delete all the terms with frequency of 1 without losing value.
from textminer.
from textminer.
Related Issues (20)
- Fill out implementation details in FitLdaModel and update.lda_topic_model HOT 1
- Discrepancy in topic content when summarizing and visualizing with LDAvis HOT 5
- Thinning/Lag of the sampler HOT 3
- License is not super clear HOT 4
- CalcProbCoherence algorithm unclear HOT 1
- CalcTopicModelR2 HOT 6
- Prior information on topics (e.g. Seeded LDA/Guided LDA) HOT 7
- LDAvis HOT 2
- Sparsity makes it more likely to have misses resulting in "negative probability" errors HOT 1
- FitCtmModel does not respect arguments from topicmodels::CTM HOT 2
- CalcTopicModelRsquared fails when called in FitLdaModel
- custom stop word list HOT 5
- CalcHellingerDist seems to modify in place HOT 5
- Switch to {mvrsquared}
- Choosing the numbers of topics ERROR Parallel HOT 4
- test HOT 1
- how to obtain word assignment of the original dataset? HOT 2
- vignette part 5 has error? HOT 1
- CreateTcm does not use multithreading
- How to use the Mallet in textmineR?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from textminer.