# 中文 Word2Vec ###### tags: `NLP` ## 概述 **Word2Vec** 目標在學習單詞的 embedding,使單詞能有更緊緻的向量表示,模型通過學習單詞與其他單詞在句子中的關係來完成。 > 詞的語意由其上下文決定 **gensim** 是 Word2Vec 經典套件,一般來說,我們會通過輸入大量的文本資料讓模型學到更精確的 embedding,如維基百科的中文文本,或下載已經訓練好的 Word2Vec。目前中文 NLP 主要有兩種常見的 Word2Vec 模型,一種**以字為單位**,一種則是**以詞為單位**,以詞為單位的模型會更大,另外,怎麼進行斷詞也是很大的學問,**jieba** 套件是處理中文斷詞常見的套件。 ## opencc 1. **介紹**:opencc 是進行繁簡轉換重要的工具,其處理功能與效率都要優於 word。 2. **安裝** (mac) ``` brew install opencc ``` 3. **指令** ``` opencc -i 需要轉換的文件路徑 -o 轉換後的文件路徑 -c 配置文件路徑 ``` 4. **Link** + https://code.google.com/archive/p/opencc/wikis/Install.wiki + https://blog.csdn.net/sinat_29957455/article/details/81290356 ## jieba 1. **安裝** ``` pip install jieba ``` 2. **語法** ```python jieba.lcut(s) ``` ## gensim 1. **安裝** ``` pip install genism ``` ## pretrain 模型 1. [中研院](https://ckip.iis.sinica.edu.tw/project/embedding) 2. [台北醫學大學](http://nlp.tmu.edu.tw/word2vec/index.html) 3. [元智大學](http://nlp.innobic.yzu.edu.tw/demo/word-embedding.html) 4. [騰訊](https://www.bilibili.com/video/BV1dr4y1u76M?spm_id_from=333.337.search-card.all.click) ## 自行訓練 Word2Vec 1. [wiki 訓練 word2vec](https://github.com/zake7749/word2vec-tutorial) 2. [說明文件](http://zake7749.github.io/2016/08/28/word2vec-with-gensim/) TF IDF
×
Sign in
Email
Password
Forgot password
or
Sign in via Google
Sign in via Facebook
Sign in via X(Twitter)
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
Continue with a different method
New to HackMD?
Sign up
By signing in, you agree to our
terms of service
.