:- use_module(library(semantria)). % provide Semantria API credentials :- multifile semantria:consumer_key/1, semantria:secret_key_md5/1. semantria:consumer_key("..."). semantria:secret_key_md5("..."). main :- process_document("When in the course ...", R), format("Sentiment: ~s~n", [R.sentiment_polarity]).
A thin wrapper around the Semantria API for natural language processing.
Using SWI-Prolog 7.1 or later:
?- pack_install(semantria).
This module uses semantic versioning.
Source code available and pull requests accepted at http://github.com/mndrix/semantria
semantria.pl | ||
---|---|---|
consumer_key/1 | Add a clause to this predicate to specify your Semantria API "consumer key". | |
process_document/2 | Queue Document for processing and block until a Response is available. | |
queue_document/2 | Add Document to Semantria's queue for processing. | |
request/3 | Low-level predicate for making authenticated API calls. | |
request_document/2 | Request details about an already-queued document with Id. | |
secret_key_md5/1 | Add a clause to this predicate to specify the MD5 hash of your Semantria API "secret key". |