Skip to content

Latest commit

 

History

History
16 lines (9 loc) · 938 Bytes

README.md

File metadata and controls

16 lines (9 loc) · 938 Bytes

dropout-plugin

Simple recommendation plugin for WordPress. Used as toy example for a talk about Machine Learning in WordPress

How does it work?

The plugin computes similarity between two texts via Jaccard/Tanimoto coefficient.

Tanimoto

Similarities are stored in wp_postmeta for each post; as a result WP stores a similarity graph that can be queried quickly to output recommendations (which is, the most similar posts to the one currently in page).

Two hooks are used:

  • save_post: when a post is saved, it gets compared to the latest posts and results are saved (for each post) in wp_postmeta as an array.
  • the_content: when a post is showed in page, the recommended posts are extracted from the array in wp_postmeta.