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 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'): | |
""" |