diff options
Diffstat (limited to 'tf_idf.py')
-rw-r--r-- | tf_idf.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tf_idf.py b/tf_idf.py new file mode 100644 index 0000000..615720d --- /dev/null +++ b/tf_idf.py @@ -0,0 +1,17 @@ +import math as maths +import database + +def main(): + with database.Database() as db: + db.build_tf_idf_table() + + db.get_tf_idf_table() + +def calc_log_tf(tf): + if tf == 0: + return 0 + else: + return maths.log10(1 + tf) + +if __name__ == "__main__": + main()
\ No newline at end of file |