Mercurial > pylearn
diff embeddings/convert.py @ 468:a07948f780b9
Moved embeddings out of sandbox
author | Joseph Turian <turian@iro.umontreal.ca> |
---|---|
date | Tue, 21 Oct 2008 16:24:44 -0400 |
parents | sandbox/embeddings/convert.py@ed6b0b3be8d2 |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/embeddings/convert.py Tue Oct 21 16:24:44 2008 -0400 @@ -0,0 +1,15 @@ +#!/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)