liveBook · Manning

Pointwise mutual information

As explained in AI-Powered Search

Pointwise mutual information is a measure of how much the observed co-occurrence of two events differs from the co-occurrence expected by chance.

Pointwise mutual information (PMI) measures whether two events co-occur more often than chance predicts. In query analysis, higher scores indicate stronger semantic relatedness independent of individual popularity. section 6.3.1

A PMI2 variant compares user-level co-occurrence with each keyword’s occurrence count. Build keyword–user pairs, count distinct users for each keyword and pair, calculate PMI2, then filter sparse pairs with a minimum co-occurrence threshold.

Related-query ranking

A query-log pipeline finds pairs such as “iphone 4s” and “iphone,” or “bose” and “beats.” Combining co-occurrence rank with PMI2 rank balances popularity against association strength, while thresholds reduce noise.

How AI-Powered Search covers it

How deep it goes
Defines PMI, explains user-level probabilities, and provides Spark SQL calculations, but does not develop the formula normalization mathematically.
Examples
Uses user search pairs including “iphone 4s”–“iphone,” “bose”–“beats,” and “green lantern”–“captain america.”
What it assumes
Assumes query-log signals and user-level searches, while teaching keyword pairing, occurrence counting, and co-occurrence aggregation.
What you can do after
Apply it via Spark SQL to calculate PMI2, remove sparse pairs, and combine association with co-occurrence rankings.
How it connects
Connects query logs with natural language processing, co-occurrence analysis, semantic relatedness, and ranking.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of AI-Powered Search. The section links point to the parts of the book it draws on.