From eba0d4aa25c7751d759fa43a1452ba4f365304ef Mon Sep 17 00:00:00 2001 From: Minho Park Date: Sun, 31 Oct 2021 15:07:17 +0900 Subject: [PATCH] fix #137 contexts matrix dtype error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sent_to_word_contexts_matrix 에서 dynamic_weight=False시 contexts_matrix가 long type이 되어 GloVe에 fit 시 에러 발생가능한 부분 수정 --- soynlp/vectorizer/_word_context.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soynlp/vectorizer/_word_context.py b/soynlp/vectorizer/_word_context.py index f959516..99a2362 100644 --- a/soynlp/vectorizer/_word_context.py +++ b/soynlp/vectorizer/_word_context.py @@ -119,4 +119,4 @@ def _encode_as_matrix(word2contexts, vocab2idx, verbose): print(' - (word, context) matrix was constructed. shape = {}{}'.format( x.shape, ' '*20)) - return x \ No newline at end of file + return x.astype(float)