(Tutorial) Introduction to Calais
Tutorial :
Introduction to Calais
To get an idea of how it works, chuck some text at http://viewer.opencalais.com/. For example, here's a Wikinews teaser about President Obama:

It correctly identifies the topic of the article as "Politics," "Washington,United States" as a "City" that the article is about, "Barack Obama" and "George W. Bush" as "Person" entities, and even finds a quotation by George W. Bush (though sadly, not as entertaining as some). Pretty nifty!
So, wanna wire this up with Drupal? Let's find out how!
Stuff you will need- Calais module: http://drupal.org/project/opencalais. I'm using 6.x-3.1
- Resource Description Framework (RDF) module: http://drupal.org/project/rdf. I'm using 6.x-1.0-alpha7
- ARC 2 RDF classes for PHP: http://arc.semsol.org/download. I'm using ARC 2 from 2009-03-05.
- A Calais API key from http://opencalais.com/ (it's a Drupal site, so you shouldn't have any trouble ;))
- Download and extract the Calais and RDF modules into your modules directory, as per usual (typically, sites/all/modules/calais and sites/all/modules/rdf).
- Download and extract the ARC 2 library to a "vendor" folder in the RDF module's directory (sites/all/modules/rdf/vendor/arc).
- Enable the following modules:
- Calais package
- Calais
- Calais API
- RDF package
- RDF
- Calais package
- Navigate to Administer >> Site configuration >> Calais Configuration (admin/settings/calais) and enter your Calais API key.
- Click the Calais Node Settings tab (admin/settings/calais/calais-node). There are several collapsed fieldsets here: "Global" and another one for each content type on your system.
- Next, you have to turn on Calais processing on one or more of your content types. Expand one of the content type fieldsets (for example, "Story") and select the type of Calais processing that should be done: whether Calais should merely suggest terms (visible on a tab), or automatically apply the terms it discovers, either once when the content is first inserted, or each time the content is updated.
You can also play with the Relevancy Threshold setting. This dictates at what confidence level a tag will get applied to the node, from 0% (tag it with whatever tags Calais comes up with) to 100% (only the tags it's really sure about).
Courtesy: Lullabot.Com
- guru's blog
- Login to post comments
![Drupal-6-Book-[Building Powerful and Robust Websites with Drupal 6].jpg](http://www.drupalranch.com/images/Drupal-6-Book-[Building%20Powerful%20and%20Robust%20Websites%20with%20Drupal%206].jpg)