Adding the link to sklearn's documentation on how their TF-IDF slightly differs from textbook's: https://scikit-learn.org/stable/modules/feature_extraction.html#tfidf-term-weighting