代码之家  ›  专栏  ›  技术社区  ›  jonb

在自定义模型中使用pyLDAvis

  •  0
  • jonb  · 技术社区  · 6 年前

    我有一个经过训练的自定义LDA模型(希伯来语),我想使用pyLDAvis来可视化它。

    我指的是文档和以下资源:

    但是我仍然不明白prepare方法的输入是什么样子的。

    topic_term_dists:array-like, shape (n_topics, n_terms)
    Matrix of topic-term probabilities. Where n_terms is len(vocab).
    
    doc_topic_dists :array-like, shape (n_docs, n_topics)
    Matrix of document-topic probabilities.
    
    doc_lengths :array-like, shape n_docs
    The length of each document, i.e. the number of words in each document. The order of the numbers should be consistent with the ordering of the docs in doc_topic_dists.
    
    vocab :array-like, shape n_terms
    List of all the words in the corpus used to train the model.
    
    term_frequency :array-like, shape n_terms
    The count of each particular term over the entire corpus. The ordering of these counts should correspond with vocab and topic_term_dists.
    

    0 回复  |  直到 6 年前