Normalization of scores done!

parent fb7578ac
...@@ -95,12 +95,16 @@ async def getEssay(request): ...@@ -95,12 +95,16 @@ async def getEssay(request):
async def evaluate(request): async def evaluate(request):
body = await request.form() body = await request.form()
score = predict(body['essay']) score = predict(body['essay'])
print(score)
score = round(float(score)/60*100,2)
print(score)
return templates.TemplateResponse('score.html', {'request': request, 'score':score}) return templates.TemplateResponse('score.html', {'request': request, 'score':score})
@app.route('/contribute',methods=["POST"]) @app.route('/contribute',methods=["POST"])
async def evaluate(request): async def evaluate(request):
body = await request.form() body = await request.form()
score, essay, prompt = body['score'], body['essay'], body['prompt'] score, essay, prompt = body['score'], body['essay'], body['prompt']
# score = float(score)/100
json = { json = {
"essay": essay, "essay": essay,
"score": score "score": score
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<br /> <br />
<div class="jumbotron"> <div class="jumbotron">
<h1 class="display-4 text-center" style="font-size: 7em;">{{score}}/60</h1> <h1 class="display-4 text-center" style="font-size: 7em;">{{score}}/100</h1>
<br /> <br />
<p class="lead">This is the score you received for your entered essay below:</p> <p class="lead">This is the score you received for your entered essay below:</p>
<hr class="my-4"> <hr class="my-4">
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<tr> <tr>
<!-- <th scope="col">#</th> --> <!-- <th scope="col">#</th> -->
<th scope="col">Essays on {{topic}}</th> <th scope="col">Essays on {{topic}}</th>
<th scope="col">Score</th> <th scope="col">Score(x/100)</th>
<!-- <th scope="col">Handle</th> --> <!-- <th scope="col">Handle</th> -->
</tr> </tr>
</thead> </thead>
......
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