aboutsummaryrefslogtreecommitdiffstats
path: root/tf_idf.py
blob: a4692f7635af679262683bfa52e98110d8ff418d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import math as maths
import database

def main():
    with database.Database() as db:
        db.build_tf_idf_table()

        db.get_tf_idf_table()
        db.get_tf_idf_table2()

def calc_log_tf(tf):
    if tf == 0:
        return 0
    else:
        return maths.log10(1 + tf)

if __name__ == "__main__":
    main()