{"id":20751001,"url":"https://github.com/vaaaaanquish/dajare-python","last_synced_at":"2025-04-28T12:54:13.205Z","repository":{"id":62566333,"uuid":"242304312","full_name":"vaaaaanquish/dajare-python","owner":"vaaaaanquish","description":"駄洒落データを検索するコマンド、スクレイピングのためのツールキット","archived":false,"fork":false,"pushed_at":"2022-12-08T03:43:06.000Z","size":72,"stargazers_count":18,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-30T09:41:27.246Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vaaaaanquish.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-22T08:09:23.000Z","updated_at":"2024-10-01T08:11:13.000Z","dependencies_parsed_at":"2023-01-24T08:30:36.883Z","dependency_job_id":null,"html_url":"https://github.com/vaaaaanquish/dajare-python","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaaaaanquish%2Fdajare-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaaaaanquish%2Fdajare-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaaaaanquish%2Fdajare-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaaaaanquish%2Fdajare-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vaaaaanquish","download_url":"https://codeload.github.com/vaaaaanquish/dajare-python/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251319036,"owners_count":21570419,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T08:29:38.072Z","updated_at":"2025-04-28T12:54:13.166Z","avatar_url":"https://github.com/vaaaaanquish.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dajare\n\n皆さんに *幸* が訪れる駄洒落の *検索(Search)* を行うスクリプトと、駄洒落の *玄人* になりたい人向けにWebサイトからデータを *クロール* し駄洒落データベースを構築するためのスクリプトです。\n\n\u003cbr/\u003e\n\n## 利用方法\n\n検索用の「dajare_search.py」と各ダジャレサイトのクローラとなる「dajare_crawler.py」を用意しています。\n\n### 検索\n\nダジャレステーションの検索窓を利用して、ダジャレを検索します。\n\npypiからdajareコマンドを取得可能です。\n```\n$ pip install dajare\n$ dajare 布団\n\n布団がふっとんだ\n今日、布団出たら恐怖飛んでた\n猫、マントで寝込まんと？\n...\n```\n\n\n### スクレイピング\n\nWebサイト *で得た* *データ* をjsonにdumpします。\n\n#### 環境構築\n\n「pipenv」もしくは「自前で設定したpython環境」を利用する事ができます。  \npipenvを用いる場合は`pipenv install`の実行のみでOKです。  \npipenvを利用しない場合は、requirements.txtを利用して各moduleをinstallして下さい。  \n```\n$ pipenv install\nor\n$ pip install -r requirements.txt\n```\n\n#### 実行\n\npipenvを利用する場合は以下のように実行します。\n```\n$ pipenv run python dajare_crawler.py --all\n```\n\n\u003cbr/\u003e\n\ndajare_crawler.pyの引数は以下のようになっています。\n\n| args | description | クロール先 |\n| --- | --- | ---|\n| -h, --help | help表示 | - |\n| -a, --all | 全てのサイトのクロール | - |\n| -b, --b | ダジャレナビ | https://dajarenavi.net |\n| -c, --c | ダジャレステーション | https://dajare.jp |\n| -d, --d | ダジャレネット | http://www.dajare.net |\n| -e, --e | バカダス | http://www.biwa.ne.jp/~aki-ina/gyagu.html |\n| -f, --f | ダジャレ辞典 | https://dajareshuu.web.fc2.com |\n| -g, --g | 究極のダジャレ集 | http://syuukaizyo.fc2web.com/02.html |\n| -i, --i | ダジャレの殿堂 | http://archives.kaishaseikatsu.jp |\n| --output OUTPUT | 出力ディレクトリを指定 | - |\n| --sleep SLEEP | requests毎のsleep (float) | - |\n\n\u003cbr/\u003e\n\nダジャレネットとダジャレ辞典のデータをsampleディレクトリにsleep 3.0秒/requests で取得する時は以下のようになります。\n```\n$ python dajare_crawler.py -d -f --output ./sample --sleep 3.0\n```\n\n\u003cbr/\u003e\n\nsleep値の設定等、スクレイピング時のルールについては、以下を参考にして下さい。  \n[Webスクレイピングする際のルールとPythonによる規約の読み込み - Stimulator](https://vaaaaaanquish.hatenablog.com/entry/2017/12/01/064227)\n\n\n\u003cbr/\u003e\n\n## 既存のデータ\n\n2020/02/21時点でのダジャレ統計は以下の通りです。\n\n| Webサイト | ダジャレ数 |\n| --- | --- |\n| ダジャレナビ | 48102 |\n| ダジャレステーション | 64533 |\n| ダジャレネット | 832 |\n| バカダス | 1070 |\n| ダジャレ辞典 | 1115 |\n| 究極のダジャレ集 | 275 |\n| ダジャレの殿堂 | 2200 |\n\n\u003cbr/\u003e\n\n## Json format\n\n出力されるjsonは以下のようなフォーマットです。\n\n```\n{\n    \"url\": \"https://dajare.jp/works/000/\",    # ダジャレが記載されているURL\n    \"text\": \"布団が吹っ飛んだ\",    # ダジャレ\n    \"author\": \"サンプル\",    # ダジャレ投稿者\n    \"author_link\": \"/author/サンプル/\",    # ダジャレ投稿者へのLink\n    \"mean_score\": 5.0,    # ダジャレ評価(平均)\n    \"deviation_score\": 30.0,    # ダジャレ評価(偏差値)\n    \"category\": [    # ダジャレカテゴリのリスト\n        {\n            \"link\": \"/category/1/\",\n            \"text\": \"動物\"\n        },\n        {\n            \"link\": \"/category/1/1/\",\n            \"text\": \"全般\"\n        },\n        {\n            \"link\": \"/category/1/1/1/\",\n            \"text\": \"全般\"\n        }\n    ],\n    \"tag\": [    # ダジャレに紐付いたキーワードのリスト\n        {\n            \"link\": \"/keyword/布団/\",\n            \"text\": \"布団\"\n        }\n    ],\n    \"eval_list\": [    # 評価のリスト\n        {\n            \"author\": {\n                \"link\": \"/author/テスト/\",\n                \"text\": \"テスト\"\n            },\n            \"score\": 3.0,\n            \"datetime\": \"2015/3/14 10:59\"\n        },\n    ]\n}\n```\n\n取得できない場合は空テキストや0が入ります。このフォーマットは全てのクロール先サイトで共通です。\n\n\n\u003cbr/\u003e\n\n## 参考文献\n\n### ダジャレ検出\n- 谷津元樹, 荒木健治. \"子音の音韻類似性及び SVM を用いた駄洒落検出手法.\" 知能と情報 28.5 (2016): 875-886. https://www.jstage.jst.go.jp/article/jsoft/28/5/28_875/_article/-char/ja/\n- 谷津元樹, 荒木健治. \"動画コメントデータ及びブログ記事における駄洒落の抽出.\" 情報処理学会第 81 回全国大会 6 (2019): 07. http://arakilab.media.eng.hokudai.ac.jp/~araki/2018/2018-D-11.pdf\n- 文章からダジャレのみを抜き出すコマンドを作ってみた - Qiita https://qiita.com/kurehajime/items/a922d42dff5e0f03d32c\n- おもしろいダジャレを入力すると布団が吹っ飛ぶ装置を作った - Qiita https://qiita.com/fujit33/items/dbfbd7a2aa3858067b6c\n- ダジャレ TechTalk - エムスリーテックブログ https://www.m3tech.blog/entry/2018/08/03/182447\n- ニコニココメントデータからの駄洒落検出 - 谷津元樹 青山学院大学 https://www.nii.ac.jp/dsc/idr/userforum/startup/IDR-UF2019_S03.pdf\n- ダジャレを判定する - Stimulator https://vaaaaaanquish.hatenablog.com/entry/2020/12/11/122721\n\n### ダジャレデータベース\n- 荒木健治. \"駄洒落データベースの構築及び分析\" ことば工学研究会: 人工知能学会第 2 種研究会ことば工学研究会 57 (2018): 39-48. http://arakilab.media.eng.hokudai.ac.jp/~araki/2017/2017-C-3.pdf\n- 荒木健治. \"駄洒落データベースを用いた駄洒落生成システムの性能評価\" ことば工学研究会: 人工知能学会第 2 種研究会ことば工学研究会 56 (2017): 13-24. https://ci.nii.ac.jp/naid/40021582065/\n- 荒木健治. \"駄洒落データベースの拡張及び分析\" ことば工学研究会: 人工知能学会第 2 種研究会ことば工学研究会資料 58 (2018): 1-15. https://ci.nii.ac.jp/naid/40021829772/\n\n\n### ダジャレ生成\n- 内田ゆず, 荒木健治. \"オノマトペに着目した駄洒落の面白さの分析―駄洒落の自動生成に向けて―.\" 日本知能情報ファジィ学 第35回ファジィシステムシンポジウム. 2019. https://www.jstage.jst.go.jp/article/fss/35/0/35_332/_article/-char/ja/\n- 金久保正明. \"形態素解析手法と通俗的単語群に基づく類音文変換システム.\" 情報処理学会論文誌 54.7 (2013): 1937-1950. https://ipsj.ixsq.nii.ac.jp/ej/?action=pages_view_main\u0026active_action=repository_view_main_item_detail\u0026item_id=94391\u0026item_no=1\u0026page_id=13\u0026block_id=8\n- 田辺　公一朗. \"駄洒落のコンピュータによる処理-- 駄洒落生成システムの基本設計 --\" Sanno University Bulletin Vol.26 No. 1 September 2005 https://www.sanno.ac.jp/undergraduate/library/cpir4n0000006hnm-att/260104.pdf\n- 阿部香央莉, et al. \"Zunkobot: 複数の知識モジュールを統合した雑談対話システム.\" SIG-SLUD 5.02 (2018): 112-117. https://jsai.ixsq.nii.ac.jp/ej/?action=repository_action_common_download\u0026item_id=9639\u0026item_no=1\u0026attribute_id=1\u0026file_no=1\n\n### ダジャレ分析\n- 内田ゆず, 荒木健治. \"駄洒落に使用されるオノマトペの特徴分析.\" 知能と情報 32.1 (2020): 507-511. https://www.jstage.jst.go.jp/article/jsoft/32/1/32_507/_article/-char/ja/\n- 谷津元樹, 荒木健治. \"駄洒落の面白さにおける要因の分析.\" 日本知能情報ファジィ学会 講演論文集 第32回ファジィシステムシンポジウム. 2016. https://www.jstage.jst.go.jp/article/fss/32/0/32_237/_article/-char/ja/\n- 川原繁人, 篠原和子. \"ダジャレから見る母音の近似性.\" 音声研究 13.3 (2009): 101-110. https://ci.nii.ac.jp/naid/110008722613/\n- 篠原和子, 川原繁人. \"日本語のダジャレにおける音節挿入.\" 日本認知言語学会論文集 10 (2010): 313-323. https://ci.nii.ac.jp/naid/40018766044/\n- KOBAYASHI Yoshitomo. \"駄洒落の基本構造と笑い\" 東京外国語大学 http://www.tufs.ac.jp/st/personal/03/conanweb/dajare.htm\n\n### ダジャレ対話\n- 徐云帆, 荒木健治. \"雑談対話システムにおける LSTM を用いた駄洒落による対話破綻回避の有効性.\" SIG-SLUD 5.02 (2018): 143-148. https://jsai.ixsq.nii.ac.jp/ej/?action=repository_action_common_download\u0026item_id=9645\u0026item_no=1\u0026attribute_id=1\u0026file_no=1\n- 谷津元樹. \"統合型対話システムにおける話題適応及び駄洒落ユーモア処理に関する研究.\" (2017). https://eprints.lib.hokudai.ac.jp/dspace/bitstream/2115/65779/1/Motoki_Yatsu.pdf\n\n\u003cbr/\u003e\n\n## 開発\nPull Requestをお待ちしております。READMEにダジャレを生やすだけでもOKです。\n\u003cbr/\u003e\n\n\n開発者向けのツールキットもリポジトリ内に含んでいますので活用して下さい。\n\n- クロールした結果のjsonの中身を見るためのjupyter nootbook\n\t- https://github.com/vaaaaanquish/dajare-python/blob/master/ipynb/check_json.ipynb\n- クロールの開発用jupyter notebook\n    - https://github.com/vaaaaanquish/dajare-python/blob/master/ipynb/scraping_dev.ipynb\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaaaaanquish%2Fdajare-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvaaaaanquish%2Fdajare-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaaaaanquish%2Fdajare-python/lists"}