This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var AWS = require('aws-sdk'); | |
AWS.config.update({ | |
accessKeyId: '{AWS_KEY}', | |
secretAccessKey: '{AWS_SECRET}', | |
region: '{SNS_REGION}' | |
}); | |
var sns = new AWS.SNS(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
p.Id, | |
c.Text | |
FROM | |
[sotorrent-org:2018_09_23.Posts] p | |
INNER JOIN | |
[sotorrent-org:2018_09_23.Comments] c | |
ON | |
p.Id = c.PostId | |
WHERE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
from tensorflow import keras | |
from tensorflow.python.keras.applications.inception_resnet_v2 import preprocess_input | |
from tensorflow.python.keras.models import load_model | |
from tensorflow.python.keras.applications.inception_resnet_v2 import InceptionResNetV2 | |
from tensorflow.python.keras.applications.mobilenet import preprocess_input | |
from tensorflow.python.keras.applications.mobilenet import MobileNet | |
from tensorflow.python.keras.preprocessing.image import ImageDataGenerator | |
import numpy as np | |
import cv2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--------------------------------------------------------------------------- | |
TypeError Traceback (most recent call last) | |
<ipython-input-183-74b2cf4f5e86> in <module>() | |
----> 1 model = load_model('muteTV.h5') | |
/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/saving.py in load_model(filepath, custom_objects, compile) | |
227 raise ValueError('No model found in config file.') | |
228 model_config = json.loads(model_config.decode('utf-8')) | |
--> 229 model = model_from_config(model_config, custom_objects=custom_objects) | |
230 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Removes the matches and | |
replace them with an empty string | |
""" | |
chatText = regexMedia.sub("", chatText) | |
chatText = regexDate.sub("", chatText) | |
lines = [] | |
for line in chatText.splitlines(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
mediaPattern = r"(\<Media omitted\>)" # Because it serves no purpose | |
regexMedia = re.compile(mediaPattern, flags=re.M) | |
dateAndTimepattern = r"(\d+\/\d+\/\d+)(,)(\s)(\d+:\d+)(\s)(\w+)(\s)(-)(\s\w+)*(:)" | |
regexDate = re.compile(dateAndTimepattern, flags=re.M) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import re | |
import matplotlib.pyplot as plt | |
import nltk | |
from utilities import cleanText | |
from nltk.sentiment.vader import SentimentIntensityAnalyzer | |
sentiment_analyzer = SentimentIntensityAnalyzer() # Our Great Sentiment Analyzer | |
def analyze(name): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from collections import Counter | |
import re | |
import matplotlib.pyplot as plt | |
import numpy as np | |
from utilities import cleanText | |
def analyze(name): | |
linesText = cleanText(name + ".txt") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
mediaPattern = r"(\<Media omitted\>)" # Because it serves no purpose | |
regexMedia = re.compile(mediaPattern, flags=re.M) | |
dateAndTimepattern = r"(\d+\/\d+\/\d+)(,)(\s)(\d+:\d+)(\s)(\w+)(\s)(-)(\s\w+)*(:)" | |
regexDate = re.compile(dateAndTimepattern, flags=re.M) | |
def cleanText(filename): | |
chat = open(filename) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10/09/16, 6:10 PM - Person 1: Person 2? | |
10/09/16, 7:10 PM - Person 2: Yes? | |
10/09/16, 8:10 PM - Person 1: How are you? | |
10/09/16, 9:10 PM - Person 2: Idk. You? | |
10/09/16, 10:10 PM - Person 1: I just got a new phone | |
10/09/16, 11:10 PM - Person 2: Which one? | |
10/09/16, 12:10 AM - Person 1: I showed you? | |
10/09/16, 1:10 AM - Person 2: Cool | |
10/09/16, 2:10 AM - Person 1: Tes | |
10/09/16, 3:10 AM - Person 1: Yes |
NewerOlder