Auto-Tagging Content with Open Calais

April 07 4 Comments Category: Development, Projects

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.

4 Responses

Write a comment
  1. 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?!

    Alister Cameron // Blogologist 21 April 2008 at 11:14 pm Permalink
  2. Glad you like it! No, I didn’t enter the bounty program, so I wrote these plugins for free.

    Dan 21 April 2008 at 11:21 pm Permalink
  3. 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

    Clara 8 June 2008 at 9:42 pm Permalink
  4. 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.

    Sam 25 February 2009 at 8:18 am Permalink

Write a Comment

Commenter Gravatar