FranckAbgrall's picture
FranckAbgrall HF Staff
Replace auto-generated README with dataset card
1fc5442 verified
|
Raw History Blame Contribute Delete
3.34 kB
---
license: mit
language:
- en
tags:
- function-calling
- tool-use
- synthetic
- ml-intern
size_categories: n<1K
---
[![Built with ML Intern](https://huggingface.co/datasets/huggingface/badges/resolve/main/built-with-ml-intern-sm.svg)](https://hf.co/chat?mode=ml-intern)
# GLM-5.3-Flash Synthetic Function-Calling Dataset
298 synthetic function-calling examples generated by [zai-org/GLM-5.3-Flash](https://huggingface.co/zai-org/GLM-5.3-Flash) via Hugging Face Inference Providers, in **OpenAI chat format** (`messages` + `tools`, assistant turns use `tool_calls`). Ready for SFT with TRL / transformers chat templates.
## Composition
| kind | count | meaning |
|---|---|---|
| `single` | 175 | user request fulfilled by exactly one tool call |
| `parallel` | 73 | request requires 2+ tool calls |
| `no_tool` | 50 | no relevant tool exists; assistant politely declines |
Examples span 25 domains (calendar, email, weather, maps, smart home, finance, travel, e-commerce, git, databases, CRM, HR, healthcare, IoT, …). Each record carries its `domain` and `kind` for filtering.
## How it was generated
Two-stage, fully synthetic (no human-written tools or examples):
1. **Tool design** — for each domain, the model designed 4 tools in OpenAI function format (name, description, JSON-schema parameters). Schemas were checked with `jsonschema.Draft7Validator.check_schema`.
2. **Example writing** — for each domain × kind, the model wrote user requests plus tool calls, seeded with a random persona hint for diversity.
Every example was then **programmatically validated**: JSON parses, called function names exist in the record's `tools`, and arguments validate against the tool's JSON schema. Invalid items were dropped (2 of 300 target). Near-duplicate user requests were removed.
The generator script is included in this repo: [`gen_fc_dataset.py`](gen_fc_dataset.py). Run it with `HF_TOKEN=... python gen_fc_dataset.py` (`SMOKE=1` for a quick test).
## Format
```json
{
"messages": [
{"role": "system", "content": "You are a helpful assistant with access to functions. ..."},
{"role": "user", "content": "Email the three caterers about Friday's lunch..."},
{"role": "assistant", "content": null, "tool_calls": [
{"id": "call_1a2b3c4d", "type": "function",
"function": {"name": "send_email", "arguments": "{\"to\": [...], ...}"}}
]}
],
"tools": [{"type": "function", "function": {"name": "send_email", "description": "...", "parameters": {...}}}],
"domain": "email management",
"kind": "single"
}
```
Note: `tool_calls[].function.arguments` is a JSON-encoded **string** (OpenAI convention); `no_tool` records have a plain assistant `content` reply and no `tool_calls`.
## Usage
```python
from datasets import load_dataset
ds = load_dataset("FranckAbgrall/glm53-flash-function-calling", split="train")
single_only = ds.filter(lambda r: r["kind"] == "single")
```
## Limitations
- Fully synthetic: tool schemas and argument values are plausible but not tied to real APIs; dates center on October 2026 (generation time).
- English only; ~300 rows is a pipeline-validation / small-SFT scale, not a full training corpus.
- Generated with temperature 1.0 for diversity — expect occasional stylistic quirks; validation guarantees schema correctness, not real-world executability.