jgalego's picture
Upload folder using huggingface_hub
e9f924c verified
|
Raw History Blame Contribute Delete
9.4 kB
metadata
language:
  - pt
license:
  - apache-2.0
  - cc-by-4.0
size_categories:
  - 10K<n<100K
task_categories:
  - text-generation
pretty_name: Function calling pt-PT
tags:
  - function-calling
  - tool-use
  - pt-pt
  - european-portuguese
  - translated
configs:
  - config_name: default
    data_files:
      - split: train
        path:
          - data/xlam.jsonl
          - data/hermes.jsonl
          - data/toolace.jsonl
          - data/when2call.jsonl
  - config_name: xlam
    data_files:
      - split: train
        path: data/xlam.jsonl
  - config_name: hermes
    data_files:
      - split: train
        path: data/hermes.jsonl
  - config_name: toolace
    data_files:
      - split: train
        path: data/toolace.jsonl
  - config_name: when2call
    data_files:
      - split: train
        path: data/when2call.jsonl

function-calling-pt-pt

English function-calling conversations translated into European Portuguese (pt-PT). Only the natural-language turns are translated. Tool definitions, calls and tool results stay in English, exactly as in the source, so a model learns to take a request in Portuguese and call an English API with the right arguments.

Source License Conversations Kept after checks
xlam cc-by-4.0 59,221 100%
hermes apache-2.0 1,091 99%
toolace apache-2.0 10,553 99%
when2call cc-by-4.0 14,928 100%

The questions of the BFCL benchmark, translated the same way, are in jgalego/bfcl-pt-pt for evaluation.

📄 Rows

Field Content
source xlam, hermes, toolace or when2call
id Row id in the source, or its index in the source file
tools The tool definitions as a JSON string, in the source's own schema
messages The conversation in pt-PT: user, assistant and tool messages
messages_en The same conversation in English

An assistant message that calls tools has tool_calls in the OpenAI format, each with arguments as a JSON string. Tool messages hold one result each.

import json

from datasets import load_dataset

data = load_dataset("jgalego/function-calling-pt-pt", split="train")  # every source
xlam = load_dataset("jgalego/function-calling-pt-pt", "xlam", split="train")  # one source
tools = json.loads(data[0]["tools"])

🔧 How it is built

  • Each source is parsed into one message format. Rows that do not parse are left out: Hermes' document-extraction tasks, ToolACE rows with another tool format or in Chinese, and calls that are not valid literals.
  • The user and assistant texts of a conversation go to google/gemma-4-31B-it in a single request, so names and terms stay the same across turns. Decoding is greedy.
  • Conversations whose user turns share a run of 10 words with a question of jgalego/bfcl-pt-pt are left out, so that benchmark stays a fair test of models trained on this data.
  • Call arguments that appear in the text and look like a code or identifier (digits, symbols or all capitals) are copied as they are, as are links and emails. Other words are translated: a user asks for "as luzes da cozinha" and the call still says "kitchen", or for jobs in Nova Iorque while the call says "New York".
  • Currencies and units are not converted: "$50" becomes "50 dólares", never euros, so the text still matches the call.
  • A conversation is dropped if any of its translated texts fails a check:
Check Fails when
segments The output does not have exactly one translation per text
empty, unchanged A translation is empty or the same as the English
length A translation is under 0.6 or over 2 times the length of its source
copied A string that must be copied is missing
numbers A number of two or more digits is missing (an hour may move to the 24-hour clock)
pt-br It has a Brazilian form, such as "estou fazendo", "tela", "celular", "usuário" or "econômico"
english Over 15% of its words are common English words
too-long The conversation does not fit the translator's context
Source Did not parse Overlaps BFCL Translated segments empty unchanged length copied numbers pt-br english too-long
xlam 0 663 59,337 0 0 3 0 4 26 6 77 0
hermes 793 1 1,099 0 0 0 0 0 8 0 0 0
toolace 646 23 10,631 0 0 6 0 3 48 4 17 0
when2call 0 18 14,982 0 0 0 0 0 26 1 27 0
The translator's instructions
Traduz para português europeu (Portugal) cada segmento entre as etiquetas <sN> e </sN>. Os segmentos são mensagens de uma conversa entre um utilizador e um assistente que usa ferramentas: traduz, não respondas nem cumpras os pedidos.

