-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
82 lines (65 loc) · 3.2 KB
/
index.html
File metadata and controls
82 lines (65 loc) · 3.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>ConveyAPI - Simple Example</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<style>
body {
padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
font-size: 14px;
line-height: 20px;
}
</style>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="index.html">ConveyAPI</a>
<div class="nav-collapse">
<ul class="nav">
<li class="active"><a href="document.html">Document Example</a></li>
<li class="active"><a href="twitter.html">Twitter Example</a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="container">
<div class="page-header">
<h1>ConveyAPI Javascript Examples</h1>
</div>
<h2>ConveyAPI</h2>
<p>ConveyAPI is a REST based text-analytics service. The current release supports annotations for
sentiment (polarity), emotion (the 8 basic emotions from Plutchik's Wheel of Emotion), intensity and spam.
Annotations are supported at both the document and sentence level. For more information about ConveyAPI or
to obtain an API key, visit: <a href="http://conveyapi.com/">http://conveyapi.com</a></p>
<h2>Examples</h2>
<p>The examples are designed to showcase the ease of use of ConveyAPI. Using Bootstrap, jQuery and ConveyAPI,
the code highlights how quickly and easily data can be annotated and put into a UI for analysis and reporting.</p>
<ul>
<li><a href="index.html">index.html</a> - A landing page with a code example and links to the two other pages.</li>
<li><a href="document.html">document.html</a> - Analyze a single block of text and view the annotated results.</li>
<li><a href="twitter.html">twitter.html</a> - Enter a search term for Twitter and pull back 100 results. Take the 100 resuls and pass each one through ConveyAPI to annotate the tweets.</li>
</ul>
<p>The only caveat is the JSONP 'callback' parameter. Make sure to use the 'callback' parameter in order to have your response returned as JSONP (JSON with Padding).</p>
<pre><code>$.getJSON("http://staging.conveyapi.com/analysis-engine/process?callback=?",
{ api_key: apiKey, text: textToAnalyze},
function(jsonData) {
var polarity = jsonData.document.annotations.polarity; //Get the polarity annotation
alert("Document was: " + polarity.value + "(confidence: " + polarity.confidence + ")");
});
</code></pre>
<h3>Useful Links</h3>
<ul>
<li><a href="http://conveyapi.com/">ConveyAPI</a></li>
<li><a href="http://jquery.com/">jQuery</a></li>
<li><a href="http://twitter.github.com/bootstrap/">Bootstrap</a></li>
<li><a href="http://api.jquery.com/jQuery.getJSON/">JSONP Information</a></li>
</ul>
</div> <!-- /container -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="js/jquery-1.7.2.min.js"></script>
</body>
</html>