SkillAgentSearch skills...

EnronTopicModelling

Topic Modelling the Enron Emails

Install / Use

/learn @coreylynch/EnronTopicModelling
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

This uses gensim's online latent dirichlet allocation implementation to topic model the Enron Email dataset. The Enron Emails contain 517,431 emails from 150 Enron executive accounts covering a period from December 1979 through February 2004, with the majority of emails occurring during 1999, 2000, and 2001. After training, we can infer 100 latent topics in the corpus. Topics are interpreted by their probability distribution over words.

Example topic word distributions:

  • topic #34: 0.010nymex + 0.008exchange + 0.007futures + 0.007member + 0.005clearing + 0.005notice
  • topic #15: 0.011game + 0.006fantasy + 0.005football + 0.005wr + 0.005play + 0.005rb
  • topic #39: 0.007emissions + 0.007environmental + 0.005etrade + 0.005epa + 0.005lcampbensf + 0.004permit
  • topic #76: 0.006chairman + 0.005president + 0.004ceo + 0.004global + 0.004businesses + 0.004chief
  • topic #17: 0.022sally + 0.013beck + 0.012becks + 0.010sbecknsf + 0.007*sallybeckdec
  • topic #96: 0.004agreement + 0.003credit + 0.003language + 0.003such + 0.003section + 0.003under
  • topic #58: 0.006california + 0.005market + 0.005said + 0.004iso + 0.004electricity + 0.004ferc

With a trained model we can also infer, for each email, a probability distribution over topics. With each email represented as a vector of topic probabilities, we can do things like cluster similar emails together via the cosine similarity measure, or assign topics to new unseen documents (like user queries) and retrieve all emails that match that topic. Each email gets stored in mongo alongside its dominant topic, it's full distribution, as well as some metadata (e.g. from, to, date, etc.). This allows us to build higher level analysis like the graphs of topic frequency over time.

The Enron emails can be obtained here: http://www.cs.cmu.edu/~enron/

Dependencies:

  • gensim - online (memory-independent) topic modeling. Read more here: http://radimrehurek.com/gensim/
  • pymongo
  • matplotlib for plotting analysis of email topic distributions

Related Skills

View on GitHub
GitHub Stars22
CategoryDevelopment
Updated2mo ago
Forks13

Languages

Python

Security Score

75/100

Audited on Jan 21, 2026

No findings