Skip to content

Bug in text.py line 738 #2353

@alemagnani

Description

@alemagnani

in text.py there is a bug at line 738

   X = sp.csr_matrix((values, j_indices, indptr),
                      shape=(len(indptr) - 1, len(vocabulary)),
                      dtype=self.dtype)

the shape shold not be len(vocabulary) but
max(vocabulary.itervalues()) + 1

this is because some of the indeces might repeat in the vocabulary

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