简体   繁体   中英

Topic Coherence with Dictionary from Glove (gensim)

I'm trying to evaluate a home-made topic model. For this, I'm using the list of topics (represented by keywords), and want to use a gensim.models.coherencemodel.CoherenceModel , and call it on a corpus, which is a list of strings (each one being a document). The CoherenceModel requires a Dictionary , but I don't understand what this corresponds to, and how I can get it. I'm using the TfidfVectorizer from sklearn to vectorize the text, and glove embeddings from gensim to compute similarities within my model.

From the docs, a Dictionary can be created from a corpus where the corpus is a list of lists of str . This same corpus should be passed in the text argument of the CoherenceModel .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM