Rob Davidson
December 13, 2014
getPred<-function(ngram) {
Key<-spooky.32(ngram)
if (!(is.na(collisionTable[.(Key)]$n1gram[1]))) {return(getCollision(ngram))}
return(finalTable[.(Key)]$predicted)
}
Hashed Keys for Quick Retrieval with Collision Management: Keys for access hashed using spooky.32 algorithm. Collisions for known ngrams identified and correctly resolved
3-grams and 4-grams with only one occurrence removed from model. This reduced the size of model 10-fold but drastically reduced accuracy.
text<-removeWords(text,profane)
text<-removeWords(text,stopwords("english"))
text<-gsub("(http)[^ ]*"," ",text)
text<-gsub("(www)[^ ]*"," ",text)
text<-gsub("\\w*\\.(com)"," ",text)