Auto-Tagging Content with Open Calais

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.

More from this category

  • http://www.alistercameron.com/ Alister Cameron // Blogologist

    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?!

  • http://www.dangrossman.info Dan

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

  • Clara

    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

  • http://www.hedgehogs.net Sam

    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.

  • http://www.neerajkumar.name/ Neeraj Kumar

    google sent me here. this seems interesting. I am gonna try it out. will write about it if i find it useful :)