Machen Sie farbenfrohe Scheckstoffe mit Eingabekommentar

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Machen Sie farbenfrohe Scheckstoffe mit Eingabekommentar

by Anonymous » 02 May 2025, 04:45

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

Top