Live data from Hacker News

Teaching a Computer to Read: NLP Hacking in Python

blog.scripted.com

1–10 of 25 posts

Re: Teaching a Computer to Read: NLP Hacking in Python

#3
post #2

How do you deal with keeping your super rare words list sensible? For many forms of technical writing I could see things getting out of hand where you have lots of tiny dense clusters not really close to anything else if you didn't manage the list well.

As with most successful applications of machine learning, it's about finessing your approach based on the problem at hand. In our case, we have classes divided on the level of "Medicine," "Real Estate," etc. So, we could throw away lots of words that only occurred once or twice in the massive corpus we crawled to build the language model and still have a pretty robust representation of the subject you're trying to represent.

Re: Teaching a Computer to Read: NLP Hacking in Python

#4
post #3
post #2

How do you deal with keeping your super rare words list sensible? For many forms of technical writing I could see things getting out of hand where you have lots of tiny dense clusters not really close to anything else if you didn't manage the list well.

As with most successful applications of machine learning, it's about finessing your approach based on the problem at hand. In our case, we have classes divided on the level of "Medicine," "Real Estate," etc. So, we could throw away lots of words that only occurred once or twice in the massive corpus we crawled to build the language model and still have a pretty robust representation of the subject you're trying to re…

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.

Re: Teaching a Computer to Read: NLP Hacking in Python

#5
The CPU cost to do use this approach is terribly high. I don't think this approach is going to give better results than a few simple rules and NLTK would.

This API will do a better job telling you what an article is about. https://www.mashape.com/stremor/stremor-noun-phrase-and-part...

That said, the approach we use for our TLDR software and search rankings doesn't rely on just frequency, the adjectives that amplify the content, the sentences with emotion attached to them, and the "charge" of words matters too much.

Consider the following:

That frakking loser Drakaal came over and hijacked my NLP thread. Just because he does NLP for a living, and thinks he knows everything doesn't mean a thing. My NLP is way cooler because it uses machine learning and that is the future of NLP, not the heuristics model he uses for his stuff.

What is the "core" of that? Clearly it is about how Drakaal sucks, but we only mention him once. NLP is important, machine learning is important, but really it is about why Drakaal sucks.

Re: Teaching a Computer to Read: NLP Hacking in Python

#6
post #5

The CPU cost to do use this approach is terribly high. I don't think this approach is going to give better results than a few simple rules and NLTK would. This API will do a better job telling you what an article is about. https://www.mashape.com/stremor/stremor-noun-phrase-and-part... That said, the approach we use for our TLDR software and search rankings doesn't rely on just frequency, the adjectives that amplify…

i've actually found the performance of gensim (the topic modeling python module i use here) to be pretty great. we're not at a scale where CPU performance is make or break just yet, so i haven't done any comprehensive testing of performance. but i've definitely not run into any performance issues worth complaining about. however, gensim is 100% based on lazy evaluation where it can be, so it's relatively light on the CPU. i love NLTK as well, but it did lack in the dimensionality reduction/topic modeling department which gensim did so beautifully. LDA + SVM seemed like an interesting approach to go with, and it didn't disappoint.

Re: Teaching a Computer to Read: NLP Hacking in Python

#7
post #6
post #5

The CPU cost to do use this approach is terribly high. I don't think this approach is going to give better results than a few simple rules and NLTK would. This API will do a better job telling you what an article is about. https://www.mashape.com/stremor/stremor-noun-phrase-and-part... That said, the approach we use for our TLDR software and search rankings doesn't rely on just frequency, the adjectives that amplify…

i've actually found the performance of gensim (the topic modeling python module i use here) to be pretty great. we're not at a scale where CPU performance is make or break just yet, so i haven't done any comprehensive testing of performance. but i've definitely not run into any performance issues worth complaining about. however, gensim is 100% based on lazy evaluation where it can be, so it's relatively light on the…

The issue with Genism is you have to know what you are trying to analyze before you analyze it. It doesn't do well if you use the wrong corpus or if like you mention start with a million word corpus.

If you were analyzing emails in a single organization all day you could probably sort out topics really well. Doing all of the web it breaks down because it gets less accurate the larger the variety of content.

Re: Teaching a Computer to Read: NLP Hacking in Python

#9
post #5

The CPU cost to do use this approach is terribly high. I don't think this approach is going to give better results than a few simple rules and NLTK would. This API will do a better job telling you what an article is about. https://www.mashape.com/stremor/stremor-noun-phrase-and-part... That said, the approach we use for our TLDR software and search rankings doesn't rely on just frequency, the adjectives that amplify…

I tried to test your example with your API, but it requires a credit card even for the freemium plan. Is there any way you can make a rate limited API that never charges to avoid that? I'm not familiar with mashape so it may not be possible.
Post reply on HN