forked from MaryamTaj/Compel-O-Meter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
32 lines (23 loc) · 842 Bytes
/
app.py
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
from flask import Flask, render_template, request
import analysis
import spacy
import nltkmodules
spacy.load('en_core_web_sm')
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
@app.route('/launch')
def launch():
return render_template('launch.html')
@app.route('/submit', methods=['POST'])
def submit():
text = request.form['text']
result = analysis.get_compellingness_ai(text)
descriptions = analysis.get_compellingness_description(result)
warnings = analysis.ethics_warning(text)
pathos = analysis.get_pathos_description(result)
logos = analysis.get_logos_description(result)
return render_template('results.html', text=text, result=result, descriptions=descriptions, warnings=warnings, pathos=pathos, logos=logos)
if __name__ == '__main__':
app.run()