Giter Site home page Giter Site logo

chinese-word2vec-pytorch's Introduction

word2vec implementation for skip-gram in pytorch

本repo包含了使用pytorch实现skip-gram版本的word2vec词向量模型。

备注: 该版本以batch为1进行训练,速度较慢。

目录结构

主要的代码目录结果如下所示:

├── pyword2vec
|  └── callback
|  |  └── lrscheduler.py  
|  └── config
|  |  └── word2vec_config.py  
|  └── dataset           
|  └── io              
|  └── model
|  └── output           
|  └── preprocessing    
|  └── train
|  └── utils
├── get_similar_words.py
├── train_gensim_word2vec.py
├── train_word2vec.py

案例

  1. 首先下载数据集,可以从百度网盘{提取码:7fyf},并放入pyw2v/dataset/raw文件夹中

  2. 修改config文件夹中对应的数据路径配置

  3. 运行python train_word2vec.py进行word2vec模型训练

实验结果

大概6次epochs之后,可得到以下结果:

目标词 Top10 目标词 Top10
** ** : 1.000 男人 男人 : 1.000
** 美国 : 0.651 男人 女人 : 0.764
** 日本 : 0.578 男人 女生 : 0.687
** 国家 : 0.560 男人 男生 : 0.670
** 发展 : 0.550 男人 喜欢 : 0.625
** 文化 : 0.529 男人 恋爱 : 0.601
** 朝鲜 : 0.512 男人 岁 : 0.590
** 经济 : 0.504 男人 女 : 0.588
** 世界 : 0.493 男人 感觉 : 0.586
** 社会 : 0.481 男人 男朋友 : 0.581

chinese-word2vec-pytorch's People

Contributors

lonepatient avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

chinese-word2vec-pytorch's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.