MCPcopy Create free account
hub / github.com/clab/dynet / process_test

Function process_test

examples/transformer/wrap-data.py:79–89  ·  view source on GitHub ↗
(sf, of, vocab)

Source from the content-addressed store, hash-verified

77 print >>fout, '</s>'
78
79def process_test(sf, of, vocab):
80 with open(of, 'w') as fout:
81 with open(sf) as sin:
82 for sline in sin:
83 print >>fout, '<s>',
84 for token in sline.split():
85 if token in vocab:
86 print >>fout, token,
87 else:
88 print >>fout, '<unk>',
89 print >>fout, '</s>'
90
91ofname = sys.argv[3] + "." + sys.argv[1] + "-" + sys.argv[2] + ".capped" # '/home/vhoang2/tools/nmt/nmt/scripts/iwslt15/train.en-vi.vcb.capped'
92

Callers 1

wrap-data.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected