Commit 7ae493b3 authored by J. Fernando Sánchez's avatar J. Fernando Sánchez
Browse files

Minor fix setup and docs

parent 435d1076
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
# Tutorial # Tutorial
This short tutorial will teach you how to consume senpy services for several tasks, and how to take advantage of the features of the framework. This short tutorial will teach you how to consume senpy services for several tasks, and how to take advantage of the features of the framework.
In particular, it covers: In particular, it covers:
* Annotating text with sentiment and emotion using interoperable services * Annotating text with sentiment and emotion using interoperable services
* Switching to different services (service interoperability) * Switching to different services (service interoperability)
* Getting results in different formats (Turtle, XML, text...) * Getting results in different formats (Turtle, XML, text...)
* Asking for specific emotion models (automatic model conversion) * Asking for specific emotion models (automatic model conversion)
The tutorial is originally published as an interactive [jupyter notebook](https://jupyter.org/) (`ipynb` file) that you can download and run locally.
The on-line documentation contains a **static** version of the notebook.
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
## Requirements ## Requirements
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
We will use the demo server at http://senpy.gsi.upm.es abd the requests library. We will use the demo server at http://senpy.gsi.upm.es and the requests library.
We will use a variable for our endpoint so you can try these examples on other instances: We will use a variable for our endpoint.
To try these examples on other instances simply change the value of this variable and re-run the query:
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
endpoint = 'http://senpy.gsi.upm.es/api' endpoint = 'http://senpy.gsi.upm.es/api'
``` ```
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
We will also add a little helper function (`query`) to simplify our queries and pretty-print the results with syntax highlighting: We will also add a little helper function (`query`) to simplify our queries and pretty-print the results with syntax highlighting:
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
import requests import requests
from IPython.display import Code from IPython.display import Code
def query(endpoint, **kwargs): def query(endpoint, **kwargs):
'''Query a given Senpy endpoint with specific parameters, and prettify the output''' '''Query a given Senpy endpoint with specific parameters, and prettify the output'''
res = requests.get(endpoint, res = requests.get(endpoint,
params=kwargs) params=kwargs)
if res.status_code != 200: if res.status_code != 200:
raise Exception(res) raise Exception(res)
return Code(res.text, language=kwargs.get('outformat', 'json-ld')) return Code(res.text, language=kwargs.get('outformat', 'json-ld'))
``` ```
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
## Sentiment Analysis of Text ## Sentiment Analysis of Text
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
To start, let us analyse the sentiment in the following sentence: *senpy is awesome*. To start, let us analyse the sentiment in the following sentence: *senpy is awesome*.
For now, we will use the [sentiment140](http://www.sentiment140.com/) service, through the sentiment140 plugin. For now, we will use the [sentiment140](http://www.sentiment140.com/) service, through the sentiment140 plugin.
We will later cover how to use a different service. We will later cover how to use a different service.
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
query(f'{endpoint}/sentiment140', input="Senpy is awesome") query(f'{endpoint}/sentiment140', input="Senpy is awesome")
``` ```
%%%% Output: execute_result %%%% Output: execute_result
\begin{Verbatim}[commandchars=\\\{\}] \begin{Verbatim}[commandchars=\\\{\}]
\PY{p}{\PYZob{}} \PY{p}{\PYZob{}}
\PY{n+nd}{\PYZdq{}@context\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}http://senpy.gsi.upm.es/api/contexts/YXBpL3NlbnRpbWVudDE0MD9pbnB1dD1TZW5weStpcythd2Vzb21lIw\PYZpc{}3D\PYZpc{}3D\PYZdq{}}\PY{p}{,} \PY{n+nd}{\PYZdq{}@context\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}http://senpy.gsi.upm.es/api/contexts/YXBpL3NlbnRpbWVudDE0MD9pbnB1dD1TZW5weStpcythd2Vzb21lIw\PYZpc{}3D\PYZpc{}3D\PYZdq{}}\PY{p}{,}
\PY{n+nd}{\PYZdq{}@type\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}Results\PYZdq{}}\PY{p}{,} \PY{n+nd}{\PYZdq{}@type\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}Results\PYZdq{}}\PY{p}{,}
\PY{n+nt}{\PYZdq{}entries\PYZdq{}}\PY{p}{:} \PY{p}{[} \PY{n+nt}{\PYZdq{}entries\PYZdq{}}\PY{p}{:} \PY{p}{[}
\PY{p}{\PYZob{}} \PY{p}{\PYZob{}}
\PY{n+nd}{\PYZdq{}@id\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}prefix:\PYZdq{}}\PY{p}{,} \PY{n+nd}{\PYZdq{}@id\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}prefix:\PYZdq{}}\PY{p}{,}
\PY{n+nd}{\PYZdq{}@type\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}Entry\PYZdq{}}\PY{p}{,} \PY{n+nd}{\PYZdq{}@type\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}Entry\PYZdq{}}\PY{p}{,}
\PY{n+nt}{\PYZdq{}marl:hasOpinion\PYZdq{}}\PY{p}{:} \PY{p}{[} \PY{n+nt}{\PYZdq{}marl:hasOpinion\PYZdq{}}\PY{p}{:} \PY{p}{[}
\PY{p}{\PYZob{}} \PY{p}{\PYZob{}}
\PY{n+nd}{\PYZdq{}@type\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}Sentiment\PYZdq{}}\PY{p}{,} \PY{n+nd}{\PYZdq{}@type\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}Sentiment\PYZdq{}}\PY{p}{,}
\PY{n+nt}{\PYZdq{}marl:hasPolarity\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}marl:Positive\PYZdq{}}\PY{p}{,} \PY{n+nt}{\PYZdq{}marl:hasPolarity\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}marl:Positive\PYZdq{}}\PY{p}{,}
\PY{n+nt}{\PYZdq{}prov:wasGeneratedBy\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}prefix:Analysis\PYZus{}1563372853.439696\PYZdq{}} \PY{n+nt}{\PYZdq{}prov:wasGeneratedBy\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}prefix:Analysis\PYZus{}1563372853.439696\PYZdq{}}
\PY{p}{\PYZcb{}} \PY{p}{\PYZcb{}}
\PY{p}{]}\PY{p}{,} \PY{p}{]}\PY{p}{,}
\PY{n+nt}{\PYZdq{}nif:isString\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}Senpy is awesome\PYZdq{}}\PY{p}{,} \PY{n+nt}{\PYZdq{}nif:isString\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}Senpy is awesome\PYZdq{}}\PY{p}{,}
\PY{n+nt}{\PYZdq{}onyx:hasEmotionSet\PYZdq{}}\PY{p}{:} \PY{p}{[}\PY{p}{]} \PY{n+nt}{\PYZdq{}onyx:hasEmotionSet\PYZdq{}}\PY{p}{:} \PY{p}{[}\PY{p}{]}
\PY{p}{\PYZcb{}} \PY{p}{\PYZcb{}}
\PY{p}{]} \PY{p}{]}
\PY{p}{\PYZcb{}} \PY{p}{\PYZcb{}}
\end{Verbatim} \end{Verbatim}
{ {
"@context": "http://senpy.gsi.upm.es/api/contexts/YXBpL3NlbnRpbWVudDE0MD9pbnB1dD1TZW5weStpcythd2Vzb21lIw%3D%3D", "@context": "http://senpy.gsi.upm.es/api/contexts/YXBpL3NlbnRpbWVudDE0MD9pbnB1dD1TZW5weStpcythd2Vzb21lIw%3D%3D",
"@type": "Results", "@type": "Results",
"entries": [ "entries": [
{ {
"@id": "prefix:", "@id": "prefix:",
"@type": "Entry", "@type": "Entry",
"marl:hasOpinion": [ "marl:hasOpinion": [
{ {
"@type": "Sentiment", "@type": "Sentiment",
"marl:hasPolarity": "marl:Positive", "marl:hasPolarity": "marl:Positive",
"prov:wasGeneratedBy": "prefix:Analysis_1563372853.439696" "prov:wasGeneratedBy": "prefix:Analysis_1563372853.439696"
} }
], ],
"nif:isString": "Senpy is awesome", "nif:isString": "Senpy is awesome",
"onyx:hasEmotionSet": [] "onyx:hasEmotionSet": []
} }
] ]
} }
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
Senpy services always return an object of type `senpy:Results`, with a list of entries. Senpy services always return an object of type `senpy:Results`, with a list of entries.
You can think of an entry as a self-contained textual context (`nif:Context` and `senpy:Entry`). You can think of an entry as a self-contained textual context (`nif:Context` and `senpy:Entry`).
Entries can be as short as a sentence, or as long as a news article. Entries can be as short as a sentence, or as long as a news article.
Each entry has a `nif:isString` property that contains the original text of the entry, and several other properties that are provided by the plugins. Each entry has a `nif:isString` property that contains the original text of the entry, and several other properties that are provided by the plugins.
For instance, sentiment annotations are provided through `marl:hasOpinion`. For instance, sentiment annotations are provided through `marl:hasOpinion`.
The annotations are semantic. The annotations are semantic.
This is clear if we request a different semantic format, such as `turtle`. This is clear if we request a different semantic format, such as `turtle`.
The output format is controlled with the `outformat` parameter: The output format is controlled with the `outformat` parameter:
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
query(f'{endpoint}/sentiment140', query(f'{endpoint}/sentiment140',
input="Senpy is awesome", input="Senpy is awesome",
outformat="turtle") outformat="turtle")
``` ```
%%%% Output: execute_result %%%% Output: execute_result
\begin{Verbatim}[commandchars=\\\{\}] \begin{Verbatim}[commandchars=\\\{\}]
\PY{k}{@prefix}\PY{+w}{ }\PY{n+nn}{:}\PY{+w}{ }\PY{n+nv}{\PYZlt{}http://www.gsi.upm.es/onto/senpy/ns\PYZsh{}\PYZgt{}}\PY{+w}{ }\PY{p}{.} \PY{k}{@prefix}\PY{+w}{ }\PY{n+nn}{:}\PY{+w}{ }\PY{n+nv}{\PYZlt{}http://www.gsi.upm.es/onto/senpy/ns\PYZsh{}\PYZgt{}}\PY{+w}{ }\PY{p}{.}
\PY{k}{@prefix}\PY{+w}{ }\PY{n+nn}{dc:}\PY{+w}{ }\PY{n+nv}{\PYZlt{}http://dublincore.org/2012/06/14/dcelements\PYZsh{}\PYZgt{}}\PY{+w}{ }\PY{p}{.} \PY{k}{@prefix}\PY{+w}{ }\PY{n+nn}{dc:}\PY{+w}{ }\PY{n+nv}{\PYZlt{}http://dublincore.org/2012/06/14/dcelements\PYZsh{}\PYZgt{}}\PY{+w}{ }\PY{p}{.}
\PY{k}{@prefix}\PY{+w}{ }\PY{n+nn}{emoml:}\PY{+w}{ }\PY{n+nv}{\PYZlt{}http://www.gsi.dit.upm.es/ontologies/onyx/vocabularies/emotionml/ns\PYZsh{}\PYZgt{}}\PY{+w}{ }\PY{p}{.} \PY{k}{@prefix}\PY{+w}{ }\PY{n+nn}{emoml:}\PY{+w}{ }\PY{n+nv}{\PYZlt{}http://www.gsi.dit.upm.es/ontologies/onyx/vocabularies/emotionml/ns\PYZsh{}\PYZgt{}}\PY{+w}{ }\PY{p}{.}
\PY{k}{@prefix}\PY{+w}{ }\PY{n+nn}{endpoint:}\PY{+w}{ }\PY{n+nv}{\PYZlt{}http://senpy.gsi.upm.es/api/\PYZgt{}}\PY{+w}{ }\PY{p}{.} \PY{k}{@prefix}\PY{+w}{ }\PY{n+nn}{endpoint:}\PY{+w}{ }\PY{n+nv}{\PYZlt{}http://senpy.gsi.upm.es/api/\PYZgt{}}\PY{+w}{ }\PY{p}{.}
\PY{k}{@prefix}\PY{+w}{ }\PY{n+nn}{fam:}\PY{+w}{ }\PY{n+nv}{\PYZlt{}http://vocab.fusepool.info/fam\PYZsh{}\PYZgt{}}\PY{+w}{ }\PY{p}{.} \PY{k}{@prefix}\PY{+w}{ }\PY{n+nn}{fam:}\PY{+w}{ }\PY{n+nv}{\PYZlt{}http://vocab.fusepool.info/fam\PYZsh{}\PYZgt{}}\PY{+w}{ }\PY{p}{.}
\PY{k}{@prefix}\PY{+w}{ }\PY{n+nn}{marl:}\PY{+w}{ }\PY{n+nv}{\PYZlt{}http://www.gsi.dit.upm.es/ontologies/marl/ns\PYZsh{}\PYZgt{}}\PY{+w}{ }\PY{p}{.} \PY{k}{@prefix}\PY{+w}{ }\PY{n+nn}{marl:}\PY{+w}{ }\PY{n+nv}{\PYZlt{}http://www.gsi.dit.upm.es/ontologies/marl/ns\PYZsh{}\PYZgt{}}\PY{+w}{ }\PY{p}{.}
\PY{k}{@prefix}\PY{+w}{ }\PY{n+nn}{nif:}\PY{+w}{ }\PY{n+nv}{\PYZlt{}http://persistence.uni\PYZhy{}leipzig.org/nlp2rdf/ontologies/nif\PYZhy{}core\PYZsh{}\PYZgt{}}\PY{+w}{ }\PY{p}{.} \PY{k}{@prefix}\PY{+w}{ }\PY{n+nn}{nif:}\PY{+w}{ }\PY{n+nv}{\PYZlt{}http://persistence.uni\PYZhy{}leipzig.org/nlp2rdf/ontologies/nif\PYZhy{}core\PYZsh{}\PYZgt{}}\PY{+w}{ }\PY{p}{.}
\PY{k}{@prefix}\PY{+w}{ }\PY{n+nn}{onyx:}\PY{+w}{ }\PY{n+nv}{\PYZlt{}http://www.gsi.dit.upm.es/ontologies/onyx/ns\PYZsh{}\PYZgt{}}\PY{+w}{ }\PY{p}{.} \PY{k}{@prefix}\PY{+w}{ }\PY{n+nn}{onyx:}\PY{+w}{ }\PY{n+nv}{\PYZlt{}http://www.gsi.dit.upm.es/ontologies/onyx/ns\PYZsh{}\PYZgt{}}\PY{+w}{ }\PY{p}{.}
\PY{k}{@prefix}\PY{+w}{ }\PY{n+nn}{prefix:}\PY{+w}{ }\PY{n+nv}{\PYZlt{}http://senpy.invalid/\PYZgt{}}\PY{+w}{ }\PY{p}{.} \PY{k}{@prefix}\PY{+w}{ }\PY{n+nn}{prefix:}\PY{+w}{ }\PY{n+nv}{\PYZlt{}http://senpy.invalid/\PYZgt{}}\PY{+w}{ }\PY{p}{.}
\PY{k}{@prefix}\PY{+w}{ }\PY{n+nn}{prov:}\PY{+w}{ }\PY{n+nv}{\PYZlt{}http://www.w3.org/ns/prov\PYZsh{}\PYZgt{}}\PY{+w}{ }\PY{p}{.} \PY{k}{@prefix}\PY{+w}{ }\PY{n+nn}{prov:}\PY{+w}{ }\PY{n+nv}{\PYZlt{}http://www.w3.org/ns/prov\PYZsh{}\PYZgt{}}\PY{+w}{ }\PY{p}{.}
\PY{k}{@prefix}\PY{+w}{ }\PY{n+nn}{rdf:}\PY{+w}{ }\PY{n+nv}{\PYZlt{}http://www.w3.org/1999/02/22\PYZhy{}rdf\PYZhy{}syntax\PYZhy{}ns\PYZsh{}\PYZgt{}}\PY{+w}{ }\PY{p}{.} \PY{k}{@prefix}\PY{+w}{ }\PY{n+nn}{rdf:}\PY{+w}{ }\PY{n+nv}{\PYZlt{}http://www.w3.org/1999/02/22\PYZhy{}rdf\PYZhy{}syntax\PYZhy{}ns\PYZsh{}\PYZgt{}}\PY{+w}{ }\PY{p}{.}
\PY{k}{@prefix}\PY{+w}{ }\PY{n+nn}{rdfs:}\PY{+w}{ }\PY{n+nv}{\PYZlt{}http://www.w3.org/2000/01/rdf\PYZhy{}schema\PYZsh{}\PYZgt{}}\PY{+w}{ }\PY{p}{.} \PY{k}{@prefix}\PY{+w}{ }\PY{n+nn}{rdfs:}\PY{+w}{ }\PY{n+nv}{\PYZlt{}http://www.w3.org/2000/01/rdf\PYZhy{}schema\PYZsh{}\PYZgt{}}\PY{+w}{ }\PY{p}{.}
\PY{k}{@prefix}\PY{+w}{ }\PY{n+nn}{senpy:}\PY{+w}{ }\PY{n+nv}{\PYZlt{}http://www.gsi.upm.es/onto/senpy/ns\PYZsh{}\PYZgt{}}\PY{+w}{ }\PY{p}{.} \PY{k}{@prefix}\PY{+w}{ }\PY{n+nn}{senpy:}\PY{+w}{ }\PY{n+nv}{\PYZlt{}http://www.gsi.upm.es/onto/senpy/ns\PYZsh{}\PYZgt{}}\PY{+w}{ }\PY{p}{.}
\PY{k}{@prefix}\PY{+w}{ }\PY{n+nn}{wna:}\PY{+w}{ }\PY{n+nv}{\PYZlt{}http://www.gsi.dit.upm.es/ontologies/wnaffect/ns\PYZsh{}\PYZgt{}}\PY{+w}{ }\PY{p}{.} \PY{k}{@prefix}\PY{+w}{ }\PY{n+nn}{wna:}\PY{+w}{ }\PY{n+nv}{\PYZlt{}http://www.gsi.dit.upm.es/ontologies/wnaffect/ns\PYZsh{}\PYZgt{}}\PY{+w}{ }\PY{p}{.}
\PY{k}{@prefix}\PY{+w}{ }\PY{n+nn}{xml:}\PY{+w}{ }\PY{n+nv}{\PYZlt{}http://www.w3.org/XML/1998/namespace\PYZgt{}}\PY{+w}{ }\PY{p}{.} \PY{k}{@prefix}\PY{+w}{ }\PY{n+nn}{xml:}\PY{+w}{ }\PY{n+nv}{\PYZlt{}http://www.w3.org/XML/1998/namespace\PYZgt{}}\PY{+w}{ }\PY{p}{.}
\PY{k}{@prefix}\PY{+w}{ }\PY{n+nn}{xsd:}\PY{+w}{ }\PY{n+nv}{\PYZlt{}http://www.w3.org/2001/XMLSchema\PYZsh{}\PYZgt{}}\PY{+w}{ }\PY{p}{.} \PY{k}{@prefix}\PY{+w}{ }\PY{n+nn}{xsd:}\PY{+w}{ }\PY{n+nv}{\PYZlt{}http://www.w3.org/2001/XMLSchema\PYZsh{}\PYZgt{}}\PY{+w}{ }\PY{p}{.}
\PY{err}{p}\PY{err}{r}\PY{err}{e}\PY{err}{f}\PY{err}{i}\PY{err}{x}\PY{p}{:}\PY{+w}{ }\PY{k+kt}{a}\PY{+w}{ }\PY{n+nn}{senpy:}\PY{n+nt}{Entry}\PY{+w}{ }\PY{p}{;} \PY{err}{p}\PY{err}{r}\PY{err}{e}\PY{err}{f}\PY{err}{i}\PY{err}{x}\PY{p}{:}\PY{+w}{ }\PY{k+kt}{a}\PY{+w}{ }\PY{n+nn}{senpy:}\PY{n+nt}{Entry}\PY{+w}{ }\PY{p}{;}
\PY{+w}{ }\PY{n+nn}{nif:}\PY{n+nt}{isString}\PY{+w}{ }\PY{l+s}{\PYZdq{}}\PY{l+s}{Senpy is awesome}\PY{l+s}{\PYZdq{}}\PY{+w}{ }\PY{p}{;} \PY{+w}{ }\PY{n+nn}{nif:}\PY{n+nt}{isString}\PY{+w}{ }\PY{l+s}{\PYZdq{}}\PY{l+s}{Senpy is awesome}\PY{l+s}{\PYZdq{}}\PY{+w}{ }\PY{p}{;}
\PY{+w}{ }\PY{n+nn}{marl:}\PY{n+nt}{hasOpinion}\PY{+w}{ }\PY{p}{[}\PY{+w}{ }\PY{k+kt}{a}\PY{+w}{ }\PY{n+nn}{senpy:}\PY{n+nt}{Sentiment}\PY{+w}{ }\PY{p}{;} \PY{+w}{ }\PY{n+nn}{marl:}\PY{n+nt}{hasOpinion}\PY{+w}{ }\PY{p}{[}\PY{+w}{ }\PY{k+kt}{a}\PY{+w}{ }\PY{n+nn}{senpy:}\PY{n+nt}{Sentiment}\PY{+w}{ }\PY{p}{;}
\PY{+w}{ }\PY{n+nn}{marl:}\PY{n+nt}{hasPolarity}\PY{+w}{ }\PY{l+s}{\PYZdq{}}\PY{l+s}{marl:Positive}\PY{l+s}{\PYZdq{}}\PY{+w}{ }\PY{p}{;} \PY{+w}{ }\PY{n+nn}{marl:}\PY{n+nt}{hasPolarity}\PY{+w}{ }\PY{l+s}{\PYZdq{}}\PY{l+s}{marl:Positive}\PY{l+s}{\PYZdq{}}\PY{+w}{ }\PY{p}{;}
\PY{+w}{ }\PY{n+nn}{prov:}\PY{n+nt}{wasGeneratedBy}\PY{+w}{ }\PY{n+nn}{prefix:}\PY{n+nt}{Analysis\PYZus{}1563372853}\PY{l+m+mf}{.6874764}\PY{+w}{ }\PY{p}{]}\PY{+w}{ }\PY{p}{.} \PY{+w}{ }\PY{n+nn}{prov:}\PY{n+nt}{wasGeneratedBy}\PY{+w}{ }\PY{n+nn}{prefix:}\PY{n+nt}{Analysis\PYZus{}1563372853}\PY{l+m+mf}{.6874764}\PY{+w}{ }\PY{p}{]}\PY{+w}{ }\PY{p}{.}
\PY{p}{[}\PY{p}{]}\PY{+w}{ }\PY{k+kt}{a}\PY{+w}{ }\PY{n+nn}{senpy:}\PY{n+nt}{Results}\PY{+w}{ }\PY{p}{;} \PY{p}{[}\PY{p}{]}\PY{+w}{ }\PY{k+kt}{a}\PY{+w}{ }\PY{n+nn}{senpy:}\PY{n+nt}{Results}\PY{+w}{ }\PY{p}{;}
\PY{+w}{ }\PY{n+nn}{prov:}\PY{n+nt}{used}\PY{+w}{ }\PY{err}{p}\PY{err}{r}\PY{err}{e}\PY{err}{f}\PY{err}{i}\PY{err}{x}\PY{p}{:}\PY{+w}{ }\PY{p}{.} \PY{+w}{ }\PY{n+nn}{prov:}\PY{n+nt}{used}\PY{+w}{ }\PY{err}{p}\PY{err}{r}\PY{err}{e}\PY{err}{f}\PY{err}{i}\PY{err}{x}\PY{p}{:}\PY{+w}{ }\PY{p}{.}
\end{Verbatim} \end{Verbatim}
@prefix : <http://www.gsi.upm.es/onto/senpy/ns#> . @prefix : <http://www.gsi.upm.es/onto/senpy/ns#> .
@prefix dc: <http://dublincore.org/2012/06/14/dcelements#> . @prefix dc: <http://dublincore.org/2012/06/14/dcelements#> .
@prefix emoml: <http://www.gsi.dit.upm.es/ontologies/onyx/vocabularies/emotionml/ns#> . @prefix emoml: <http://www.gsi.dit.upm.es/ontologies/onyx/vocabularies/emotionml/ns#> .
@prefix endpoint: <http://senpy.gsi.upm.es/api/> . @prefix endpoint: <http://senpy.gsi.upm.es/api/> .
@prefix fam: <http://vocab.fusepool.info/fam#> . @prefix fam: <http://vocab.fusepool.info/fam#> .
@prefix marl: <http://www.gsi.dit.upm.es/ontologies/marl/ns#> . @prefix marl: <http://www.gsi.dit.upm.es/ontologies/marl/ns#> .
@prefix nif: <http://persistence.uni-leipzig.org/nlp2rdf/ontologies/nif-core#> . @prefix nif: <http://persistence.uni-leipzig.org/nlp2rdf/ontologies/nif-core#> .
@prefix onyx: <http://www.gsi.dit.upm.es/ontologies/onyx/ns#> . @prefix onyx: <http://www.gsi.dit.upm.es/ontologies/onyx/ns#> .
@prefix prefix: <http://senpy.invalid/> . @prefix prefix: <http://senpy.invalid/> .
@prefix prov: <http://www.w3.org/ns/prov#> . @prefix prov: <http://www.w3.org/ns/prov#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix senpy: <http://www.gsi.upm.es/onto/senpy/ns#> . @prefix senpy: <http://www.gsi.upm.es/onto/senpy/ns#> .
@prefix wna: <http://www.gsi.dit.upm.es/ontologies/wnaffect/ns#> . @prefix wna: <http://www.gsi.dit.upm.es/ontologies/wnaffect/ns#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> . @prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
prefix: a senpy:Entry ; prefix: a senpy:Entry ;
nif:isString "Senpy is awesome" ; nif:isString "Senpy is awesome" ;
marl:hasOpinion [ a senpy:Sentiment ; marl:hasOpinion [ a senpy:Sentiment ;
marl:hasPolarity "marl:Positive" ; marl:hasPolarity "marl:Positive" ;
prov:wasGeneratedBy prefix:Analysis_1563372853.6874764 ] . prov:wasGeneratedBy prefix:Analysis_1563372853.6874764 ] .
[] a senpy:Results ; [] a senpy:Results ;
prov:used prefix: . prov:used prefix: .
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
## Moving to a different service ## Moving to a different service
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
All senpy plugins use the same API, which makes moving from one service to another a breeze. All senpy plugins use the same API, which makes moving from one service to another a breeze.
Let us modify the earlier example, which uses the `sentiment140` service, to use a different service (e.g. the `sentiment-basic` plugin). Let us modify the earlier example, which uses the `sentiment140` service, to use a different service (e.g. the `sentiment-basic` plugin).
We can do it just by changing the URL of the service: We can do it just by changing the URL of the service:
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
query(f'{endpoint}/sentiment-basic', query(f'{endpoint}/sentiment-basic',
input="Senpy is awesome") input="Senpy is awesome")
``` ```
%%%% Output: execute_result %%%% Output: execute_result
\begin{Verbatim}[commandchars=\\\{\}] \begin{Verbatim}[commandchars=\\\{\}]
\PY{p}{\PYZob{}} \PY{p}{\PYZob{}}
\PY{n+nd}{\PYZdq{}@context\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}http://senpy.gsi.upm.es/api/contexts/YXBpL3NlbnRpbWVudC1iYXNpYz9pbnB1dD1TZW5weStpcythd2Vzb21lIw\PYZpc{}3D\PYZpc{}3D\PYZdq{}}\PY{p}{,} \PY{n+nd}{\PYZdq{}@context\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}http://senpy.gsi.upm.es/api/contexts/YXBpL3NlbnRpbWVudC1iYXNpYz9pbnB1dD1TZW5weStpcythd2Vzb21lIw\PYZpc{}3D\PYZpc{}3D\PYZdq{}}\PY{p}{,}
\PY{n+nd}{\PYZdq{}@type\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}Results\PYZdq{}}\PY{p}{,} \PY{n+nd}{\PYZdq{}@type\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}Results\PYZdq{}}\PY{p}{,}
\PY{n+nt}{\PYZdq{}entries\PYZdq{}}\PY{p}{:} \PY{p}{[} \PY{n+nt}{\PYZdq{}entries\PYZdq{}}\PY{p}{:} \PY{p}{[}
\PY{p}{\PYZob{}} \PY{p}{\PYZob{}}
\PY{n+nd}{\PYZdq{}@id\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}prefix:\PYZdq{}}\PY{p}{,} \PY{n+nd}{\PYZdq{}@id\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}prefix:\PYZdq{}}\PY{p}{,}
\PY{n+nd}{\PYZdq{}@type\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}Entry\PYZdq{}}\PY{p}{,} \PY{n+nd}{\PYZdq{}@type\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}Entry\PYZdq{}}\PY{p}{,}
\PY{n+nt}{\PYZdq{}marl:hasOpinion\PYZdq{}}\PY{p}{:} \PY{p}{[} \PY{n+nt}{\PYZdq{}marl:hasOpinion\PYZdq{}}\PY{p}{:} \PY{p}{[}
\PY{p}{\PYZob{}} \PY{p}{\PYZob{}}
\PY{n+nd}{\PYZdq{}@type\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}Sentiment\PYZdq{}}\PY{p}{,} \PY{n+nd}{\PYZdq{}@type\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}Sentiment\PYZdq{}}\PY{p}{,}
\PY{n+nt}{\PYZdq{}marl:hasPolarity\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}marl:Neutral\PYZdq{}}\PY{p}{,} \PY{n+nt}{\PYZdq{}marl:hasPolarity\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}marl:Neutral\PYZdq{}}\PY{p}{,}
\PY{n+nt}{\PYZdq{}prov:wasGeneratedBy\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}prefix:Analysis\PYZus{}1563372853.8034046\PYZdq{}} \PY{n+nt}{\PYZdq{}prov:wasGeneratedBy\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}prefix:Analysis\PYZus{}1563372853.8034046\PYZdq{}}
\PY{p}{\PYZcb{}} \PY{p}{\PYZcb{}}
\PY{p}{]}\PY{p}{,} \PY{p}{]}\PY{p}{,}
\PY{n+nt}{\PYZdq{}nif:isString\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}Senpy is awesome\PYZdq{}}\PY{p}{,} \PY{n+nt}{\PYZdq{}nif:isString\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}Senpy is awesome\PYZdq{}}\PY{p}{,}
\PY{n+nt}{\PYZdq{}onyx:hasEmotionSet\PYZdq{}}\PY{p}{:} \PY{p}{[}\PY{p}{]} \PY{n+nt}{\PYZdq{}onyx:hasEmotionSet\PYZdq{}}\PY{p}{:} \PY{p}{[}\PY{p}{]}
\PY{p}{\PYZcb{}} \PY{p}{\PYZcb{}}
\PY{p}{]} \PY{p}{]}
\PY{p}{\PYZcb{}} \PY{p}{\PYZcb{}}
\end{Verbatim} \end{Verbatim}
{ {
"@context": "http://senpy.gsi.upm.es/api/contexts/YXBpL3NlbnRpbWVudC1iYXNpYz9pbnB1dD1TZW5weStpcythd2Vzb21lIw%3D%3D", "@context": "http://senpy.gsi.upm.es/api/contexts/YXBpL3NlbnRpbWVudC1iYXNpYz9pbnB1dD1TZW5weStpcythd2Vzb21lIw%3D%3D",
"@type": "Results", "@type": "Results",
"entries": [ "entries": [
{ {
"@id": "prefix:", "@id": "prefix:",
"@type": "Entry", "@type": "Entry",
"marl:hasOpinion": [ "marl:hasOpinion": [
{ {
"@type": "Sentiment", "@type": "Sentiment",
"marl:hasPolarity": "marl:Neutral", "marl:hasPolarity": "marl:Neutral",
"prov:wasGeneratedBy": "prefix:Analysis_1563372853.8034046" "prov:wasGeneratedBy": "prefix:Analysis_1563372853.8034046"
} }
], ],
"nif:isString": "Senpy is awesome", "nif:isString": "Senpy is awesome",
"onyx:hasEmotionSet": [] "onyx:hasEmotionSet": []
} }
] ]
} }
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
As you can see, the structure and annotation schema of the response is the same. As you can see, the structure and annotation schema of the response is the same.
This makes it very easy to compare and migrate to different services. This makes it very easy to compare and migrate to different services.
Service interoperability is not only useful for users. Service interoperability is not only useful for users.
It is also key for other features such as [automated evaluation](http://senpy.readthedocs.io/Evaluation.html). It is also key for other features such as [automated evaluation](http://senpy.readthedocs.io/Evaluation.html).
This is a compelling reason to adapt existing services to use the Senpy API. This is a compelling reason to adapt existing services to use the Senpy API.
In fact, the `sentiment140` senpy service is proxy to the public [Sentiment 140 service](http://www.sentiment140.com/). In fact, the `sentiment140` senpy service is proxy to the public [Sentiment 140 service](http://www.sentiment140.com/).
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
## Emotion analysis ## Emotion analysis
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
Senpy uses the `onyx` vocabulary to represent emotions, which incorporates the notion of `EmotionSet`'s, an emotion that is composed of several emotions. Senpy uses the `onyx` vocabulary to represent emotions, which incorporates the notion of `EmotionSet`'s, an emotion that is composed of several emotions.
In a nutshell, an `Entry` is linked to one or more `EmotionSet`, which in turn is made up of one or more `Emotion`. In a nutshell, an `Entry` is linked to one or more `EmotionSet`, which in turn is made up of one or more `Emotion`.
Let's illustrate it with an example, using the `emotion-depechemood` plugin. Let's illustrate it with an example, using the `emotion-depechemood` plugin.
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
query(f'{endpoint}/emotion-depechemood', query(f'{endpoint}/emotion-depechemood',
input="Senpy is a wonderful that service") input="Senpy is a wonderful that service")
``` ```
%%%% Output: execute_result %%%% Output: execute_result
\begin{Verbatim}[commandchars=\\\{\}] \begin{Verbatim}[commandchars=\\\{\}]
\PY{p}{\PYZob{}} \PY{p}{\PYZob{}}
\PY{n+nd}{\PYZdq{}@context\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}http://senpy.gsi.upm.es/api/contexts/YXBpL2Vtb3Rpb24tZGVwZWNoZW1vb2Q\PYZus{}aW5wdXQ9U2VucHkraXMrYSt3b25kZXJmdWwrdGhhdCtzZXJ2aWNlIw\PYZpc{}3D\PYZpc{}3D\PYZdq{}}\PY{p}{,} \PY{n+nd}{\PYZdq{}@context\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}http://senpy.gsi.upm.es/api/contexts/YXBpL2Vtb3Rpb24tZGVwZWNoZW1vb2Q\PYZus{}aW5wdXQ9U2VucHkraXMrYSt3b25kZXJmdWwrdGhhdCtzZXJ2aWNlIw\PYZpc{}3D\PYZpc{}3D\PYZdq{}}\PY{p}{,}
\PY{n+nd}{\PYZdq{}@type\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}Results\PYZdq{}}\PY{p}{,} \PY{n+nd}{\PYZdq{}@type\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}Results\PYZdq{}}\PY{p}{,}
\PY{n+nt}{\PYZdq{}entries\PYZdq{}}\PY{p}{:} \PY{p}{[} \PY{n+nt}{\PYZdq{}entries\PYZdq{}}\PY{p}{:} \PY{p}{[}
\PY{p}{\PYZob{}} \PY{p}{\PYZob{}}
\PY{n+nd}{\PYZdq{}@id\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}prefix:\PYZdq{}}\PY{p}{,} \PY{n+nd}{\PYZdq{}@id\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}prefix:\PYZdq{}}\PY{p}{,}
\PY{n+nd}{\PYZdq{}@type\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}Entry\PYZdq{}}\PY{p}{,} \PY{n+nd}{\PYZdq{}@type\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}Entry\PYZdq{}}\PY{p}{,}
\PY{n+nt}{\PYZdq{}marl:hasOpinion\PYZdq{}}\PY{p}{:} \PY{p}{[}\PY{p}{]}\PY{p}{,} \PY{n+nt}{\PYZdq{}marl:hasOpinion\PYZdq{}}\PY{p}{:} \PY{p}{[}\PY{p}{]}\PY{p}{,}
\PY{n+nt}{\PYZdq{}nif:isString\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}Senpy is a wonderful that service\PYZdq{}}\PY{p}{,} \PY{n+nt}{\PYZdq{}nif:isString\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}Senpy is a wonderful that service\PYZdq{}}\PY{p}{,}
\PY{n+nt}{\PYZdq{}onyx:hasEmotionSet\PYZdq{}}\PY{p}{:} \PY{p}{[} \PY{n+nt}{\PYZdq{}onyx:hasEmotionSet\PYZdq{}}\PY{p}{:} \PY{p}{[}
\PY{p}{\PYZob{}} \PY{p}{\PYZob{}}
\PY{n+nd}{\PYZdq{}@type\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}EmotionSet\PYZdq{}}\PY{p}{,} \PY{n+nd}{\PYZdq{}@type\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}EmotionSet\PYZdq{}}\PY{p}{,}
\PY{n+nt}{\PYZdq{}onyx:hasEmotion\PYZdq{}}\PY{p}{:} \PY{p}{[} \PY{n+nt}{\PYZdq{}onyx:hasEmotion\PYZdq{}}\PY{p}{:} \PY{p}{[}
\PY{p}{\PYZob{}} \PY{p}{\PYZob{}}
\PY{n+nd}{\PYZdq{}@type\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}Emotion\PYZdq{}}\PY{p}{,} \PY{n+nd}{\PYZdq{}@type\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}Emotion\PYZdq{}}\PY{p}{,}
\PY{n+nt}{\PYZdq{}onyx:hasEmotionCategory\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}wna:negative\PYZhy{}fear\PYZdq{}}\PY{p}{,} \PY{n+nt}{\PYZdq{}onyx:hasEmotionCategory\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}wna:negative\PYZhy{}fear\PYZdq{}}\PY{p}{,}
\PY{n+nt}{\PYZdq{}onyx:hasEmotionIntensity\PYZdq{}}\PY{p}{:} \PY{l+m+mf}{0.06258366271018097} \PY{n+nt}{\PYZdq{}onyx:hasEmotionIntensity\PYZdq{}}\PY{p}{:} \PY{l+m+mf}{0.06258366271018097}
\PY{p}{\PYZcb{}}\PY{p}{,} \PY{p}{\PYZcb{}}\PY{p}{,}
\PY{p}{\PYZob{}} \PY{p}{\PYZob{}}
\PY{n+nd}{\PYZdq{}@type\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}Emotion\PYZdq{}}\PY{p}{,} \PY{n+nd}{\PYZdq{}@type\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}Emotion\PYZdq{}}\PY{p}{,}
\PY{n+nt}{\PYZdq{}onyx:hasEmotionCategory\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}wna:amusement\PYZdq{}}\PY{p}{,} \PY{n+nt}{\PYZdq{}onyx:hasEmotionCategory\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}wna:amusement\PYZdq{}}\PY{p}{,}
\PY{n+nt}{\PYZdq{}onyx:hasEmotionIntensity\PYZdq{}}\PY{p}{:} \PY{l+m+mf}{0.15784834034155437} \PY{n+nt}{\PYZdq{}onyx:hasEmotionIntensity\PYZdq{}}\PY{p}{:} \PY{l+m+mf}{0.15784834034155437}
\PY{p}{\PYZcb{}}\PY{p}{,} \PY{p}{\PYZcb{}}\PY{p}{,}
\PY{p}{\PYZob{}} \PY{p}{\PYZob{}}
\PY{n+nd}{\PYZdq{}@type\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}Emotion\PYZdq{}}\PY{p}{,} \PY{n+nd}{\PYZdq{}@type\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}Emotion\PYZdq{}}\PY{p}{,}
\PY{n+nt}{\PYZdq{}onyx:hasEmotionCategory\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}wna:anger\PYZdq{}}\PY{p}{,} \PY{n+nt}{\PYZdq{}onyx:hasEmotionCategory\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}wna:anger\PYZdq{}}\PY{p}{,}
\PY{n+nt}{\PYZdq{}onyx:hasEmotionIntensity\PYZdq{}}\PY{p}{:} \PY{l+m+mf}{0.08728815135373413} \PY{n+nt}{\PYZdq{}onyx:hasEmotionIntensity\PYZdq{}}\PY{p}{:} \PY{l+m+mf}{0.08728815135373413}
\PY{p}{\PYZcb{}}\PY{p}{,} \PY{p}{\PYZcb{}}\PY{p}{,}
\PY{p}{\PYZob{}} \PY{p}{\PYZob{}}
\PY{n+nd}{\PYZdq{}@type\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}Emotion\PYZdq{}}\PY{p}{,} \PY{n+nd}{\PYZdq{}@type\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}Emotion\PYZdq{}}\PY{p}{,}
\PY{n+nt}{\PYZdq{}onyx:hasEmotionCategory\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}wna:annoyance\PYZdq{}}\PY{p}{,} \PY{n+nt}{\PYZdq{}onyx:hasEmotionCategory\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}wna:annoyance\PYZdq{}}\PY{p}{,}
\PY{n+nt}{\PYZdq{}onyx:hasEmotionIntensity\PYZdq{}}\PY{p}{:} \PY{l+m+mf}{0.12184635680460143} \PY{n+nt}{\PYZdq{}onyx:hasEmotionIntensity\PYZdq{}}\PY{p}{:} \PY{l+m+mf}{0.12184635680460143}
\PY{p}{\PYZcb{}}\PY{p}{,} \PY{p}{\PYZcb{}}\PY{p}{,}
\PY{p}{\PYZob{}} \PY{p}{\PYZob{}}
\PY{n+nd}{\PYZdq{}@type\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}Emotion\PYZdq{}}\PY{p}{,} \PY{n+nd}{\PYZdq{}@type\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}Emotion\PYZdq{}}\PY{p}{,}
\PY{n+nt}{\PYZdq{}onyx:hasEmotionCategory\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}wna:indifference\PYZdq{}}\PY{p}{,} \PY{n+nt}{\PYZdq{}onyx:hasEmotionCategory\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}wna:indifference\PYZdq{}}\PY{p}{,}
\PY{n+nt}{\PYZdq{}onyx:hasEmotionIntensity\PYZdq{}}\PY{p}{:} \PY{l+m+mf}{0.1374081151031531} \PY{n+nt}{\PYZdq{}onyx:hasEmotionIntensity\PYZdq{}}\PY{p}{:} \PY{l+m+mf}{0.1374081151031531}
\PY{p}{\PYZcb{}}\PY{p}{,} \PY{p}{\PYZcb{}}\PY{p}{,}
\PY{p}{\PYZob{}} \PY{p}{\PYZob{}}
\PY{n+nd}{\PYZdq{}@type\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}Emotion\PYZdq{}}\PY{p}{,} \PY{n+nd}{\PYZdq{}@type\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}Emotion\PYZdq{}}\PY{p}{,}
\PY{n+nt}{\PYZdq{}onyx:hasEmotionCategory\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}wna:joy\PYZdq{}}\PY{p}{,} \PY{n+nt}{\PYZdq{}onyx:hasEmotionCategory\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}wna:joy\PYZdq{}}\PY{p}{,}
\PY{n+nt}{\PYZdq{}onyx:hasEmotionIntensity\PYZdq{}}\PY{p}{:} \PY{l+m+mf}{0.12267040802346799} \PY{n+nt}{\PYZdq{}onyx:hasEmotionIntensity\PYZdq{}}\PY{p}{:} \PY{l+m+mf}{0.12267040802346799}
\PY{p}{\PYZcb{}}\PY{p}{,} \PY{p}{\PYZcb{}}\PY{p}{,}
\PY{p}{\PYZob{}} \PY{p}{\PYZob{}}
\PY{n+nd}{\PYZdq{}@type\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}Emotion\PYZdq{}}\PY{p}{,} \PY{n+nd}{\PYZdq{}@type\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}Emotion\PYZdq{}}\PY{p}{,}
\PY{n+nt}{\PYZdq{}onyx:hasEmotionCategory\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}wna:awe\PYZdq{}}\PY{p}{,} \PY{n+nt}{\PYZdq{}onyx:hasEmotionCategory\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}wna:awe\PYZdq{}}\PY{p}{,}
\PY{n+nt}{\PYZdq{}onyx:hasEmotionIntensity\PYZdq{}}\PY{p}{:} \PY{l+m+mf}{0.21085262130713067} \PY{n+nt}{\PYZdq{}onyx:hasEmotionIntensity\PYZdq{}}\PY{p}{:} \PY{l+m+mf}{0.21085262130713067}
\PY{p}{\PYZcb{}}\PY{p}{,} \PY{p}{\PYZcb{}}\PY{p}{,}
\PY{p}{\PYZob{}} \PY{p}{\PYZob{}}
\PY{n+nd}{\PYZdq{}@type\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}Emotion\PYZdq{}}\PY{p}{,} \PY{n+nd}{\PYZdq{}@type\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}Emotion\PYZdq{}}\PY{p}{,}
\PY{n+nt}{\PYZdq{}onyx:hasEmotionCategory\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}wna:sadness\PYZdq{}}\PY{p}{,} \PY{n+nt}{\PYZdq{}onyx:hasEmotionCategory\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}wna:sadness\PYZdq{}}\PY{p}{,}
\PY{n+nt}{\PYZdq{}onyx:hasEmotionIntensity\PYZdq{}}\PY{p}{:} \PY{l+m+mf}{0.09950234435617733} \PY{n+nt}{\PYZdq{}onyx:hasEmotionIntensity\PYZdq{}}\PY{p}{:} \PY{l+m+mf}{0.09950234435617733}
\PY{p}{\PYZcb{}} \PY{p}{\PYZcb{}}
\PY{p}{]}\PY{p}{,} \PY{p}{]}\PY{p}{,}
\PY{n+nt}{\PYZdq{}prov:wasGeneratedBy\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}prefix:Analysis\PYZus{}1563372853.9469151\PYZdq{}} \PY{n+nt}{\PYZdq{}prov:wasGeneratedBy\PYZdq{}}\PY{p}{:} \PY{l+s+s2}{\PYZdq{}prefix:Analysis\PYZus{}1563372853.9469151\PYZdq{}}
\PY{p}{\PYZcb{}} \PY{p}{\PYZcb{}}
\PY{p}{]} \PY{p}{]}
\PY{p}{\PYZcb{}} \PY{p}{\PYZcb{}}
\PY{p}{]} \PY{p}{]}
\PY{p}{\PYZcb{}} \PY{p}{\PYZcb{}}
\end{Verbatim} \end{Verbatim}
{ {
"@context": "http://senpy.gsi.upm.es/api/contexts/YXBpL2Vtb3Rpb24tZGVwZWNoZW1vb2Q_aW5wdXQ9U2VucHkraXMrYSt3b25kZXJmdWwrdGhhdCtzZXJ2aWNlIw%3D%3D", "@context": "http://senpy.gsi.upm.es/api/contexts/YXBpL2Vtb3Rpb24tZGVwZWNoZW1vb2Q_aW5wdXQ9U2VucHkraXMrYSt3b25kZXJmdWwrdGhhdCtzZXJ2aWNlIw%3D%3D",
"@type": "Results", "@type": "Results",
"entries": [ "entries": [
{ {
"@id": "prefix:", "@id": "prefix:",
"@type": "Entry", "@type": "Entry",
"marl:hasOpinion": [], "marl:hasOpinion": [],
"nif:isString": "Senpy is a wonderful that service", "nif:isString": "Senpy is a wonderful that service",
"onyx:hasEmotionSet": [ "onyx:hasEmotionSet": [
{ {
"@type": "EmotionSet", "@type": "EmotionSet",
"onyx:hasEmotion": [ "onyx:hasEmotion": [
{ {
"@type": "Emotion",