Skip to content

A simple TFIDF (Term Frequency - Inverse Document Index) calculator in python

Notifications You must be signed in to change notification settings

mirsamantajbakhsh/TFIDF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TFIDF

A simple TFIDF (Term Frequency - Inverse Document Index) calculator in python You can view test folder to see examples. It is simple. You can put a simple list of terms (a document)

self.doc1 = ['Harry', 'Potter', 'series', 'was', 'written', 'by', 'famous', 'author', 'JKRowling']
self.doc2 = ['JRRTalkin', 'wrote', 'famous', 'The', 'Lord', 'Of', 'The', 'Rings', 'series', 'with', 'extra', 'of']
self.doc3 = ['I', 'love', 'Harry', 'and', 'Ron', 'and', 'Hermione']
self.doc4 = ['wizards', 'Hobbits', 'are', 'not', 'wizards', 'but', 'are', 'stranger', 'than', 'wizards']
        
resDoc1 = DocumentClass(self.doc1)
resDoc2 = DocumentClass(self.doc2)
resDoc3 = DocumentClass(self.doc3)
resDoc4 = DocumentClass(self.doc4)
        
print resDoc2.getTTIDF('of')

will print 2.77

About

A simple TFIDF (Term Frequency - Inverse Document Index) calculator in python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages