nlp-notebooks
nlp-notebooks copied to clipboard
Reshaping not implemented for csr_matrix.
Multilingual Embeddings - 2. Cross-lingual Sentence Similarity.ipynb questions["tfidf_en_sim"] = [cosine_similarity(q1.reshape(1, -1), q2.reshape(1, -2))[0,0] for q1, q2 in zip(questions1_all_en_tfidf_en, questions2_all_en_tfidf_en)] 22 23 questions["tfidf_enfr_sim"] = [cosine_similarity(q1.reshape(1, -1), q2.reshape(1, -2))[0,0]
~\AppData\Roaming\Python\Python36\site-packages\scipy\sparse\base.py in reshape(self, shape, order) 127 """ 128 raise NotImplementedError("Reshaping not implemented for %s." % --> 129 self.class.name) 130 131 def astype(self, dtype, casting='unsafe', copy=True):
NotImplementedError: Reshaping not implemented for csr_matrix.
您好!请问这是什么原因呀?
第二个问题是 data/multilingual_embeddings/questions.csv 文件中的 is_duplicate列是什么意思呀?
question1_en question2_en 都是不一样的啊 不管is_duplicate是不是等于1 期待您的回复!