Commonality is a project mainly written in PHP, it's free.
how much context do you need to generate good tags?