November 2018
Beginner to intermediate
348 pages
8h 32m
English
Enough about normalization. We now turn our focus to stopwords.
Recall from Chapter 2, Linear Regression–House Price Prediction, that stopwords are words such as the, there, from, and so on. They're connective words, useful in understanding the specific context of sentences, but for a naive statistical analysis, they often add nothing more than noise. So, we have to remove them.
A check for stopwords is simple. If a word matches a stopwords, we'll return false for whether to add the word ID into the sentence:
if _, ok = stopwords[word]; ok { return -1, false }
Where does the list of stopwords come from? It's simple enough that I just wrote this in stopwords.go:
const sw = `a about above across after afterwards again ...
Read now
Unlock full access