Calais.NET - generating metadata using the Calais web service

by chris.fulstow 3/11/2008 2:47:00 PM

Calais.NET is a .NET 3.5 project that provides a friendly API to the Calais web service.

What is Calais?

Here's the official description of the service from the opencalais.com website:

The Calais web service automatically attaches rich semantic metadata to the content you submit – in well under a second. Using natural language processing, machine learning and other methods, Calais categorizes and links your document with entities (people, places, organizations, etc.), facts (person ‘x’ works for company ‘y’), and events (person ‘z’ was appointed chairman of company ‘y’ on date ‘x’).

So, in short, Calais extracts metadata from content you supply.  It takes input as HTML, XML or plain text, then tries to identify various types of metadata, such as companies, people, countries and quotations.  For a full list of supported metadata types, see Calais Semantic Metadata.

A good demo of the the service is the Calais Document Viewer Java application from the OpenCalais website.  Simply paste in some content, click 'Submit', and your original content will be returned with highlighted metadata.

The goal of Calais.NET is to provide the kind of functionality to .NET applications.

How to use Calais in your .NET project

The Calais.NET API wrapper makes Calais very simple to use from .NET.  It exposes a straightforward .NET interface that abstracts away web service details like complex XML input parameters and verbose RDF output data by processing the data with LINQ to XML.

Calais.NET code example

string content = (new WebClient()).DownloadString("http://news.bbc.co.uk/");
 
CalaisDotNet calais = new CalaisDotNet(ApiKey, CalaisContentType.Html, content);
calais.Call();
 
IEnumerable<string> entities = calais.ExtractMetadata(CalaisMetadata.Country);
foreach (string entity in entities)
{
    Console.WriteLine(entity);
}

Example output

Venezuela
Malta
United States
Canada
Sudan
Tibet
Spain
Serbia
China
Mozambique
United Kingdom
Sri Lanka 

Download

Download Calais.NET from Codeplex and give it a try.  C# .NET 3.5 source code included.

Configuring IIS 7 for ASP.NET on Vista

by chris.fulstow 3/6/2008 9:20:00 PM

As part of Microsoft's ongoing Trustworthy Computing initiative, Vista takes the secure by default principle more seriously than previous versions of Windows.  Consequently, many features aren't installed by default, one of which is IIS 7.  So, to install IIS go to:

Control Panel - Programs - Turn Windows features on or off

Then find the Intenet Information Services section and add everything you need, including ASP.NET.

image

Tags: ,

Tips

Powered by BlogEngine.NET 1.3.0.0
Theme by Mads Kristensen

About the author

Name of author Chris Fulstow
ASP.NET Contractor, Sydney

E-mail me Send mail

Calendar

<<  November 2008  >>
MoTuWeThFrSaSu
272829303112
3456789
10111213141516
17181920212223
24252627282930
1234567

View posts in large calendar

Pages

    Recent comments

    Categories


    Disclaimer

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

    © Copyright 2008

    Sign in