遇见数据集

BananaMind-Chat-Title-200K

收藏
魔搭社区2026-09-05 更新2026-09-06 收录
官方服务:

资源简介:

![Banner](banner.png) # BananaMind Chat Title 200K BananaMind Chat Title 200K is an title generation dataset. It contains generated chat titles for examples from the first 200,000 rows of [`lmsys/lmsys-chat-1m`](https://huggingface.co/datasets/lmsys/lmsys-chat-1m), but it does not include raw LMSYS prompt text. # That makes the biggest publicly available chat title dataset on huggingface! Instead, each row stores an LMSYS row reference and the generated title. Users with access to LMSYS-Chat-1M can reconstruct the original first user message locally. ## Why ID-only? `lmsys/lmsys-chat-1m` is gated and has its own license/access terms. This dataset avoids redistributing raw LMSYS prompt text directly by storing only row references plus generated titles. ## Columns | Column | Type | Description | |---|---:|---| | `conversation_id` | string/null | Conversation identifier from LMSYS if available. | | `lmsys_row_id` | int | Row index in the first 200,000 rows of `lmsys/lmsys-chat-1m`. This is the primary reconstruction key. | | `title` | string | Generated chat title. | Example row: ```json {"conversation_id": null, "lmsys_row_id": 12345, "title": "Python List Sorting"} ``` ## Title generation Titles were generated from the first user message only. Assistant responses from LMSYS were not used as model input. Generation prompt: ```text Generate a Chat Title for this Conversation: User: "<first user message>" Only Output the Chat Name and nothing else ``` Generation model/API: ```text google/gemma-4-26b-a4b-it through OpenRouter, with Google Vertex preferred when available. ``` ## Load the ID-only dataset ```python from datasets import load_dataset ds = load_dataset("BananaMind/BananaMind-Chat-Title-200K", split="train") print(ds) print(ds[0]) ``` ## Reconstruct prompts from LMSYS You need access to `lmsys/lmsys-chat-1m`. Install dependencies: ```bash pip install -U datasets huggingface_hub hf auth login ``` Run: ```python import json from datasets import load_dataset ID_DATASET = "BananaMind/BananaMind-Chat-Title-200K" LMSYS_DATASET = "lmsys/lmsys-chat-1m" OUT_PATH = "bananamind_chat_titles_with_prompts.jsonl" def normalize_conv(conv): if conv is None: return [] if isinstance(conv, str): try: conv = json.loads(conv) except Exception: return [{"role": "user", "content": conv}] if isinstance(conv, dict): conv = conv.get("messages") or conv.get("conversation") or conv.get("conversations") or [] if not isinstance(conv, list): return [] out = [] for msg in conv: if not isinstance(msg, dict): continue role = str(msg.get("role") or msg.get("from") or msg.get("speaker") or msg.get("author") or "").lower() content = msg.get("content") or msg.get("value") or msg.get("text") or msg.get("message") or "" if role in {"human", "user", "student"}: role = "user" elif role in {"assistant", "gpt", "bot", "model"}: role = "assistant" out.append({"role": role, "content": str(content)}) return out def first_user_message(row): for key in ["conversation", "messages", "conversations"]: if key in row: for msg in normalize_conv(row[key]): if msg.get("role") == "user" and msg.get("content", "").strip(): return msg["content"].strip() for key in ["prompt", "user", "text", "instruction"]: if key in row and str(row[key]).strip(): return str(row[key]).strip() return None title_ds = load_dataset(ID_DATASET, split="train") max_row_id = max(int(x) for x in title_ds["lmsys_row_id"]) lmsys = load_dataset(LMSYS_DATASET, split=f"train[:{max_row_id + 1}]") written = 0 missing = 0 with open(OUT_PATH, "w", encoding="utf-8") as fout: for row in title_ds: lmsys_row_id = int(row["lmsys_row_id"]) prompt = first_user_message(lmsys[lmsys_row_id]) if not prompt: missing += 1 continue out = { "first_user_message": prompt, "title": row["title"], "lmsys_row_id": lmsys_row_id, "conversation_id": row.get("conversation_id"), } fout.write(json.dumps(out, ensure_ascii=False) + "\n") written += 1 print("Output:", OUT_PATH) print("Written:", written) print("Missing:", missing) ``` ## Intended use This dataset is intended for training and evaluating models that generate short chat titles from the first user message of a conversation. Example: ```text Input: Why is my wifi not working? Output: WiFi Issues ``` ## License and terms This dataset is marked as `other` because it contains LMSYS row references plus synthetic title generations. Users are responsible for complying with LMSYS-Chat-1M license and access terms when reconstructing prompts.

提供机构:
maas
创建时间:
2026-08-10
二维码
社区交流群
二维码
科研交流群
商业服务