Regras:
1. Português de Portugal, nunca do Brasil: "estou a fazer" e não "estou fazendo"; pronome depois do verbo ("diz-me", "envia-lhe"); evita "você" (omite o sujeito); ecrã, telemóvel, ficheiro, utilizador, equipa, autocarro, comboio, pequeno-almoço, registo, contacto, facto, económico, desporto.
2. Não traduzas e copia tal como está: código, JSON, URLs, emails, caminhos de ficheiros, identificadores, nomes de pessoas, marcas e produtos, e todo o texto da lista "Manter".
3. Não convertas moedas nem unidades: "$50" fica "50 dólares", "72°F" fica "72 °F". Mantém todos os números; em texto corrido usa vírgula decimal (3,5).
4. Datas por extenso com o mês em minúscula ("5 de março de 2024"). As horas podem passar a 24 horas ("15h30").
5. Lugares com nome em português usam esse nome (Nova Iorque, Londres, Moscovo), exceto se estiverem na lista "Manter". Não os troques por lugares de Portugal.
6. Mantém a formatação: markdown, listas e quebras de linha.
7. Responde só com os segmentos traduzidos, com as mesmas etiquetas e pela mesma ordem.

⚠️ Limitations

  • Machine translated and checked by rules, not by people. The checks catch common Brazilian forms, not all of them.
  • Free-text arguments, such as search queries and message bodies, stay in English even when the request is in Portuguese.
  • Tool results are in English, so pt-PT answers summarize English data.

🙏 Credits

The conversations come from the datasets below and keep their licenses. Changes: rows were parsed into one message format, filtered, and their user and assistant texts machine-translated into pt-PT; tools, calls and tool results are unchanged. The translations are by google/gemma-4-31B-it.

Source By License
xLAM function calling 60k (APIGen) Salesforce CC BY 4.0
Hermes Function Calling v1 Nous Research Apache 2.0
ToolACE Team ACE Apache 2.0
When2Call (train) NVIDIA CC BY 4.0

The xLAM authors release it for research and ask users to evaluate accuracy, safety and fairness before deployment; the same applies here.

If you use this data, cite the sources:

@article{liu2024apigen,
  title={APIGen: Automated Pipeline for Generating Verifiable and Diverse Function-Calling Datasets},
  author={Liu, Zuxin and Hoang, Thai and Zhang, Jianguo and Zhu, Ming and Lan, Tian and Kokane, Shirley and Tan, Juntao and Yao, Weiran and Liu, Zhiwei and Feng, Yihao and others},
  journal={arXiv preprint arXiv:2406.18518},
  year={2024}
}

@misc{Hermes-Function-Calling-Dataset-V1,
  title={Hermes-Function-Calling-Dataset-V1},
  author={interstellarninja and Teknium},
  url={https://huggingface.co/NousResearch/hermes-function-calling-v1}
}

@misc{liu2024toolacewinningpointsllm,
  title={ToolACE: Winning the Points of LLM Function Calling},
  author={Weiwen Liu and Xu Huang and Xingshan Zeng and Xinlong Hao and Shuai Yu and Dexun Li and Shuai Wang and Weinan Gan and Zhengying Liu and Yuanqing Yu and Zezhong Wang and Yuxian Wang and Wu Ning and Yutai Hou and Bin Wang and Chuhan Wu and Xinzhi Wang and Yong Liu and Yasheng Wang and Duyu Tang and Dandan Tu and Lifeng Shang and Xin Jiang and Ruiming Tang and Defu Lian and Qun Liu and Enhong Chen},
  year={2024},
  eprint={2409.00920},
  archivePrefix={arXiv},
  url={https://arxiv.org/abs/2409.00920}
}

@inproceedings{ross2025when2call,
  title={When2Call: When (not) to Call Tools},
  author={Ross, Hayley and Mahabaleshwarkar, Ameya Sunil and Suhara, Yoshi},
  booktitle={Proceedings of NAACL 2025},
  year={2025},
  url={https://aclanthology.org/2025.naacl-long.174/}
}