ClearForest SWS API

·

ClearForest Semantic Web Services (SWS) is a text-mining web service that identifies people, organisations and locations. You post a block of text, and it returns XML listing the details of the identified entities.

The web service uses SOAP, so here's an example in PHP5:


$sws = new SoapClient('http://sws.clearforest.com/ws/sws.asmx?wsdl');
try{
  $result = $sws->TagIt(array(
    'UID' => 0,
    'typeID' => 1,
    'content' => $argv[1],
    ));
} catch (SoapFault $exception) { return FALSE; }
if ($xml = simplexml_load_string($result->TagITResult)){
  $entities = $xml->xpath('Results/Entities');
}
print_r($entities);

The text to process is passed in as a command line argument. The typeID should be 1 for text and 3 for HTML; full details are in the documentation.