Skip to content

sent_to_word_contexts_matrix 내 dynamic_weight 관련 문제 #137

@smbslt3

Description

@smbslt3
from soynlp.vectorizer import sent_to_word_contexts_matrix

x, idx2vocab = sent_to_word_contexts_matrix(
    corpus,
    windows=3,
    min_tf=10,
    tokenizer=tokenizer, # (default) lambda x:x.split(),
    dynamic_weight=False,
    verbose=True
)

위 코드와 https://lovit.github.io/nlp/representation/2018/09/05/glove/ 게시물을 참고하여 Glove를 학습시키는데,
dynamic_weight를 False로 하는 경우에

glove.fit(x.tocoo() 에서
ValueError: Buffer dtype mismatch, expected 'double' but got 'long' 라는 에러가 발생합니다.

동일한 데이터/코드 상태에서 dynamic_weight=True인 경우, glove-python 자체 Corpus()를 통해 학습시키는 경우
문제 없이 학습 및 동작합니다.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions