• Stars
    star
    467
  • Rank 91,870 (Top 2 %)
  • Language
    Python
  • License
    MIT License
  • Created over 6 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Sentiment Analysis application created with Python and Dash, hosted at socialsentiment.net

Social Sentiment Dash Application

Live-streaming sentiment analysis application created with Python and Dash, hosted at SocialSentiment.net.

application example

Dash Tutorials

This application was created in conjunction with the Dash tutorial series.

Repo Contents:

  • dash_mess.py - This is currently the main front-end application code. Contains the dash application layouts, logic for graphs, interfaces with the database...etc. Name is descriptive of the overall state of code :) ...this code is setup to run on a flask instance. If you want to clone this and run it locally, you will be using the dev_server.py
  • dev_server.py - If you wish to run this application locally, on the dev server, run via this instead.
  • twitter_stream.py - This should run in the background of your application. This is what streams tweets from Twitter, storing them into the sqlite database, which is what the dash_mess.py file interfaces with.
  • config.py - Meant for many configurations, but right now it just contains stop words. Words we don't intend to ever count in the "trending"
  • cache.py - For caching purposes in effort to get things to run faster.
  • db-truncate.py - A script to truncate the infinitely-growing sqlite database. You will get about 3.5 millionish tweets per day, depending on how fast you can process. You can keep these, but, as the database grows, search times will dramatically suffer.

Quick start

  • Clone repo
  • install requirements.txt using pip install -r requirements.txt
  • Fill in your Twitter App credentials to twitter_stream.py. Go to apps.twitter.com to set that up if you need to.
  • Run twitter_stream.py to build database
  • If you're using this locally, you can run the application with the dev_server.py script. If you want to deploy this to a webserver, see my deploying Dash application tutorial
  • You might need the latest version of sqlite.
sudo add-apt-repository ppa:jonathonf/backports
sudo apt-get update && sudo apt-get install sqlite3
  • Consider running the db-truncate.py from time to time (or via a cronjob), to keep the database reasonably sized. In its current state, the database really doesn't need to store more than 2-3 days of data most likely.

Tips for Running on Server

  • You can use Gunicorn to run the server
gunicorn dash_mess:server -b 0.0.0.0:80 -w 4

Todo

Want to help contribute???

  • Code is ugly. Low hanging fruit is just making the code not so ugly. Up to this point, I've just been in "make it work" mode.
  • App is ugly. I am not a designer. This app is prettttttyyyyyy gross. Think you have a better design? Halp.
  • Click-able related terms and trending terms would be nice. I tried, but failed at this. It'd be cool to see a related term, and be able to just click on it, and this becomes the new searched term, for example.
  • The interactive search is cool, but also does a search in the database per-character. It would be nice if it didn't search per key-press. Not sure I want a search button, I like the streamlined interactivity, but maybe wait 0.2 seconds or something without any new keypresses to perform the search? Something like that might help with speeds. I really do not know the best option here, I just know this isn't idea.
  • Other manipulations or ideas for interactivity? Feel free to show them in a PR.

Credits

The speed of the application, especially with a database with 10's of millions of records is thanks entirely to Daniel Kukiela who helped us to convert from regular sqlite to using fts, helping with the queries, new database structure, caching, and more.

More Repositories

1

pygta5

Explorations of Using Python to play Grand Theft Auto 5.
Python
3,864
star
2

NNfSiX

Neural Networks from Scratch in various programming languages
C++
1,358
star
3

GANTheftAuto

Python
843
star
4

TermGPT

Giving LLMs like GPT-4 the ability to plan and execute terminal commands
Jupyter Notebook
395
star
5

Carla-RL

Reinforcement Learning codebase for self-driving car in Carla
Python
339
star
6

ChatGPT-at-Home

ChatGPT @ Home: Large Language Model (LLM) chatbot application, written by ChatGPT
Python
325
star
7

ChatGPT-API-Basics

Jupyter Notebook
292
star
8

BCI

Brain-Computer interface stuff
Python
285
star
9

nnfs_book

Sample code from the Neural Networks from Scratch book.
Python
261
star
10

BLOOM_Examples

Some quick BLOOM LLM examples
Jupyter Notebook
258
star
11

nnfs

Neural Networks from Scratch
Python
177
star
12

Falcon-LLM

Helper scripts and examples for exploring the Falcon LLM models
Jupyter Notebook
168
star
13

SC2RL

Reinforcement Learning + Starcraft 2
Python
139
star
14

Simple-kNN-Gzip

A simplistic linear and multiprocessed approach to sentiment analysis using Gzip Normalized Compression Distances with k nearest neighbors
Jupyter Notebook
138
star
15

QuantumComputing

Collection of Tutorials and other Quantum Computer programming related things.
Jupyter Notebook
134
star
16

cyberpython2077

Using Python to Play Cyberpunk 2077
Python
122
star
17

GPT-Journey

Building a text and image-based journey game powered by, and with, GPT 3.5
Python
79
star
18

OpenAssistant_API_Pythia_12B

Creating and Using an Open Assistant API locally (Pythia 12B GPT model)
Jupyter Notebook
75
star
19

neural-net-internals-visualized

Visualizing some of the internals of a neural network during training and inference.
Jupyter Notebook
59
star
20

reddit_spam_detector_bot

Bot that detects spam/affiliate marketing authors, and posts some stats on their threads.
Python
58
star
21

Together-API-Basics

Some information for working with the Together inference API for Open Source AI models
Jupyter Notebook
55
star
22

sentdebot

Code for Sentdebot in the Sentdex discord channel (discord.gg/sentdex)
Python
53
star
23

NEAT-samples

samples of neat code
Python
50
star
24

Lambda-Cloud

Helpers and such for working with Lambda Cloud
Python
49
star
25

LLM-Finetuning

Some helpers and examples for creating an LLM fine-tuning dataset
Jupyter Notebook
46
star
26

uarm

uArm Things
Python
29
star
27

satisfunctions

Fighting arthritis from Satisfactory one function at a time.
Python
23
star
28

PyGTA5_Reboot

Python Plays GTA V Reboot
18
star
29

TTSentdex9000

I am a human just like you!
16
star
30

chatbotrnd

working with chatbot response scoring.
Python
14
star
31

HF-Cache-Cleanup

cleanup cached models.
Python
10
star
32

cellvolution

Evolutionary cell-based simulation
Python
1
star