Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/clab/dynet
/ __init__
Method
__init__
examples/python-utils/util.py:4–6 ·
view source on GitHub ↗
(self, w2i)
Source
from the content-addressed store, hash-verified
2
3
class
Vocab:
4
def
__init__(self, w2i):
5
self.w2i = dict(w2i)
6
self.i2w = {i:w
for
w,i in w2i.items()}
7
8
@classmethod
9
def
from_corpus(cls, corpus):
Callers
nothing calls this directly
Calls
no outgoing calls
Tested by
no test coverage detected