Skip to content

Instantly share code, notes, and snippets.

View kawine's full-sized avatar

Kawin kawine

View GitHub Profile
@kawine
kawine / cspmi.py
Last active October 4, 2019 07:53
import numpy as np
from scipy.stats import pearsonr, ttest_ind
from scipy.spatial.distance import cosine
ANALOGY_VOCAB = set([]) # specify your vocabulary
class pair2joint(object):
"""Load co-occurrence counts and calculate PMI and csPMI."""
def __init__(self, fn='counts.txt'):
"""