Skip to content

Instantly share code, notes, and snippets.

View jdavidheiser's full-sized avatar

James Davidheiser jdavidheiser

View GitHub Profile
import math
from text.blob import TextBlob as tb
def tf(word, blob):
return blob.words.count(word) / len(blob.words)
def n_containing(word, bloblist):
return sum(1 for blob in bloblist if word in blob)
def idf(word, bloblist):