Skip to content

Instantly share code, notes, and snippets.

@uchidama
Created February 20, 2024 07:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uchidama/af46504ed194db515c0ca2f4c76a7049 to your computer and use it in GitHub Desktop.
Save uchidama/af46504ed194db515c0ca2f4c76a7049 to your computer and use it in GitHub Desktop.
'''
データセット関連の情報
https://huggingface.co/datasets/graelo/wikipedia <- 日本語データセット読める
https://huggingface.co/datasets/wikipedia <- 日本語データセット読めない
https://dumps.wikimedia.org/jawiki/
'''
'''
実行コマンド。実行時間のログをテキストに書いておく
# python3 wikipedia_en_load.py | tee wikipedia_en_load.txt
仮想環境の作成
# python3.11 -m venv myenv
仮想環境をアクティベート
# source myenv/bin/activate
使用後は仮想環境をデアクティベート
# deactivate
'''
# datetime モジュールをインポート
from datetime import datetime
from datasets import load_dataset
def get_current_datetime_formatted():
# 現在の日時を取得
current_datetime = datetime.now()
# 日時を「年-月-日 時:分:秒」の形式に整形
formatted_datetime = current_datetime.strftime('%Y-%m-%d %H:%M:%S')
# 整形した日時を表示
return formatted_datetime
print("start:" + get_current_datetime_formatted())
# データセットの保存先を外付けハードディスクにしているのでchache_dirを指定
# wikipediaデータセットよりenダウンロード。25分くらいかかった
wiki_en = load_dataset("wikipedia", "20220301.en", cache_dir="/Volumes/DataSets/DataSets")
# graelo/wikipediaデータセットよりenダウンロード
graelo_wiki = load_dataset("graelo/wikipedia", "20230901.en", cache_dir="/Volumes/DataSets/DataSets")
print("end:" + get_current_datetime_formatted())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment