I hereby claim:
- I am lizadaly on github.
- I am lizadaly (https://keybase.io/lizadaly) on keybase.
- I have a public key ASBKi45tuqp1aEuDXp8B0EYFUcdlRSGFMlRxb9nNAqm4owo
To claim this, I am signing this object:
| rm -rf dist | |
| mkdir dist | |
| cp -r images dist | |
| cp *.css dist/ | |
| echo "Writing index..." | |
| pandoc index.md -o dist/index.html --template templates/default.html | |
| for d in pages/*; do | |
| mkdir -p dist/$d | |
| for i in $d/*.md; do | |
| f="${i##*/}" |
| # Toy example of using a deep neural network to predict average temperature | |
| # by month. Note that this is not any better than just taking the average | |
| # of the dataset; it's just meant as an example of a regression analysis using | |
| # neural networks. | |
| import logging | |
| import datetime | |
| import pandas as pd | |
| import torch |
| import spacy | |
| nlp = spacy.load('en') | |
| doc = nlp('Do you have a car or truck') | |
| for token in doc: | |
| print(token, token.pos_) |
I hereby claim:
To claim this, I am signing this object:
| /* Version without division */ | |
| var findProductsNoDiv = function (arr) { | |
| let forw = new Array(arr.length) | |
| let back = new Array(arr.length) | |
| let res = new Array(arr.length) | |
| let prod = 1 | |
| /* Go through the array forward and multiply as we go */ | |
| for (var i=0;i<arr.length;i++) { | |
| forw[i] = prod | |
| prod *= arr[i] |
| */ | |
| var sortedArrays = function (arr1, arr2) { | |
| let ans = new Array(arr1.length + arr2.length) | |
| let i = 0, j = 0, k = 0 | |
| while (i < arr1.length && j < arr2.length) { | |
| if (arr1[i] < arr2[j]) { | |
| ans[k] = arr1[i] | |
| i++ | |
| } | |
| else { |
| import random | |
| from collections import Counter | |
| import nltk | |
| # See https://gist.github.com/lizadaly/7071e0de589883a197433951bc7314c5 for comments on the setup here | |
| word_list = [] | |
| [word_list.extend(nltk.corpus.gutenberg.words(f)) for f in nltk.corpus.gutenberg.fileids()] | |
| cleaned_words = [w.lower() for w in word_list if w.isalnum()] | |
| all_bigrams = [b for b in nltk.bigrams(cleaned_words)] |
| import nltk | |
| from nltk.corpus import stopwords | |
| from collections import Counter | |
| word_list = [] | |
| # Set up a quick lookup table for common words like "the" and "an" so they can be excluded | |
| stops = set(stopwords.words('english')) | |
| # For all 18 novels in the public domain book corpus, extract all their words |
| > db.subjects.getIndexes() | |
| [ | |
| { | |
| "v" : 1, | |
| "key" : { | |
| "_id" : 1 | |
| }, | |
| "name" : "_id_", | |
| "ns" : "scribe_api_development.subjects" | |
| }, |
| from sklearn.datasets import load_files | |
| from sklearn.feature_extraction.text import TfidfVectorizer | |
| from sklearn.linear_model import SGDClassifier | |
| from sklearn.pipeline import Pipeline | |
| import numpy as np | |
| # Load the pre-classified training data as "training-fanfic/clean" and "training-fanfic/dirty/" | |
| train = load_files("training-fanfic", encoding="utf-8", load_content=True) |