view embeddings/convert.py @ 534:eaa5ad4089a1

Another bugfix in pylearn.embeddings.length()
author Joseph Turian <turian@gmail.com>
date Tue, 18 Nov 2008 03:49:37 -0500
parents a07948f780b9
children
line wrap: on
line source

#!/usr/bin/python
"""
Convert stdin sentences to word embeddings, and output YAML.
"""

import sys, string
import read
import yaml

output = []
for l in sys.stdin:
    l = string.strip(l)
    output.append((l, read.convert_string(l)))

print yaml.dump(output)