Bag-of-Words Model
Overview
D1 = ['John', 'bought', 'a', 'book', '.', 'The', 'book', 'was', 'funny', '.']
D2 = ['Mary', 'liked', 'the', 'book', '.', 'John', 'gave', 'it', 'to', 'Mary', '.']W = [
'.', # 0
'John', # 1
'Mary', # 2
'The', # 3
'a', # 4
'book', # 5
'bought', # 6
'funny', # 7
'gave', # 8
'it', # 9
'liked', # 10
'the', # 11
'to', # 12
'was' # 13
]Implementation
References
Last updated
Was this helpful?