Skip to content

Instantly share code, notes, and snippets.

View aenal-abie's full-sized avatar

Zaenal Abidin aenal-abie

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):