Exemplo n.º 1
0
 def _make_text_vocab_float_file():
     filepath = os.path.join(test.get_temp_dir(), "vocab_freq_float.txt")
     with open(filepath, "w") as f:
         writer = csv.writer(f)
         writer.writerows([
             ["and", 0.4],
             ["life", 0.08],
             ["the", 0.3],
             ["to", 0.2],
             ["universe", 0.02],
         ])
     return filepath
Exemplo n.º 2
0
 def tmp_dir(self):
   tmp = tempfile.mkdtemp(dir=test.get_temp_dir())
   yield tmp
   gfile.rmtree(tmp)