Spaces:
Runtime error
Runtime error
Merge pull request #21 from EveSa/Estelle
Browse files- README.md +1 -1
- model/vocab.pkl +0 -0
- templates/index.html.jinja +24 -30
- templates/site_style/css/main.css +2 -0
README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
---
|
| 2 |
title: SummaryProject
|
| 3 |
sdk: docker
|
| 4 |
-
app_file: src/
|
| 5 |
pinned: false
|
| 6 |
---
|
| 7 |
# Initialisation
|
|
|
|
| 1 |
---
|
| 2 |
title: SummaryProject
|
| 3 |
sdk: docker
|
| 4 |
+
app_file: src/api.py
|
| 5 |
pinned: false
|
| 6 |
---
|
| 7 |
# Initialisation
|
model/vocab.pkl
DELETED
|
Binary file (63.4 kB)
|
|
|
templates/index.html.jinja
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
-
<html lang="
|
| 3 |
<head>
|
| 4 |
<title>Text summarization API</title>
|
| 5 |
<meta charset="utf-8" />
|
|
@@ -9,28 +9,11 @@
|
|
| 9 |
<script>
|
| 10 |
function customReset()
|
| 11 |
{
|
| 12 |
-
document.getElementById("
|
| 13 |
document.getElementById("text").value = "";
|
| 14 |
document.getElementById("summary").value = "";
|
| 15 |
}
|
| 16 |
</script>
|
| 17 |
-
<script>
|
| 18 |
-
function submitBothForms()
|
| 19 |
-
{
|
| 20 |
-
document.getElementById("my_form").submit();
|
| 21 |
-
document.getElementById("choixModel").submit();
|
| 22 |
-
}
|
| 23 |
-
</script>
|
| 24 |
-
<script>
|
| 25 |
-
function getValue() {
|
| 26 |
-
var e = document.getElementById("choixModel");
|
| 27 |
-
var value = e.value;
|
| 28 |
-
var text = e.options[e.selectedIndex].text;
|
| 29 |
-
return text}
|
| 30 |
-
</script>
|
| 31 |
-
<script type="text/javascript">
|
| 32 |
-
document.getElementById('choixModel').value = "<?php echo $_GET['choixModel'];?>";
|
| 33 |
-
</script>
|
| 34 |
</head>
|
| 35 |
<body>
|
| 36 |
<div id="header">
|
|
@@ -45,22 +28,29 @@
|
|
| 45 |
<hr/>
|
| 46 |
</nav>
|
| 47 |
|
| 48 |
-
<div class="
|
| 49 |
-
<form id="
|
| 50 |
<label for="selectModel">Choose a model :</label>
|
| 51 |
-
<select name="
|
| 52 |
-
|
| 53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
</select>
|
| 55 |
</form>
|
| 56 |
-
<button form ="
|
| 57 |
</div>
|
| 58 |
|
| 59 |
<div>
|
| 60 |
<table>
|
| 61 |
<tr>
|
| 62 |
<td>
|
| 63 |
-
<form id = "
|
| 64 |
<textarea id="text" name="text" placeholder="Enter your text here!" rows="15" cols="75">{{text}}</textarea>
|
| 65 |
<input type="hidden" name="textarea_value" value="{{ text }}">
|
| 66 |
</form>
|
|
@@ -72,9 +62,13 @@
|
|
| 72 |
</table>
|
| 73 |
</div>
|
| 74 |
<div class="buttons">
|
| 75 |
-
<!--
|
| 76 |
-
|
| 77 |
-
<button
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
</div>
|
| 79 |
|
| 80 |
<div class="copyright">
|
|
@@ -82,7 +76,7 @@
|
|
| 82 |
<li>© Untitled. All rights reserved.</li>
|
| 83 |
</ul>
|
| 84 |
<ul>
|
| 85 |
-
<li>
|
| 86 |
<li>Lingyun GAO -- Estelle SALMON -- Eve SAUVAGE</li>
|
| 87 |
</ul>
|
| 88 |
</div>
|
|
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
<head>
|
| 4 |
<title>Text summarization API</title>
|
| 5 |
<meta charset="utf-8" />
|
|
|
|
| 9 |
<script>
|
| 10 |
function customReset()
|
| 11 |
{
|
| 12 |
+
document.getElementById("text_form").value = "";
|
| 13 |
document.getElementById("text").value = "";
|
| 14 |
document.getElementById("summary").value = "";
|
| 15 |
}
|
| 16 |
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
</head>
|
| 18 |
<body>
|
| 19 |
<div id="header">
|
|
|
|
| 28 |
<hr/>
|
| 29 |
</nav>
|
| 30 |
|
| 31 |
+
<div class="model_choice">
|
| 32 |
+
<form id="model_choice" method="post" action="/model">
|
| 33 |
<label for="selectModel">Choose a model :</label>
|
| 34 |
+
<select name="model_choice" class="selectModel" id="model_choice">
|
| 35 |
+
<!--A for jinja loop to retrieve option buttons from the api
|
| 36 |
+
and to keep them selected when a choice is made. -->
|
| 37 |
+
{% for x in model_list%}
|
| 38 |
+
{%if selected_model == x.model%}
|
| 39 |
+
<option value="{{x.model}}" selected>{{x.name}}</option>
|
| 40 |
+
{%else%}
|
| 41 |
+
<option value="{{x.model}}">{{x.name}}</option>
|
| 42 |
+
{%endif%}
|
| 43 |
+
{%endfor%}
|
| 44 |
</select>
|
| 45 |
</form>
|
| 46 |
+
<button form ="model_choice" class='search_bn' type="submit" class="btn btn-primary btn-block btn-large" rows="1" cols="50">Select model</button>
|
| 47 |
</div>
|
| 48 |
|
| 49 |
<div>
|
| 50 |
<table>
|
| 51 |
<tr>
|
| 52 |
<td>
|
| 53 |
+
<form id = "text_form" action="/predict" method="post" class="formulaire">
|
| 54 |
<textarea id="text" name="text" placeholder="Enter your text here!" rows="15" cols="75">{{text}}</textarea>
|
| 55 |
<input type="hidden" name="textarea_value" value="{{ text }}">
|
| 56 |
</form>
|
|
|
|
| 62 |
</table>
|
| 63 |
</div>
|
| 64 |
<div class="buttons">
|
| 65 |
+
<!--A if loop to disable Go and Reset button for the index page.-->
|
| 66 |
+
{% if current_route == "/" %}
|
| 67 |
+
<button>Please select a model</button>
|
| 68 |
+
{% else %}
|
| 69 |
+
<button form ="text_form" class='search_bn' type="submit" class="btn btn-primary btn-block btn-large" rows="1" cols="50">Go !</button>
|
| 70 |
+
<button form ="text_form" type="button" value="Reset" onclick="customReset();">Reset</button>
|
| 71 |
+
{% endif %}
|
| 72 |
</div>
|
| 73 |
|
| 74 |
<div class="copyright">
|
|
|
|
| 76 |
<li>© Untitled. All rights reserved.</li>
|
| 77 |
</ul>
|
| 78 |
<ul>
|
| 79 |
+
<li>University project as part of the NLP (Natural Language Processing) Master's program</li>
|
| 80 |
<li>Lingyun GAO -- Estelle SALMON -- Eve SAUVAGE</li>
|
| 81 |
</ul>
|
| 82 |
</div>
|
templates/site_style/css/main.css
CHANGED
|
@@ -246,6 +246,7 @@ textarea {
|
|
| 246 |
background: #3B353C;
|
| 247 |
}
|
| 248 |
|
|
|
|
| 249 |
/* Header */
|
| 250 |
|
| 251 |
#header {
|
|
@@ -469,4 +470,5 @@ textarea {
|
|
| 469 |
justify-content: center;
|
| 470 |
margin-top: 20px;
|
| 471 |
}
|
|
|
|
| 472 |
}
|
|
|
|
| 246 |
background: #3B353C;
|
| 247 |
}
|
| 248 |
|
| 249 |
+
|
| 250 |
/* Header */
|
| 251 |
|
| 252 |
#header {
|
|
|
|
| 470 |
justify-content: center;
|
| 471 |
margin-top: 20px;
|
| 472 |
}
|
| 473 |
+
|
| 474 |
}
|