@@ -273,8 +273,8 @@ class Vocabulary(object):
273
273
274
274
def __init__ (self , vocab_file , start_word = "<S>" , end_word = "</S>" , unk_word = "<UNK>" , pad_word = "<PAD>" ):
275
275
if not tf .gfile .Exists (vocab_file ):
276
- tf .logging .fatal ("Vocab file %s not found." % vocab_file )
277
- tf .logging .info ("Initializing vocabulary from file: %s" % vocab_file )
276
+ tl .logging .fatal ("Vocab file %s not found." % vocab_file )
277
+ tl .logging .info ("Initializing vocabulary from file: %s" % vocab_file )
278
278
279
279
with tf .gfile .GFile (vocab_file , mode = "r" ) as f :
280
280
reverse_vocab = list (f .readlines ())
@@ -294,7 +294,7 @@ def __init__(self, vocab_file, start_word="<S>", end_word="</S>", unk_word="<UNK
294
294
295
295
logging .info ("Vocabulary from %s : %s %s %s" % (vocab_file , start_word , end_word , unk_word ))
296
296
logging .info (" vocabulary with %d words (includes start_word, end_word, unk_word)" % len (vocab ))
297
- # tf .logging.info(" vocabulary with %d words" % len(vocab))
297
+ # tl .logging.info(" vocabulary with %d words" % len(vocab))
298
298
299
299
self .vocab = vocab # vocab[word] = id
300
300
self .reverse_vocab = reverse_vocab # reverse_vocab[id] = word
@@ -1094,7 +1094,7 @@ def moses_multi_bleu(hypotheses, references, lowercase=False):
1094
1094
)
1095
1095
os .chmod (multi_bleu_path , 0o755 )
1096
1096
except Exception : # pylint: disable=W0702
1097
- tf .logging .info ("Unable to fetch multi-bleu.perl script, using local." )
1097
+ tl .logging .info ("Unable to fetch multi-bleu.perl script, using local." )
1098
1098
metrics_dir = os .path .dirname (os .path .realpath (__file__ ))
1099
1099
bin_dir = os .path .abspath (os .path .join (metrics_dir , ".." , ".." , "bin" ))
1100
1100
multi_bleu_path = os .path .join (bin_dir , "tools/multi-bleu.perl" )
@@ -1122,8 +1122,8 @@ def moses_multi_bleu(hypotheses, references, lowercase=False):
1122
1122
bleu_score = float (bleu_score )
1123
1123
except subprocess .CalledProcessError as error :
1124
1124
if error .output is not None :
1125
- tf .logging .warning ("multi-bleu.perl script returned non-zero exit code" )
1126
- tf .logging .warning (error .output )
1125
+ tl .logging .warning ("multi-bleu.perl script returned non-zero exit code" )
1126
+ tl .logging .warning (error .output )
1127
1127
bleu_score = np .float32 (0.0 )
1128
1128
1129
1129
# Close temp files
0 commit comments