当前位置:网站首页>对word2vec的一些浅层理解
对word2vec的一些浅层理解
2022-07-07 08:14:00 【strawberry47】
最近有朋友问到word2vec是怎么一回事,于是我又复习了一遍相关知识,记录下自己的一些思考,防止遗忘~
word2vec是获取词向量的手段,它是在NNLM基础上改进的。
训练模型本质上是只具有一个隐含层的神经元网络。
它有两种形式 ① skip-gram:从两边预测中间 ② C-BOW:从中间预测两边;
注意,这两种形式只是代表两种不同的训练方式,最终都是取输入层->隐藏层的权重,作为词向量。
训练时,以CBOW为例,假设语料库是“今天的天气真好”;模型的输入是 "今 天 的 天 真 好"六个单词的one-hot vector,输出是一堆概率,我们希望“气”出现的概率最大。
写代码的时候,通常是调用gensim库,传入语料库就可以训练出词向量了。
一些训练时的小trick:Negative Sampling,哈夫曼树
参考:[NLP] 秒懂词向量Word2vec的本质,总结word2vec(实验室师兄写的博客)
边栏推荐
猜你喜欢

STM32 Basics - memory mapping

Chris LATTNER, the father of llvm: why should we rebuild AI infrastructure software

High number_ Chapter 1 space analytic geometry and vector algebra_ Quantity product of vectors

STM32基础知识—内存映射

Appx代碼簽名指南

Review of the losers in the postgraduate entrance examination

The story of Plato and his three disciples: how to find happiness? How to find the ideal partner?

Serial communication relay Modbus communication host computer debugging software tool project development case

Google colab loads Google drive (Google drive is used in Google colab)

Inno Setup 打包及签名指南
随机推荐
C#记录日志方法
LLVM之父Chris Lattner:为什么我们要重建AI基础设施软件
Pdf document signature Guide
求方程ax^2+bx+c=0的根(C语言)
When there are pointer variable members in the custom type, the return value and parameters of the assignment operator overload must be reference types
MCU is the most popular science (ten thousand words summary, worth collecting)
柏拉图和他的三个弟子的故事:如何寻找幸福?如何寻找理想伴侣?
Es classes and objects, prototypes
反射效率为什么低?
IO模型复习
SQLyog数据库怎么取消自动保存更改
Postman interface test VII
Appx代碼簽名指南
Slurm资源管理与作业调度系统安装配置
STM32中AHB总线_APB2总线_APB1总线这些是什么
Sword finger offer 38 Arrangement of strings [no description written]
Advanced function learning in ES6
Kotlin实现微信界面切换(Fragment练习)
This article explains the complex relationship between MCU, arm, muc, DSP, FPGA and embedded system
ORM model -- creation and query of data records