Document2Vec を使ってみる
Finding document vectors from pre-trained word2vec word vectors
先人に感謝.
前準備
Python のインストール(Windows上)
注:既にPython(バージョン3.12を推奨)がインストール済みの場合は,この手順は不要である.
winget(Windowsパッケージマネージャー)を使用してインストールを行う
- Windowsで,コマンドプロンプトを管理者権限で起動する(手順:Windowsキーまたはスタートメニュー,「cmd」と入力,右クリックメニューなどで「管理者として実行」を選択)
- winget(Windowsパッケージマネージャー)が利用可能か確認する:
winget --version
- Pythonのインストール(下のコマンドにより Python 3.12 がインストールされる).
reg add "HKLM\SYSTEM\CurrentControlSet\Control\FileSystem" /v LongPathsEnabled /t REG_DWORD /d 1 /f REM Python をシステム領域にインストール winget install --scope machine --id Python.Python.3.12 --id Python.Launcher -e --silent REM Python のパス set "INSTALL_PATH=C:\Program Files\Python312" echo %PATH% | find /i "%INSTALL_PATH%" >nul if errorlevel 1 setx PATH "%PATH%;%INSTALL_PATH%" /M >nul echo %PATH% | find /i "%INSTALL_PATH%\Scripts" >nul if errorlevel 1 setx PATH "%PATH%;%INSTALL_PATH%\Scripts" /M >nul
- Python詳細ガイド:Pythonまとめ »
- Windows で,コマンドプロンプトを管理者権限で起動する(手順:Windowsキーまたはスタートメニュー,「cmd」と入力,右クリックメニューなどで「管理者として実行」を選択)
- ダウンロードとインストール
cd /d c:%HOMEPATH% rmdir /s /q Document2Vec git clone https://github.com/cemoody/Document2Vec cd Document2Vec python -m pip install pandas numpy gensim
- インストールが成功したかを確認したい.
新しくコマンドプロンプトを開き, 次のコマンドを順に実行.エラーメッセージが出なければ成功.
cd /d c:%HOMEPATH% cd Document2Vec python import document2vec exit()
【関連する外部サイト】
【サイト内の関連ページ】
Git のインストール
Git の URL: https://git-scm.com/
Document2Vec のインストール
cemoody/Document2Vec の Web ページ: https://github.com/cemoody/Document2Vec