Here are some examples of sentiment analysis using MeaningCloud API:
We will analyze a sentence of the specific domain of restaurant reviews to show how to use our Restaurants example sentiment model:
"Main dishes were quite good, but desserts were too sweet for me."
txt
parameter to submit the text.lang
the language in which the text is going to be analyzed, in this case English, en
.model
parameter to analyze the text with it.lang
parameter.curl
:curl 'https://api.meaningcloud.com/sentiment-2.1' \
-F 'key=YOUR API KEY' \
-F 'lang=en' \
-F 'model=Restaurants' \
-F 'txt=Main dishes were quite good, but desserts were too sweet for me.'
To show how to obtain the sentiment analysis of a text using user-defined entities and concepts we will use the following text as an example:
"In the country of Sokovia, the Avengers – Tony Stark, Steve Rogers, Thor, Bruce Banner, Natasha Romanoff, and Clint Barton – raid a Hydra outpost led by Wolfgang von Strucker, who has been experimenting on humans using the scepter previously wielded by Loki. They encounter two of Strucker's experiments – twins Pietro, who has superhuman speed, and Wanda Maximoff, who can manipulate minds and project energy – and apprehend Strucker, while Stark retrieves Loki's scepter."
txt
parameter to submit the text.model
parameter to use a generic sentiment analysis.lang
parameter to analyze the text in English.key
parameter.of
.ud
. In this case we will use the example dictionary provided and we will call it 'the-avengers'.The rest of the input parameters used will be the default ones.
curl
:curl 'https://api.meaningcloud.com/sentiment-2.1' \
-F 'key=YOUR API KEY' \
-F 'lang=en' \
-F 'model=general' \
-F 'ud=the-avengers' \
-F 'txt=In the country of Sokovia, the Avengers – Tony Stark, Steve Rogers, Thor, Bruce Banner, Natasha Romanoff, and Clint Barton – raid a Hydra outpost led by Wolfgang von Strucker, who has been experimenting on humans using the scepter previously wielded by Loki. They encounter two of Strucker\'s experiments – twins Pietro, who has superhuman speed, and Wanda Maximoff, who can manipulate minds and project energy – and apprehend Strucker, while Stark retrieves Loki\'s scepter.'