{"id":17282752,"url":"https://github.com/zenixls2/2chpreprocess","last_synced_at":"2025-03-26T16:11:16.381Z","repository":{"id":138002656,"uuid":"96774797","full_name":"zenixls2/2chpreprocess","owner":"zenixls2","description":"Dump messages from 2ch with some preprocessing for ML analysis","archived":false,"fork":false,"pushed_at":"2017-07-18T06:12:41.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-31T17:52:17.739Z","etag":null,"topics":["2ch","crawler","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zenixls2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-10T12:25:45.000Z","updated_at":"2017-07-11T10:16:05.000Z","dependencies_parsed_at":"2024-05-30T12:06:53.382Z","dependency_job_id":null,"html_url":"https://github.com/zenixls2/2chpreprocess","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/zenixls2%2F2chpreprocess","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zenixls2%2F2chpreprocess/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zenixls2%2F2chpreprocess/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zenixls2%2F2chpreprocess/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zenixls2","download_url":"https://codeload.github.com/zenixls2/2chpreprocess/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245689509,"owners_count":20656417,"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":["2ch","crawler","python"],"created_at":"2024-10-15T09:49:41.765Z","updated_at":"2025-03-26T16:11:16.352Z","avatar_url":"https://github.com/zenixls2.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## 2ch preprocessor\n------------------\nThis is a 2ch crawler \u0026 preprocessor for creating chatbot-rnn readable format.\nThe crawler part is almost complete, but the preprocessor part is still under development.\n- TODO ITEMS:\n  * Normalize kanji, hirakana and katakana to romaji (alphabet) to decrease the vocabulary amount.\n  * truncate useless ANSI Art\n  * create a post processor to convert romaji to kanji, hirakana, or katakana\n  * preprocess data as dialog format defined in chatbot-rnn\n\n### Features\n- Ignore some functional boards, and crawl through all the threads in 2ch\n- checkpoint recovery (bug should be fixed now)\n- multiple workers for crawling\n- save to sqlite db\n\n### Installation\n```bash\n# Ubuntu\nsudo apt-get install sqlite3\n# Mac\nbrew install sqlite3\n\ngit clone https://github.com/zenixls2/2chpreprocess\ncd 2chpreprocess\nvirtualenv venv\nsource venv/bin/activate\npip install -r requirements.txt\n```\n\n### Execution\nusage: main.py [-h] [-t] [-r] [-p] [-w WORKER]\n\n2ch data preprocessor \u0026 crawler\n\noptional arguments:\n  * -h, --help            show this help message and exit\n  * -t, --topic           get topic links\n  * -r, --rerun           ignore cache results and rerun\n  * -p, --process         process generated topic link\n  * -w WORKER, --worker WORKER\n                          number of workers\n\nFirst crawl out all topics:\n```bash\nsource venv/bin/activate\npython main.py -t\n```\n\nAnd crawl through all threads:\n```bash\nsource venv/bin/activate\npython main.py -p -w ${WORKER}\n```\nNotice that this could stop by users at any time.\nThe process could be recovered using the `checkpoint.pkl` file stored in `save`.\nThe result is by default save in `save` directory.\nYou could use `-r` to ignore the checkpoint settings and re-run.\n\n### About Crawling Result\nThere should be an `output.db` in your `save` directory once you execute with `-p` option. The scheme in sqlite3 db is defined as follows:\n```yaml\nmessages:\n  - name(unicode) // category name\n  - id(int) // floor id / index id in each thread\n  - thread_id(text) // the topic's thread id\n  - message(text) // the message content for that index\n```\nYou could use sqlite3 to access it:\n```bash\nbash$\u003e sqlite3 output.db\nSQLite version 3.16.0 2016-11-04 19:09:39\nEnter \".help\" for usage hints.\nsqlite\u003e select * from messages limit 2;\n趣味一般|1|1112706898|トイレでするより､外で立ちションをするほうが､  解放感があって気持ちがいいですよね｡\n趣味一般|2|1112706898|に（´・ω・２）\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzenixls2%2F2chpreprocess","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzenixls2%2F2chpreprocess","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzenixls2%2F2chpreprocess/lists"}