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

Function read

examples/tagger/bilstmtagger.py:14–23  ·  view source on GitHub ↗
(fname)

Source from the content-addressed store, hash-verified

12MLP=True
13
14def read(fname):
15 sent = []
16 for line in open(fname):
17 line = line.strip().split()
18 if not line:
19 if sent: yield sent
20 sent = []
21 else:
22 w,p = line
23 sent.append((w,p))
24
25train=list(read(train_file))
26test=list(read(test_file))

Callers 1

bilstmtagger.pyFile · 0.70

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected