print("Retrofitting: Iteration %s of %s" % (iteration+1, iterations))
vecs = sparse_csr.dot(vecs)
vecs -= vecs.mean(0)
// use sklearn"s normalize, because it normalizes in place and
// leaves zero-rows at 0
normalize(vecs, norm="l2", copy=False)
After Change
lang = label.split("/")[2]
rows_by_language[lang].append(i)
all_languages = sorted(rows_by_language)
row_groups = [rows_by_language[lang] for lang in all_languages]
// Subtract the mean so that vectors don"t just clump around common
// hypernyms
for row_group in row_groups: