--- task_categories: - image-to-text - text2text-generation language: - ja --- ## 読み込み方 ```python from datasets import load_dataset dataset = load_dataset("YANS-official/bokete-ogiri-test", split="test") ``` ## 概要 大喜利投稿サイトBoketeのクロールデータです。 元データは CLoT-Oogiri-Go [Zhang+ CVPR2024]というデータの一部です。 詳細は[CVPRのプロジェクトページ](https://zhongshsh.github.io/CLoT/)をご確認ください。 このデータは以下の3タスクが含まれます。 * text_to_text: テキストでお題が渡され、それに対する回答を返します。 * image_to_text: いわゆる「画像で一言」です。画像のみが渡されて、テキストによる回答を返します。 * text_image_to_text: 画像中にテキストが書かれています。テキストの一部が空欄になっているので、そこに穴埋めする形で回答を返します。 それぞれの量は以下の通りです。 | タスク | お題数(画像枚数) | 回答数 | うち委員が用意したお題 | | --- | ---: | ---: | ---: | | image_to_text | 56 | 112 | 6 | | text_to_text | 22 | 44 | 2 | | imate_text_to_text | 22 | 44 | 2 | ## データの前処理 1. 原本のデータには日英中の3言語が含まれますが、日本語だけを抽出しました。 2. 入力にテキストがあるタスク(text_to_textとimage_text_to_text)は、入力テキストも画像化されていたため、OCRを行いました。詳細は下に記載します。 3. 入出力テキスト(回答とステップ2のOCR結果)から、不適切な表現を含む文を削除。フィルタリングには HojiChar [[リンク](https://github.com/HojiChar/HojiChar)] を用いました。 4. ステップ3で全ての回答が消えたお題や、お題自体に不適切表現が含まれる場合はお題とその画像を削除 5. 残ったお題に対して回答が10件以上ある場合は、スコアが高い順に2件を残して削除。下位の回答が見るに耐えないので、上から2件とした。 HojiCharで使ったフィルタは以下の通りです。 * hojichar.document_filters.DiscardAdultContentJa() * hojichar.document_filters.DiscardAdultContentEn() * hojichar.document_filters.DiscardViolenceContentJa() * hojichar.document_filters.DiscardDiscriminationContentJa() * hojichar.document_filters.DocumentLengthFilter(min_doc_len=0, max_doc_len=100) ### OCR 2024年07月21日に、OpenAI APIの gpt-4oに画像と下記プロンプトを与えてOCRを実行しました。 image_text_to_text では画像中に穴埋め用の空欄が用意されていますので、GPTで検出できた場合は "[空欄]" として出力させています。テストデータ(このデータ)では、OCR誤りの有無を人力で調べて修正しています。 > この画像から文字起こししてください。画像中の文字以外の情報は書かないでください。1文字もない場合は [なし] を返してください。空欄になっている部分は特殊記号 [空欄] で置き換えてください。 ## データセットの各カラム説明 | カラム名 | 型 | 例 | 概要 | | --- | --- | --- | --- | | odai_id | int | 85 | お題のID | | image | int | 6094670 | 画像のID。それぞれ"{image}.jpg"という画像に対応している。 | | type | str | "text_to_text" | "text_to_text", "image_to_text", "image_text_to_text"のどれかが入っている。| | use_human_eval | bool | False | 人手評価で使うデータ(=委員の画像で作ったデータ)かどうかを表す。Trueなら人手評価で使う | | odai | str | ボケてあるあるを教えてください。 | I2Tの場合は"画像で一言"という文字列が格納されている。そのほかの場合は画像からOCRした結果が格納されている。 | | responses | list | [{}] | お題に対する回答集。各お題に対して最大10件まで | | responses.response_id | int | 1 | お題に対する回答の番号。 | | responses.text | str | ハマって睡眠不足 | そのお題に対する回答 | | responses.score | int | 3 | Bokete上でのいいねの数 | ## ライセンス 元データにしたCLoTの[HuggingFace Hub](https://huggingface.co/datasets/zhongshsh/CLoT-Oogiri-GO)には以下のような記載があります。 > License: Creative Commons Attribution 4.0 International. We also adhere to the terms of use from any of the data sources, such as Bokete and Zhihu. If you have any concerns regarding this dataset, especially if you believe it infringes upon your legal rights, please feel free to contact us. We will promptly review any issues raised and respond accordingly. Boketeの規約上は問題ないと思われますが、BoketeのユーザがBoketeにアップロードした画像は著作権上問題がありそうなものが散見されます。 このハッカソン以外で用いる場合はZhangらの原本を各自でクリーニングして用いることを勧めます。 ## リファレンス * @misc{zhong2023clot, title={Let's Think Outside the Box: Exploring Leap-of-Thought in Large Language Models with Creative Humor Generation}, author={Zhong, Shanshan and Huang, Zhongzhan and Gao, Shanghua and Wen, Weushao and Lin, Liang and Zitnik, Marinka and Zhou, Pan}, journal={arXiv preprint arXiv:2312.02439}, year={2023} } * Shinzato, K. (2023). HojiChar: The text processing pipeline (Version 0.9.0) [Computer software]. https://github.com/HojiChar/HojiChar