Skip to content

Commit

Permalink
Merge pull request #3606 from flairNLP/scipy_update
Browse files Browse the repository at this point in the history
fix: update scipy .A to toarray()
  • Loading branch information
alanakbik authored Feb 1, 2025
2 parents e2865f7 + 0b95bcd commit 005ec45
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion flair/embeddings/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def embed(self, sentences: Union[list[Sentence], Sentence]):
sentences = [sentences]

raw_sentences = [s.to_original_text() for s in sentences]
tfidf_vectors = torch.from_numpy(self.vectorizer.transform(raw_sentences).A)
tfidf_vectors = torch.from_numpy(self.vectorizer.transform(raw_sentences).toarray())

for sentence_id, sentence in enumerate(sentences):
sentence.set_embedding(self.name, tfidf_vectors[sentence_id])
Expand Down

0 comments on commit 005ec45

Please sign in to comment.