Machen Sie farbenfrohe Scheckstoffe mit EingabekommentarPython

Python-Programme
Anonymous
 Machen Sie farbenfrohe Scheckstoffe mit Eingabekommentar

Post by Anonymous »

Ich möchte die Webseite so aussehen lassen: Überprüfen Sie das folgende Bild

Code: Select all

from flask import Flask,request,render_template
from nltk.sentiment.vader import SentimentIntensityAnalyzer
model =SentimentIntensityAnalyzer()
app =Flask(__name__)
@app.route('/')
def hello_comment():
return render_template('Select_comment.html')

@app.route('/',methods=['POST','GET'])
def read_comment():
comment =request.form['mycomment']

polarity_scores =model.polarity_scores(comment)
if polarity_scores['pos']>0.5:
text ='positive'
else:
text ='not positive'
return render_template('Select_comment.html',name=text)

if __name__=='__main__':
app.run(debug=True)
< /code>
und entsprechende HTML -Datei: < /p>




Select  comment


 Write your comment here 





your comment is {{ name }}


Jetzt ist das Ergebnis davon:

Ich brauche so etwas, wie kann ich es machen? Vielen Dank im Voraus

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post