Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/tensorpack/tensorpack
/ _read_words
Function
_read_words
examples/PennTreebank/reader.py:25–27 ·
view source on GitHub ↗
(filename)
Source
from the content-addressed store, hash-verified
23
24
25
def
_read_words(filename):
26
with
tf.gfile.GFile(filename,
"rb"
)
as
f:
27
return
f.read().decode(
"utf-8"
).replace(
"\n"
,
"<eos>"
).split()
28
29
30
def
_build_vocab(filename):
Callers
2
_build_vocab
Function · 0.85
_file_to_word_ids
Function · 0.85
Calls
1
read
Method · 0.80
Tested by
no test coverage detected
Used in the wild
real call sites across dependent graphs
searching dependent graphs…