I have a function which take a dictionary af words and a sentence (sent). The problem is that in this loop :
for word in s:
It doesn't take words per words (words coposinf the sentence), but character per character.
I don't know why.
Any idea please?
Thanks
def compute_tfidf(word_counter, sent):
word_counter = {}
total_count = 0
no_of_sentences = 0
sents_emd = []
print(sent)
for s in sent :
total_count = total_count + len(s)
no_of_sentences = no_of_sentences + 1
for word in s:
print(word)
print(word_counter[word])
return sents_emd