Spaces:
Sleeping
Sleeping
<main> | |
<section id="text-classification"> | |
<head> | |
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename= 'CSS/home.css')}}"> | |
</head> | |
<body> | |
<h2>تصنيف المناطق </h2> | |
<div align="center"> | |
<h1>قم بإدخال جملة عربية لتصنيفها كواحدة من ثلاث مناطق</h1> | |
<h1>مصر، الخليج العربي أو الشام</h1> | |
<small><em>Enter an Arabic text to classify it to one of three regions:</em></small> | |
<small><em>Egypt, Gulf or Levant</em></small></div> | |
<br> | |
<div align="center"> | |
<form action="{{url_for('classify')}}" method="POST"> | |
<textarea name="comment" required="true" rows="1" cols="40"></textarea> | |
<br> | |
<br> | |
<input id="text" type="submit" value="صَنِف" class="button-89"> | |
<br> | |
<div class="container" id="output" style="visibility: hidden;"> | |
<img src="/images/egypt_vector.png" alt="Egypt"> | |
<div class="centered"><h2>{{output}</h2></div> | |
</div> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> | |
<script> | |
var text = document.getElementById("text").value | |
document.getElementById("output").style="visibility: visible"; | |
$('input').on('submit', function(event) { | |
$.ajax({ | |
type: 'POST', | |
url: "{{ url_for( 'classify' ) }}", | |
data: JSON.stringify({'input':text}), | |
contentType: "application/json", | |
success:function(response){ | |
document.write(response); | |
document.getElementById("output").style="visibility: visible"; | |
} | |
}) | |
}) | |
</script> | |
</form> | |
</div> | |
</body> | |
</section> | |
</main> | |