bc1351d47d9fe83bc6c7830a8563ddb874953ed4,onmt/inputters/inputter.py,,load_fields_from_vocab,#Any#Any#,133
Before Change
object from the input.
vocab = dict(vocab)
n_src_features = len(collect_features(vocab, "src"))
n_tgt_features = len(collect_features(vocab, "tgt"))
fields = get_fields(data_type, n_src_features, n_tgt_features)
for k, v in vocab.items():
fields[k].vocab = v
After Change
object from the input.
vocab = dict(vocab)
n_src_features = sum("src_feat_" in k for k in vocab)
n_tgt_features = sum("tgt_feat_" in k for k in vocab)
fields = get_fields(data_type, n_src_features, n_tgt_features)
for k, vals in fields.items():
for n, f in vals:
if n in vocab:
f.vocab = vocab[n]
return fields
def old_style_vocab(vocab):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 7
Instances Project Name: OpenNMT/OpenNMT-py
Commit Name: bc1351d47d9fe83bc6c7830a8563ddb874953ed4
Time: 2019-01-09
Author: benzurdopeters@gmail.com
File Name: onmt/inputters/inputter.py
Class Name:
Method Name: load_fields_from_vocab
Project Name: hanxiao/bert-as-service
Commit Name: f0d581c071f14682c46f7917e11592c189382f53
Time: 2018-12-17
Author: hanhxiao@tencent.com
File Name: server/bert_serving/server/__init__.py
Class Name: BertServer
Method Name: _run
Project Name: OpenNMT/OpenNMT-py
Commit Name: f6f6ee1df8d619d9816a5296bebca5736fa952bf
Time: 2017-09-21
Author: bpeters@coli.uni-saarland.de
File Name: translate.py
Class Name:
Method Name: main