Skip to content

Instantly share code, notes, and snippets.

@CliffordAnderson
Created October 30, 2013 01:43
Show Gist options
  • Save CliffordAnderson/7225944 to your computer and use it in GitHub Desktop.
Save CliffordAnderson/7225944 to your computer and use it in GitHub Desktop.
Extracts entities with geographic attributes using the Alchemy api
(: Extracts entities from web-accessible texts using the Alchemy api :)
let $entities :=
http:send-request(
<http:request method='post' href='http://access.alchemyapi.com/calls/url/URLGetRankedNamedEntities'>
<http:body media-type='application/x-www-form-urlencoded' method='text'>apikey=[Your Key Here]&amp;url=https%3A%2F%2Fraw.github.com%2Fiulibdcs%2Ftei_text%2Fmaster%2Fvwwp_text%2FVAB7013.txt</http:body>
</http:request>
)/results/entities
for $entity in $entities/entity
where $entity//geo
return $entity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment