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
"""Iterative Normalization""" | |
from argparse import ArgumentParser | |
import numpy as np | |
def load_embed(filename, max_vocab=-1): | |
words, embeds = [], [] | |
with open(filename, 'r') as f: | |
next(f) | |
for line in f: |
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
"""English function words. | |
Sets of English function words, based on | |
E.O. Selkirk. 1984. Phonology and syntax: The relationship between | |
sound and structure. Cambridge: MIT Press. (p. 352f.) | |
The categories are of my own creation. | |
""" |
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
def pearsonr(x, y): | |
""" | |
Mimics `scipy.stats.pearsonr` | |
Arguments | |
--------- | |
x : 1D torch.Tensor | |
y : 1D torch.Tensor | |
Returns |