All Projects → anastassia-b → imessage-chatbot

anastassia-b / imessage-chatbot

Licence: other
💬 Recurrent neural network -- generates messages in your style of speech! Trained on imessage data. Sqlite3, TensorFlow, Flask, Twilio SMS, AWS.

Programming Languages

python
139335 projects - #7 most used programming language
CSS
56736 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to imessage-chatbot

leftonread
Left on Read
Stars: ✭ 22 (-33.33%)
Mutual labels:  sqlite3, imessage
crystal-sqlite3
SQLite3 bindings for Crystal
Stars: ✭ 118 (+257.58%)
Mutual labels:  sqlite3
entity-network
Tensorflow implementation of "Tracking the World State with Recurrent Entity Networks" [https://arxiv.org/abs/1612.03969] by Henaff, Weston, Szlam, Bordes, and LeCun.
Stars: ✭ 58 (+75.76%)
Mutual labels:  recurrent-neural-networks
network performance monitor
Network Performance Monitor - a portable tool for troubleshooting performance issues with home networks
Stars: ✭ 74 (+124.24%)
Mutual labels:  sqlite3
Node-js-functionalities
This repository contains very useful restful API's and functionalities in node-js containing many important tutorial code for mastering node-js, all tutorials have been published on medium.com, tutorials link is given below
Stars: ✭ 69 (+109.09%)
Mutual labels:  twilio
NeuroAI
NeuroAI-UW seminar, a regular weekly seminar for the UW community, organized by NeuroAI Shlizerman Lab.
Stars: ✭ 36 (+9.09%)
Mutual labels:  recurrent-neural-networks
sqlite-spellfix
Loadable spellfix1 extension for sqlite as python package
Stars: ✭ 13 (-60.61%)
Mutual labels:  sqlite3
versatile-data-kit
Versatile Data Kit (VDK) is an open source framework that enables anybody with basic SQL or Python knowledge to create their own data pipelines.
Stars: ✭ 144 (+336.36%)
Mutual labels:  sqlite3
docker-sqlite3
Sqlite3 command line in a docker container
Stars: ✭ 28 (-15.15%)
Mutual labels:  sqlite3
nim-gatabase
Connection-Pooling Compile-Time ORM for Nim
Stars: ✭ 103 (+212.12%)
Mutual labels:  sqlite3
sequence-rnn-py
Sequence analyzing using Recurrent Neural Networks (RNN) based on Keras
Stars: ✭ 28 (-15.15%)
Mutual labels:  recurrent-neural-networks
DeepSegmentor
Sequence Segmentation using Joint RNN and Structured Prediction Models (ICASSP 2017)
Stars: ✭ 17 (-48.48%)
Mutual labels:  recurrent-neural-networks
course-content-dl
NMA deep learning course
Stars: ✭ 537 (+1527.27%)
Mutual labels:  recurrent-neural-networks
Sequence-to-Sequence-Learning-of-Financial-Time-Series-in-Algorithmic-Trading
My bachelor's thesis—analyzing the application of LSTM-based RNNs on financial markets. 🤓
Stars: ✭ 64 (+93.94%)
Mutual labels:  recurrent-neural-networks
five-minute-midas
Predicting Profitable Day Trading Positions using Decision Tree Classifiers. scikit-learn | Flask | SQLite3 | pandas | MLflow | Heroku | Streamlit
Stars: ✭ 41 (+24.24%)
Mutual labels:  sqlite3
fonoster
🚀 The open-source alternative to Twilio
Stars: ✭ 5,072 (+15269.7%)
Mutual labels:  twilio
go-sqlite
Low-level Go interface to SQLite 3
Stars: ✭ 268 (+712.12%)
Mutual labels:  sqlite3
unity-in-framework
Wrap Unity generated Xcode project in Framework
Stars: ✭ 20 (-39.39%)
Mutual labels:  imessage
somleng
Open Source Implementation of Twilio's REST API
Stars: ✭ 33 (+0%)
Mutual labels:  twilio
electron-vue3-inote
使用electron11+vue3.x+ts的桌面端便笺项目,拥有漂亮的过渡动画效果,以富文本形式储存在本地,可多开输入窗口。(The desktop note project using electron11+vue3.x+ts has beautiful transition animation effects, stored locally in the form of rich text, and can open more input windows.)
Stars: ✭ 168 (+409.09%)
Mutual labels:  sqlite3

imessage-rnn

In-progress project: Building a neural network to learn an individual's style of speaking, and respond in their manner.

Current State: Trained on my iMessages from the past year (many of which are with my mom). ~60% accuracy in letter-by-letter message generation. Disclaimer: I am not responsible for what the neural network generates! Live Chat.

Technologies

  • Training messages obtained with SQL
  • Recurrent Neural Network (RNN) built with TensorFlow
  • Flask app responds with generated messages to a Twilio SMS webhook
  • AWS EC2: Trained RNN on p2.xlarge instance, message generator deployed through t2.micro instance

Implementation

1. Extract Data

Data was extracted from the iMessage sqlite3 database, located in /Library/Messages/chat.db.

Getting all messages from yourself:

SELECT text FROM message WHERE is_from_me = 1;

Getting all messages from another person:

-- get their handle_id
SELECT * FROM handle WHERE id="(their_phone_number)";
-- use it to extract their messages
SELECT text FROM message WHERE handle_id = "(handle_id)" AND is_from_me = 0;

Save the ascii messages to a .txt file and format it (ie; deal with emojis).

2. Process Data

With dataset.py, process the text data with parameters from config.py into batches. The input shape for the recurrent neural network is: (None, 32, 62, 256).

3. Train the Recurrent Neural Network model

Now draw the rest of the owl

4. Use the model to generate text

When a text is sent to our Twilio webhook, it hits out app, which generates a message and responds.

Chatbot available through both SMS and online chat.

Our app is very basic. It has two backend routes, one to respond to texts via Twilio and one that responds to messages on the online app version.

@app.route("/sms", methods=['GET', 'POST'])
def sms_reply():
    resp = MessagingResponse()
    rnn_message = generate_message(459)
    resp.message(rnn_message)
    return str(resp)

@app.route("/message", methods=['GET'])
def message_reply():
    return str(generate_message(459))

The current step is to generate responses of varying natural lengths 🤔.

Next Steps

  • Add a second layer to the model
  • Improve RNN performance with LSTM cells
  • In progress: Build web app version with React
  • In progress: Generate responses of varying lengths
  • Look into Natural Language Processing (NLP)
  • Increase training data
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].