Earlier quoted context omitted.
In fact, if your training corpus is sufficiently large, you'd be shocked how many words you can eliminate right away for a term frequency of one or two. I went from millions of words in the vocabulary to something like 60k just by ignoring words that happen once or twice in the corpus. Plus, you probably won't learn much about the relationships between words if they only occur a few times in the corpus.
Yeah, but consider that some rare words are much stronger indicators of topic than more common ones. Even more so if you look at n-grams. If you use something like wordnet you can get a lot of meaning out of low-frequency words and throw away the meaningless higher-frequency ones that occur in too many categories to be useful.
Teaching a Computer to Read: NLP Hacking in Python
21–25 of 25 posts
Re: Teaching a Computer to Read: NLP Hacking in Python
#22Earlier quoted context omitted.
Saw you are trying it out. Awesome! Sorry the documentation is a bit weak right now, we had people wanting it so we got it out, rather than getting all the docs complete.
I did try it out. It does a good job of pulling out different bits and categorizing them. I went ahead and ran the example you had and put it up to continue the conversation( https://gist.github.com/adpreese/6722561 ). If you want me to take it down, I will certainly respect that but I thought it'd be convenient for anyone else paying attention. The noun phrases part of the response gave a concise list of things, inc…
One of the API's takes a URL, one takes plaintext or HTML, not sure which one you hit, but the TLDRStuff.com will make it really easy for you to play.
Re: Teaching a Computer to Read: NLP Hacking in Python
#23Earlier quoted context omitted.
Saw you are trying it out. Awesome! Sorry the documentation is a bit weak right now, we had people wanting it so we got it out, rather than getting all the docs complete.
I did try it out. It does a good job of pulling out different bits and categorizing them. I went ahead and ran the example you had and put it up to continue the conversation( https://gist.github.com/adpreese/6722561 ). If you want me to take it down, I will certainly respect that but I thought it'd be convenient for anyone else paying attention. The noun phrases part of the response gave a concise list of things, inc…
Re: Teaching a Computer to Read: NLP Hacking in Python
#24Word counter: http://scikit-learn.org/stable/modules/generated/sklearn.fea...
Hashing vectorizer if you want to trade off explainability for speed and scalability: http://scikit-learn.org/stable/modules/generated/sklearn.fea...
TF-IDF weighing: http://scikit-learn.org/stable/modules/generated/sklearn.fea...
Also, if you transform bag-of-words vectors into a dense form, you're gonna have a bad time (insert appropriate meme picture here). In large corpora, dimensionality grows quite substantially - if you work with news corpora or Wikipedia, you're in the 100k-1M dimensional space pretty quickly.
Great to see an approachable explanation for NLP. As they say sometimes, when you know how it's done, it stops being "Artificial Intelligence".