Auto-Tagging Content with Open Calais

April 7, 2008

Calais is a free web service from Clearforest, a Reuters company, that can perform semantic analysis on any English text. It uses natural language processing to extract concepts and relationships from the text. It’s been around for a few months, but there’s been very little developer activity around it, and even fewer completed applications using the technology.

Not finding any other work to build on, I wrote my own PHP class for extracting tags from content with Open Calais’ API. You can get the source and read more here. This class takes a block of text or HTML, sends it to Open Calais or parsing, and extracts all of the entities (things like peoples’ names, companies, technologies, etc.). It returns a multidimensional array organized by entity type.

There’s more Open Calais can do, but I hope this class contributes something to those PHP developers that’d like to start using it but had no place to start with the lightweight documentation and eerily quiet official forums. I plan on putting this class to work as an auto-tagging plugin for WordPress posts. I still need some time to figure out how to integrate that into the new authoring interface of WP 2.5, which this blog is now running on.

Categorized under: Development, Projects

4 comments

  1. April 21st, 2008

    Alister Cameron // Blogologist wrote —

    Dan,

    BRILLIANT!

    I have been waiting for someone to do this.

    Thanks SO much.

    Whatever else you can do with it… go for it!

    I think OC is one of the new gems of the Semantic Web and I can see it being so useful to Wordpress in various ways.

    Thanks for getting the ball rolling :)

    -A

    PS. Did you win the money?!

  2. April 21st, 2008

    Dan wrote —

    Glad you like it! No, I didn’t enter the bounty program, so I wrote these plugins for free.

  3. June 8th, 2008

    Clara wrote —

    I’m using WPMU
    I got message error like it..

    Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /home/XXX/public_html/wp-content/plugins/calais-auto-tagger/opencalais.php on line 17

    Hope you can make this plugin compatible with WPmu.

    Thx

  4. February 25th, 2009

    Sam wrote —

    Hi Dan,

    we are using your opencalais PHP code.

    OpenCalais have upgraded their service and the code requires a little modification. We are initially just changing the URL and will carry out some investigation into the new categories.

    I just thought I would let you know.

    Cheers,

    Sam.

  5. View Comments:

Leave a Comment