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
// Vincenty distance in JS | |
(function (geof) { | |
var A = 6378137.0 // Meters | |
// Flattening | |
var F = 1/298.257223563 | |
// Semi-minor axis | |
var B = A * (1.0 - F) // 6356752.31424518 | |
// First ellipticity squared | |
var ESQR = 2*F - (F*F) | |
var METERS_TO_MILES = 0.000621371192 |
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 os.path | |
from collections import Counter | |
from csv import * | |
import math | |
import sys | |
LOG2_SCALE = 1 / math.log(2) | |
NEG = 'neg' | |
POS = 'pos' |
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 os.path | |
from collections import Counter | |
from csv import * | |
import math | |
import sys | |
LOG2_SCALE = 1 / math.log(2) | |
NEG = 'neg' | |
POS = 'pos' |
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 os.path | |
from collections import Counter | |
from csv import * | |
import math | |
import sys | |
LOG2_SCALE = 1 / math.log(2) | |
""" | |
This version of counts assumes a single corpus, with negated contexts already written. | |
Here we generate a single lexicon file and |
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
#ifndef __CONSUMERPRODUCERQUEUE_H__ | |
#define __CONSUMERPRODUCERQUEUE_H__ | |
#include <queue> | |
#include <mutex> | |
#include <condition_variable> | |
/* | |
* Some references in order | |
* |
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 org.n3rd.util; | |
import com.google.common.collect.ImmutableList; | |
import com.medallia.word2vec.Searcher; | |
import com.medallia.word2vec.Word2VecModel; | |
import org.sgdtk.ArrayDouble; | |
import org.sgdtk.DenseVectorN; | |
import org.sgdtk.FeatureVector; | |
import java.io.BufferedReader; |
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 org.n3rd.util; | |
import com.google.common.collect.ImmutableList; | |
import com.medallia.word2vec.Searcher; | |
import com.medallia.word2vec.Word2VecModel; | |
import org.sgdtk.DenseVectorN; | |
import org.sgdtk.FeatureVector; | |
import java.io.BufferedReader; | |
import java.io.File; |
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
# Check performance of baseline on a held out set that is decimation sampled | |
# Over the ranks descending | |
# | |
# http://www.mpi-sws.org/~cristian/Politeness_files/politeness.pdf | |
# | |
import sys | |
import cPickle | |
import numpy as np | |
import nltk.data | |
import json |
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
# Check performance of baseline on a held out set that is decimation sampled | |
# Over the ranks descending | |
# | |
# http://www.mpi-sws.org/~cristian/Politeness_files/politeness.pdf | |
# | |
#----------------------------------------------------------------- | |
# Sample output with and without Punkt sentence processing seems | |
# to not have much effect | |
import cPickle | |
import numpy as np |
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
// Nashorn (JS) script to create input documents from post-processed TSV files | |
// from Stanford Politeness corpus. | |
// TSV looks like | |
// 1|-1\tText content | |
// | |
// Target data looks much like the data described here: | |
// https://github.com/sudhof/politeness | |
// | |
// Original paper is here | |
// http://www.mpi-sws.org/~cristian/Politeness_files/politeness.pdf |
OlderNewer