-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathexplorer.html
More file actions
180 lines (158 loc) · 6.42 KB
/
explorer.html
File metadata and controls
180 lines (158 loc) · 6.42 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
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@qi2peng2">
<meta name="twitter:creator" content="@qi2peng2">
<meta name="twitter:title" content="HotpotQA: A Dataset for Diverse, Explainable Multi-hop Question Answering">
<meta name="twitter:description" content="Explore HotpotQA">
<meta name="twitter:image" content="https://hotpotqa.github.io/img/explorer-bg.jpg">
<meta property="og:image" content="https://hotpotqa.github.io/img/explorer-bg.jpg">
<title>HotpotQA Homepage</title>
<!-- Bootstrap core CSS -->
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom fonts for this template -->
<link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">
<link href='https://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
<!-- Custom styles for this template -->
<link href="css/clean-blog.min.css" rel="stylesheet">
<link href="css/hotpotqa.css" rel="stylesheet">
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light fixed-top" id="mainNav">
<div class="container">
<a class="navbar-brand" href="index.html">HotpotQA</a>
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
Menu
<i class="fa fa-bars"></i>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="blog.html">Blog</a>
</li>
<li class="nav-item">
<a class="nav-link" href="explorer.html">Explorer</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- Page Header -->
<header class="masthead" style="background-image: url('img/explorer-bg.jpg')">
<div class="overlay"></div>
<div class="container">
<div class="row">
<div class="col-lg-8 col-md-10 mx-auto">
<div class="site-heading">
<h1>Explore HotpotQA</h1>
<span class="subheading">A Dataset for Diverse, Explainable <span class="line">Multi-hop</span> <span class="line">Question Answering</span></span>
</div>
</div>
</div>
</div>
</header>
<div class="container">
<div class="row" style="margin-bottom: 10px">
<div class="col-lg-8 col-md-10 mx-auto">
Here we show a random example from the HotpotQA dev set. Feel free to use the in-browser controls to show/hide supporting facts and/or the answer to see if you can predict them!
</div>
</div>
<div class="row" style="margin-bottom: 10px">
<div class="col-lg-8 col-md-10 mx-auto">
<div class="form-check-inline">
<input class="form-check-input" type="checkbox" value="" id="show_supfacts" checked>
<label class="form-check-label" for="show_supfacts">
Show supporting facts
</label>
</div>
<div class="form-check-inline">
<input class="form-check-input" type="checkbox" value="" id="show_answer" checked>
<label class="form-check-label" for="show_answer">
Show answer
</label>
</div>
<button type="button" class="btn btn-success" id="another_example">Show another example</button>
</div>
</div>
<div class="row">
<div class="col-lg-8 col-md-10 mx-auto">
<div id="data-example">
<div class="data-paragraph" id="doc_a">
<div class="paragraph-title" id="title_a">
</div>
<div class="paragraph" id="para_a">
</div>
</div>
<div class="data-paragraph" id="doc_b">
<div class="paragraph-title" id="title_b">
</div>
<div class="paragraph" id="para_b">
</div>
</div>
<div class="data-question" id="question"></div>
<div class="data-answer" id="answer"></div>
</div>
</div>
</div>
</div>
<hr>
<!-- Footer -->
<footer>
<div class="container">
<div class="row">
<div class="col-lg-8 col-md-10 mx-auto">
<p class="copyright text-muted">Copyright © HotpotQA Team, 2018-2019.</p>
<p class="copyright text-muted">Theme adapted from Start Bootstrap's <a href="https://startbootstrap.com/template-overviews/clean-blog/">Clean Blog</a> template.</p>
</div>
</div>
</div>
</footer>
<!-- Bootstrap core JavaScript -->
<script src="vendor/jquery/jquery.min.js"></script>
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- Custom scripts for this template -->
<script src="js/clean-blog.min.js"></script>
<script>
var examples;
function showParagraph(id, example) {
var paragraph = example['para_' + id];
var output = ""
for (var i = 0; i < paragraph.length; i++) {
if (example['supporting_facts'][id.charCodeAt(0) - 'a'.charCodeAt(0)].indexOf(i) > -1) {
classes = "supfact"
if (!$("#show_supfacts")[0].checked)
classes += " hide"
output += "<span class='" + classes + "'>" + paragraph[i] + "</span>";
} else
output += paragraph[i];
}
$("#para_"+id).html(output);
$("#title_"+id).html("<em>Paragraph " + id.toUpperCase() + ":</em> " + example['title_'+id]);
}
function showRandomExample() {
var id = Math.floor(Math.random() * examples.length);
var example = examples[id];
showParagraph('a', example)
showParagraph('b', example)
$('#question').html("<strong>Q:</strong> " + example['question'])
$('#answer').html("<strong>A:</strong> " + example['answer'])
}
$(function(){
$.getJSON('js/camera_ready_nd8_dev_sample100.json', function(data) {
examples = data;
showRandomExample();
})
$("#show_answer").click(function(){$("#answer").slideToggle(200)});
$("#show_supfacts").click(function(){$("span.supfact").toggleClass("hide")});
$("#another_example").click(function(){$("#data-example").fadeOut(100, function(){showRandomExample(); $("#data-example").fadeIn(100);});})
})
</script>
</body>
</html>