Skip to content

Conversation

@silvioOlivastri
Copy link

Fix MemoryError: #13

@silvioOlivastri
Copy link
Author

If you want I have new FAST version:

def getWordmapFast(wordfile):
    wordEmbedding = pd.read_table(wordfile, sep=" ", index_col=0, header=None, quoting=csv.QUOTE_NONE)
    words = {}
    We = np.zeros(shape=(wordEmbedding.shape[0], wordEmbedding.shape[1]))
    n = 0
    for row in wordEmbedding.itertuples():
        words[row[0]] = n
        We[n] = row[1:]
        n+=1
    return (words, We)

The bad thing is the approximation. I don't know why, but few values of glove are little bit different when into wordEmbedding variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant