Twitter Sentiment Analysis on Flask App
1.0.0
在此存儲庫中,我在燒瓶應用程序(Web Base)上創建了Twitter情緒分析。
您也可以查看演示網站單擊此處
.
├── images
│ ├── 1.png
│ ├── 2.png
│ ├── 3.png
│ ├── 4.png
│ └── 5.png
├── LICENSE
├── main.py
├── README.md
├── static
│ ├── logo.png
│ └── style.css
└── templates
├── index.html
└── sentiment.html
3 directories, 12 files





python GUI應用程序上的Twitter情感分析單擊此處
python jupyter筆記本上的Twitter情感分析單擊此處
我沒有提供Twitter API鍵。您在Twitter開發人員帳戶上有Twitter API鍵。獲取API鍵
獲取API鍵並放入以下代碼部分
def sentiment ():
userid = request . form . get ( 'userid' )
hashtag = request . form . get ( 'hashtag' )
if userid == "" and hashtag == "" :
error = "Please Enter any one value"
return render_template ( 'index.html' , error = error )
if not userid == "" and not hashtag == "" :
error = "Both entry not allowed"
return render_template ( 'index.html' , error = error )
#=====================Insert Twitter API Here==========================
consumerKey = ""
consumerSecret = ""
accessToken = ""
accessTokenSecret = ""
#=====================Insert Twitter API End===========================
authenticate = tweepy . OAuthHandler ( consumerKey , consumerSecret )
authenticate . set_access_token ( accessToken , accessTokenSecret )
api = tweepy . API ( authenticate , wait_on_rate_limit = True )


如果您找到一個錯誤(網站無法處理查詢和 /或給出不希望的結果),請在此處通過包括您的搜索查詢和預期結果來打開一個問題。
如果您想請求新功能,請隨時在此處打開問題。請包括樣本查詢及其相應的結果。
在互聯網上被稱為Yogesh Nile