opts = Options()

with tf.Graph().as_default(), tf.Session() as session:

model = Word2Vec(opts, session)

if FLAGS.interactive:

#print('load model from file %s %s', opts.save_path, os.path.join(opts.save_path, "/model.ckpt"))

#model.saver.restore(session, os.path.join(opts.save_path, "/model.ckpt"))

model.saver.restore(session, "./data/result/model.ckpt")

#print(model.nearby(['elephant']))

print('finsh model loading')

while True:

print('input your word')

word = sys.stdin.readline().strip()

print('haha')

print(model.nearby(['proton', 'elephant', 'maxwell']))

print(model.nearby([word]))

 
 

[root@cq01-forum-rstree01 embedding]# pwd

/home/users/chenghuige/other/tensorflow/bazel-bin/tensorflow/models/embedding

[root@cq01-forum-rstree01 embedding]# ./word2vec_optimized --train_data ./data/text8 --eval_data ./data/questions-words.txt --save_path ./data/result/ --interactive=1

 
 

 
 

最新文章

  1. 《数据结构与算法Python语言描述》习题第二章第二题(python版)
  2. phpcms V9 栏目管理
  3. 闲鱼demo
  4. 2、NASA HS3(Hurricane AND Server Storm Sentinel)
  5. C#的LINQ to Object
  6. R语言学习笔记:简单的回归分析
  7. hadoop启动之后出现错误:Retrying connect to server: hadoop/192.168.73.100:9000. Already tried 0 time(s);
  8. hdoj 5373 The shortest problem
  9. android视频播放心得体会
  10. inux 安装中文支持包及中文字符集配置 +i18n
  11. 查看DB文件的空间使用情况
  12. Java中的数值和集合
  13. MLDS笔记:Generalization
  14. UOJ #310「UNR #2」黎明前的巧克力
  15. .net 后台判断是否要替换
  16. vs code的快捷方式
  17. HDU ACM 1869 六度分离(Floyd)
  18. 网络编程 -- RPC实现原理 -- Netty -- 迭代版本V2 -- 对象传输
  19. DW表格的简单应用 之(个人简历模板)
  20. django面试六

热门文章

  1. DevExpress.chartContro控件保存图片和打印图片
  2. 如何合并多个PPT
  3. RabbitMQ consumer的一些坑
  4. 单元测试与Moq
  5. linux下常见解压缩命令
  6. Solve
  7. GDB调试D语言
  8. ecshop后台权限审核列表
  9. thwen 缓动框架
  10. Codeforces#262_1002