This file contains hidden or 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
package wpmcn.structure; | |
import org.apache.commons.lang.StringUtils; | |
import org.apache.hadoop.io.ArrayWritable; | |
import org.apache.hadoop.io.Text; | |
import org.apache.hadoop.io.WritableComparable; | |
import java.util.*; | |
/** |
This file contains hidden or 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
from pyspark import SparkContext | |
import numpy as np | |
from sklearn.cross_validation import train_test_split, Bootstrap | |
from sklearn.datasets import make_classification | |
from sklearn.metrics import accuracy_score | |
from sklearn.tree import DecisionTreeClassifier | |
def run(sc): |
This file contains hidden or 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 Promise = require('bluebird'); | |
/** | |
* Periodically poll a signal function until either it returns true or a timeout is reached. | |
* | |
* @param signal function that returns true when the polled operation is complete | |
* @param interval time interval between polls in milliseconds | |
* @param timeout period of time before giving up on polling | |
* @returns true if the signal function returned true, false if the operation timed out | |
*/ |
This file contains hidden or 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 pandas | |
""" | |
Join an arbitrary number of data frames, using a multi-index label for each data frame. | |
For example say you have three data frames each of which lists the classroom and | |
number of students a teacher has in a given period. | |
Classroom Students | |
Teacher |
This file contains hidden or 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
""" | |
A minimal implementation of the MNIST handwritten digits classification task in TensorFlow. | |
This runs MNIST images images through a single hidden layer and softmax loss function. | |
It demonstrates in a single Python source file the basics of creating a model, training and evaluating data sets, and | |
writing summaries that can be visualized by TensorBoard. | |
""" | |
from __future__ import division |
This file contains hidden or 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
""" | |
Put all the Stanford Sentiment Treebank phrase data into test, training, and dev CSVs. | |
Socher, R., Perelygin, A., Wu, J. Y., Chuang, J., Manning, C. D., Ng, A. Y., & Potts, C. (2013). Recursive Deep Models | |
for Semantic Compositionality Over a Sentiment Treebank. Presented at the Conference on Empirical Methods in Natural | |
Language Processing EMNLP. | |
https://nlp.stanford.edu/sentiment/ | |
""" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
def paragraphs(document): | |
start = 0 | |
for token in document: | |
if token.is_space and token.text.count("\n") > 1: | |
yield document[start:token.i] | |
start = token.i | |
yield document[start:] |
This file contains hidden or 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 json | |
from json import JSONDecodeError | |
from typing import Sequence, Iterable, List | |
import click | |
import spacy | |
from spacy.matcher import Matcher | |
def match_patterns(nlp, patterns: Sequence[dict], corpus: Iterable[str]) -> Iterable[str]: |
This file contains hidden or 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 json | |
from json import JSONDecodeError | |
from typing import Sequence | |
import click | |
class JSONList(click.ParamType): | |
def convert(self, value: str, _, __) -> Sequence: |
OlderNewer