박은주

Web Server

Showing 1 changed file with 22 additions and 0 deletions
from flask import Flask, render_template
from SentimentAnalyzer import StartSentimentAnalysis
from content import GetData
app = Flask(__name__)
@app.route('/')
def main():
GetData()
tot, positive, neutral, negative = StartSentimentAnalysis()
return render_template('index.html', data = {
'total' : tot,
'positive' : int(positive / tot * 100),
'neutral' : int(neutral / tot * 100),
'negative' : int(negative / tot * 100),
})
if __name__ == "__main__":
app.run(port="23023", debug=True)
# host 등을 직접 지정하고 싶다면
# app.run(host="127.0.0.1", port="5000", debug=True)
\ No newline at end of file