Spaces:
Sleeping
Sleeping
| from textblob import TextBlob | |
| from newspaper import Article | |
| import nltk | |
| nltk.download("punkt_tab") | |
| from flask import Flask,render_template,request | |
| app=Flask(__name__) | |
| def search(): | |
| return render_template("index.html") | |
| def show(): | |
| url=request.form['link'] | |
| article=Article(url) | |
| article.download() | |
| article.parse() | |
| article.nlp() | |
| analysis=TextBlob(article.text) | |
| data=[article.title,article.publish_date,article.authors,article.summary,article.keywords,analysis.polarity] | |
| return render_template("index.html",data=data) | |
| if __name__=="__main__": | |
| app.run(debug=True) | |