Commit 87ae7884 authored by Wanigasinghe N.T. | IT18229912's avatar Wanigasinghe N.T. | IT18229912

Merge branch 'feat/it18229912' into 'develop'

Feat/it18229912

See merge request !49
parents a4b4df1b 5850a9da
from happytransformer import HappyTextClassification,TTSettings, HappyTextToText
def grammerchecker():
happy_tt = HappyTextClassification(load_path = "F:\\CDAP-PRESENTLY\\21_22-j-02\\Presently\\presently\\users\\models\\grammermodels\\")
beam_settings = TTSettings(num_beams=5, min_length=1, max_length=500)
happy_tt = HappyTextToText("T5", "t5-base")
example_1 = "Sri Lanka's documented history goes back 3,000 years, with evidence of prehistoric human settlements that dates to at least 125,000 years ago.[14] It has a rich cultural heritage. The earliest known Buddhist writings of Sri Lanka, known collectively as the Pāli canon, date to the fourth Buddhist council, which took place in 29 BCE.[15][16] Sri Lanka's geographic location and deep harbours have made it of great strategic importance, from the earliest days of the ancient Silk Road trade route to today's so-called maritime Silk Road"
result_1 = happy_tt.generate_text(example_1, args=beam_settings)
print(result_1.text)
return(result_1.text)
result = grammerchecker()
...@@ -7,15 +7,17 @@ ...@@ -7,15 +7,17 @@
<ol class="breadcrumb"> <ol class="breadcrumb">
<li class="breadcrumb-item"><a href="{% url 'home' %}">Home</a></li> <li class="breadcrumb-item"><a href="{% url 'home' %}">Home</a></li>
<li class="breadcrumb-item"><a href="{% url 'feedback' %}">Dashboard</a></li> <li class="breadcrumb-item"><a href="{% url 'feedback' %}">Dashboard</a></li>
<li class="breadcrumb-item active" aria-current="page">Pronuciation and vocubalry errors</li> <li class="breadcrumb-item active" aria-current="page">Pronuciation and Grammer errors</li>
</ol> </ol>
</nav> </nav>
<div class="heading-text heading-section text-center py-3"> <div class="heading-text heading-section text-center py-3">
<h4>Pronuciation and vocubalry Errors</h4> <h4>Pronuciation and Grammer Errors</h4>
<span class="lead">See what presently think about your presentation</span> <span class="lead">See what presently think about your presentation</span>
</div> </div>
<hr/> <hr/>
<h4>{{ result }}</h4>
<div class="d-flex justify-content-center mb-5"> <div class="d-flex justify-content-center mb-5">
<a class="btn btn-outline" href="{% url 'overallfeedback' %}" type="submit">View summery detail</a> <a class="btn btn-outline" href="{% url 'overallfeedback' %}" type="submit">View summery detail</a>
</div> </div>
......
...@@ -14,6 +14,7 @@ from . import emotiondetectionvideo ...@@ -14,6 +14,7 @@ from . import emotiondetectionvideo
import myprosody as mysp import myprosody as mysp
import pickle import pickle
from . import myprosody from . import myprosody
from . import grammerchecker
def test(request): def test(request):
p="publicspeech" p="publicspeech"
...@@ -45,7 +46,11 @@ def aboutus(request): ...@@ -45,7 +46,11 @@ def aboutus(request):
return render(request, 'users/aboutus.html') return render(request, 'users/aboutus.html')
def pronuciation(request): def pronuciation(request):
return render(request, 'users/pronuciation.html') result = grammerchecker.result
context= {
'result': result,
}
return render(request, 'users/pronuciation.html',context)
def warningemotionsaudio(request): def warningemotionsaudio(request):
return render(request, 'users/unusualemotionswarning.html') return render(request, 'users/unusualemotionswarning.html')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment