-
Notifications
You must be signed in to change notification settings - Fork 3
/
app.py
30 lines (21 loc) · 856 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
from flask import Flask, render_template, request
import analysis
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']
show_loading_overlay = True
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, show_loading_overlay=show_loading_overlay)
if __name__ == '__main__':
app.run()