-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanalyze.html
108 lines (102 loc) · 5.45 KB
/
analyze.html
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Poetry Sentiment Analyzer | Reading between the Lines</title>
<!--font-->
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Crimson+Text:ital,wght@0,400;0,700;1,400;1,700&family=Stalemate&display=swap" rel="stylesheet">
<!--boostrap 'n libraries-->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BmbxuPwQa2lc/FVzBcNJ7UAyJxM6wuqIj61tLrc4wSX0szH/Ev+nYRRuWlolflfl" crossorigin="anonymous">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<!--D3 library-->
<script src="https://d3js.org/d3.v6.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3-cloud/1.2.5/d3.layout.cloud.js"></script>
<!--styles-->
<link rel="stylesheet" href="css/analyzestyles.css">
</head>
<body>
<div class="background"></div>
<nav class="header">
<img id="title" src="IMG/title.svg" onclick="window.open('index.html');">
<div>
<h2>Poetry Sentiment Analyzer</h2>
<p>This is an AI-power Sentiment Analysis Tool for Poetry, a part of the <em><b>Reading between the Lines</b></em> data visualization project by <em><b>C.Wu.</b></em> </p>
</div>
</nav>
<div class="poeminput">
<textarea id="userpoeminput">type your poem here ...</textarea>
<div>
<p id="instruction">You may edit and re-analyze your poem at any time; unfortunately, the sentiment analyzer can only interpret English at the moment.</p>
<button class="pill" onclick="getUserInput('userpoeminput', 'UserPoemAnalysis')">Analyze</button>
</div>
</div>
<div id="capture" class="poemoutput">
<div id="useranalysis">
<div class="poemhighlight">
<div class="togglebuttons">
<button id="toggleUserOutput0" class="toggleUserOutput active" onclick="toggleUserOutput(0)">Overall</button>
<button id="toggleUserOutput1" class="toggleUserOutput" onclick="toggleUserOutput(1)">Valence</button>
<button id="toggleUserOutput2" class="toggleUserOutput" onclick="toggleUserOutput(2)">Dominance</button>
<button id="toggleUserOutput3" class="toggleUserOutput" onclick="toggleUserOutput(3)">Arousal</button>
</div>
<div style="display: flex">
<div id="useroverall"></div>
<div id="uservalence"></div>
<div id="userdominance"></div>
<div id="userarousal"></div>
</div>
</div>
<div class="poemgraph">
<div class="poemvis">
<div id="poemresult">
<div id='roverall'></div>
<div class='rstats'>
<div id="valencestat"></div>
<p>average valence</p>
<div id="arousalstat"></div>
<p>average arousal</p>
<div id="dominancestat"></div>
<p>average dominance</p>
</div>
</div>
<div id="violinresult"></div>
</div>
<div id="wordcloudresult"></div>
</div>
</div>
<div id="userinstruction">
<div>
<h4>How the Poetry Sentiment Analyzer Works:</h4>
<p>You can use this tool to apply the sentiment analysis techniques covered in <a href="index.html" style="color: var(--secondary)">Reading between the Lines</a> and analyze any poetry you are interested in, or rather, a poem of your own creation! The analyzer will return a static visual overview of your poem. To start the analyzer, type in the poem of your choice in the input box on the left, and click <a style="color: var(--secondary)">Analyze</a>.</p>
</div>
</div>
</div>
<button id="capturebutton" onclick="takescreenshot();">You can screen-capture your poem and analysis (you must enable pop-up and download for this).<br><i class="fa fa-camera"></i></button>
<!--footer-->
<footer>
<!--
<div class="f-f footer-container">
<div class="fo-tile">
<h1>6.859<br>Interactive<br>Data Visualization</h1>
<p>2021
<br>All rights reserved ©
</p>
</div>
<div class="fo-tile">
<p>Massachusetts Institute of Technology</p>
</div>
</div>
-->
</footer>
<!--bootstrap-->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta2/dist/js/bootstrap.bundle.min.js" integrity="sha384-b5kHyXgcpbZJO/tY9Ul7kGkf1S0CWuKcCD38l8YkeH8z8QjE0GmW1gYU5S9FOnJ0" crossorigin="anonymous"></script>
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
<!--screenshotlibrary-->
<script src="js/html2canvas.min.js"></script>
<!--personal js-->
<script src="./js/main.js"></script>
<script src="./js/AI_Poem_Analysis.js"></script>
</body></html>