Skip to content

Commit 5f81450

Browse files
authored
Update word_frequency_functions.py
1 parent 272a5fd commit 5f81450

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

machine_learning/word_frequency_functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def document_frequency(term: str, corpus: str) -> int:
8181
documents = corpus_without_punctuation.split("\n")
8282
lowercase_documents = [document.lower() for document in documents]
8383
return (
84-
len([document for document in lowercase_documents if term.lower() in document]),
84+
len([doc for doc in lowercase_documents if term.lower() in doc]),
8585
len(documents),
8686
)
8787

0 commit comments

Comments
 (0)