Skip to content
This repository was archived by the owner on Oct 11, 2023. It is now read-only.
This repository was archived by the owner on Oct 11, 2023. It is now read-only.

The code in the chapter #24

@nininininini

Description

@nininininini

Does there some code issue in the chapter1? such as Example 1-1. The following code in
the example 1-1, xticklabels = vocab, I can't find the vocab was stated in the previous text.
and if run this code, can't show any image. It likes the code loss import the matplotlib and should add the code plt.show().

from sklearn.feature_extraction.text
import CountVectorizer import seaborn as sns
corpus = ['Time flies flies like an arrow.', 'Fruit flies like a banana.']
one_hot_vectorizer = CountVectorizer(binary=True)
one_hot = one_hot_vectorizer.fit_transform(corpus).toarray()
sns.heatmap(one_hot, annot=True, cbar=False, xticklabels=vocab, yticklabels=['Sentence 2'])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions