File size: 762 Bytes
aef7e33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
@app.route('/sentence' , methods = ['GET' , 'POST'])
def sentence():
    if request.method == 'POST':
        # Get the form data
        text = request.form['text']
        # Replace these sample values with your actual data
        classes = ["Computer_Complexity", "Artificial_Intelligence", "Software", "Computation"]
        
        colors = ["danger" , "warning" , "info" , "success" ]
        categories = dict(zip(classes,colors))
        dominant_class = "Artificial_Intelligence"  # Example dominant class
        # Render the template with the data
        return render_template('response_sentence.html', text=text, categories=categories, dominant_class=dominant_class)

    # Render the initial form page
    return render_template('sentence.html')