File size: 29,341 Bytes
2c2ce1d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 | distilabel:
version: 1.5.3
pipeline:
name: generate
description: null
steps:
- step:
name: load_data_from_hub_0
resources:
replicas: 1
cpus: null
gpus: null
memory: null
resources: null
input_mappings: {}
output_mappings:
Job Role Description: anchor
use_cache: false
batch_size: 50
repo_id: dnth/ssf-dataset
split: train
config: null
revision: null
streaming: false
num_examples: 10
storage_options: null
runtime_parameters_info:
- name: resources
runtime_parameters_info:
- name: replicas
optional: true
description: The number of replicas for the step.
- name: cpus
optional: true
description: The number of CPUs assigned to each step replica.
- name: gpus
optional: true
description: The number of GPUs assigned to each step replica.
- name: memory
optional: true
description: The memory in bytes required for each step replica.
- name: resources
optional: true
description: A dictionary containing names of custom resources and the number
of those resources required for each step replica.
- name: batch_size
optional: true
description: The number of rows that will contain the batches generated by
the step.
- name: repo_id
optional: false
description: The Hugging Face Hub repository ID of the dataset to load.
- name: split
optional: true
description: The split of the dataset to load. Defaults to 'train'.
- name: config
optional: true
description: The configuration of the dataset to load. This is optional and
only needed if the dataset has multiple configurations.
- name: revision
optional: true
description: The revision of the dataset to load. Defaults to the latest revision.
- name: streaming
optional: true
description: Whether to load the dataset in streaming mode or not. Defaults
to False.
- name: num_examples
optional: true
description: The number of examples to load from the dataset. By default will
load all examples.
type_info:
module: distilabel.steps.generators.huggingface
name: LoadDataFromHub
name: load_data_from_hub_0
- step:
name: hard_triplets
resources:
replicas: 1
cpus: null
gpus: null
memory: null
resources: null
input_mappings: {}
output_mappings: {}
use_cache: true
input_batch_size: 100
llm:
generation_kwargs:
temperature: 0.6
max_new_tokens: 512
use_offline_batch_generation: false
offline_batch_generation_block_until_done: null
jobs_ids: null
model: gpt-4.1-mini
base_url: https://api.openai.com/v1
default_headers: null
max_retries: 6
timeout: 120
structured_output: null
type_info:
module: distilabel.models.llms.openai
name: OpenAILLM
group_generations: false
add_raw_output: true
add_raw_input: true
num_generations: 1
use_default_structured_output: false
triplet: true
action: paraphrase
hard_negative: true
context: "\n\n## Task Overview\nYou are tasked with generating realistic job\
\ descriptions based on Singapore SkillsFuture Framework job descriptions.\
\ Your goal is to create both positive and a few negative examples for training\
\ a retrieval model.\n\n## Input Format\nYou will receive a job description\
\ from the Singapore SkillsFuture Framework containing:\n- Job title (e.g.,\
\ Audit Associate/Audit Assistant Associate)\n- Role responsibilities and\
\ duties\n- Work environment and supervision structure\n- Required skills\
\ and attributes\n- Professional conduct expectations\n\nThe text is a job\
\ description from the Singapore SkillsFuture Framework. Your task is to generate\
\ a realistic positive variation and a few hard negative variation.\n\n\n\
Hard negative is a job description that is similar in some ways but is ultimately\
\ incorrect for the given job. It must not be a simple paraphrase of a different,\
\ unrelated job.\n\nChoose from these strategies for hard negatives:\n1. **Different\
\ seniority level:** (e.g., Senior vs. Junior)\n2. **Different function:**\
\ (e.g., Business Valuation vs. Risk Management)\n3. **Different technology\
\ stack:** (e.g., Python/AWS vs. Scala/Azure for a Data Engineer role)\n4.\
\ **Different job title, same responsibilities:** (e.g., \"Web Developer\"\
\ vs. \"Frontend Engineer\")\n5. **Different industry jargon:** (e.g., \"\
Project Manager\" in Tech vs. \"Project Manager\" in Construction)\n6. **Broad\
\ vs. specialized role:** (e.g., a \"Data Scientist\" role for a \"Machine\
\ Learning Engineer\" positive)\n\nExample:\nJob Role: \"Data Analyst\"\n\
Positive: \"As a Data Analyst, you will interpret data and analyze results\
\ using statistical techniques. You will work to develop and implement data\
\ collection systems and other strategies that optimize statistical efficiency\
\ and quality.\"\n\n\nNegative: \"As a Senior Data Analyst, you will lead\
\ a team of junior analysts, manage end-to-end data projects, and present\
\ insights to key stakeholders to drive business strategy.\"\n\n \
\ \"As a Financial Analyst, you will analyze financial data to provide insights\
\ into business performance and support strategic decision-making.\"\n\n \
\ \"As a Healthcare Data Analyst, you will manage electronic health\
\ records and assist in clinical research data analysis.\"\n\n\nMake sure\
\ to mix a few strategies in one negative query. you could also use different\
\ strategies that is not mentioned above as long as it is a hard negative.\n\
Makesure to have a few negatives in one query like in the example given and\
\ make a new line for each new query.\nThe Job description of the negatives\
\ should give the real job description to a real job title.\nThe query should\
\ always include the job role and start with \"The <job role>\".\n"
runtime_parameters_info:
- name: resources
runtime_parameters_info:
- name: replicas
optional: true
description: The number of replicas for the step.
- name: cpus
optional: true
description: The number of CPUs assigned to each step replica.
- name: gpus
optional: true
description: The number of GPUs assigned to each step replica.
- name: memory
optional: true
description: The memory in bytes required for each step replica.
- name: resources
optional: true
description: A dictionary containing names of custom resources and the number
of those resources required for each step replica.
- name: input_batch_size
optional: true
description: The number of rows that will contain the batches processed by
the step.
- name: llm
runtime_parameters_info:
- name: generation_kwargs
description: The kwargs to be propagated to either `generate` or `agenerate`
methods within each `LLM`.
keys:
- name: max_new_tokens
optional: true
- name: logprobs
optional: true
- name: top_logprobs
optional: true
- name: echo
optional: true
- name: frequency_penalty
optional: true
- name: presence_penalty
optional: true
- name: temperature
optional: true
- name: top_p
optional: true
- name: stop
optional: true
- name: response_format
optional: true
- name: extra_body
optional: true
- name: use_offline_batch_generation
optional: true
description: Whether to use the `offline_batch_generate` method to generate
the responses.
- name: offline_batch_generation_block_until_done
optional: true
description: If provided, then polling will be done until the `ofline_batch_generate`
method is able to retrieve the results. The value indicate the time to
wait between each polling.
- name: base_url
optional: true
description: The base URL to use for the OpenAI API requests.
- name: api_key
optional: true
description: The API key to authenticate the requests to the OpenAI API.
- name: default_headers
optional: true
description: The default headers to use for the OpenAI API requests.
- name: max_retries
optional: true
description: The maximum number of times to retry the request to the API
before failing.
- name: timeout
optional: true
description: The maximum time in seconds to wait for a response from the
API.
- name: structured_output
optional: true
description: The structured output format to use across all the generations.
- name: add_raw_output
optional: true
description: Whether to include the raw output of the LLM in the key `raw_output_<TASK_NAME>`
of the `distilabel_metadata` dictionary output column
- name: add_raw_input
optional: true
description: Whether to include the raw input of the LLM in the key `raw_input_<TASK_NAME>`
of the `distilabel_metadata` dictionary column
- name: num_generations
optional: true
description: The number of generations to be produced per input.
type_info:
module: distilabel.steps.tasks.sentence_transformers
name: GenerateSentencePair
name: hard_triplets
- step:
name: easy_triplets
resources:
replicas: 1
cpus: null
gpus: null
memory: null
resources: null
input_mappings: {}
output_mappings: {}
use_cache: true
input_batch_size: 100
llm:
generation_kwargs:
temperature: 0.6
max_new_tokens: 512
use_offline_batch_generation: false
offline_batch_generation_block_until_done: null
jobs_ids: null
model: gpt-4.1-mini
base_url: https://api.openai.com/v1
default_headers: null
max_retries: 6
timeout: 120
structured_output: null
type_info:
module: distilabel.models.llms.openai
name: OpenAILLM
group_generations: false
add_raw_output: true
add_raw_input: true
num_generations: 1
use_default_structured_output: false
triplet: true
action: paraphrase
hard_negative: false
context: "\n\n\n## Task Overview\nYou are tasked with generating realistic job\
\ descriptions based on Singapore SkillsFuture Framework job descriptions.\
\ Your goal is to create both positive and a few negative examples for training\
\ a retrieval model.\n\n## Input Format\nYou will receive a job description\
\ from the Singapore SkillsFuture Framework containing:\n- Job title (e.g.,\
\ Audit Associate/Audit Assistant Associate)\n- Role responsibilities and\
\ duties\n- Work environment and supervision structure\n- Required skills\
\ and attributes\n- Professional conduct expectations\n\nThe text is a job\
\ description from the Singapore SkillsFuture Framework. Your task is to generate\
\ a realistic positive variation and a few easy negative variation.\n\nEasy\
\ negative is a job description and title that is completely irrelevant to\
\ the original job's industry, domain, or skills. It should be easy for the\
\ model to distinguish from the positive document.\n\nChoose from these strategies\
\ for easy negatives:\n1. Completely different industry (e.g., IT vs. Retail).\n\
2. Unrelated skills and responsibilities.\n3. Completely different job function\
\ (e.g., Software Engineering vs. Human Resources).\n\nExample:\nJob Role:\
\ \"Data Analyst\"\n\nPositive: \"As a Data Analyst, you will interpret data\
\ and analyze results using statistical techniques. You will work to develop\
\ and implement data collection systems and other strategies that optimize\
\ statistical efficiency and quality.\"\n\nEasy Negative : \"As a Retail Manager,\
\ you will be responsible for overseeing daily store operations, managing\
\ inventory, and training staff to provide excellent customer service.\"\n\
\n \"As a Human Resources Assistant, you will provide administrative\
\ support to the HR department, assist with recruitment and onboarding processes,\
\ and maintain employee records.\"\n\n \"As a Professional\
\ Chef, you will be responsible for managing kitchen staff, creating new menu\
\ items, and ensuring all dishes are prepared to the highest quality standards.\"\
\n\n\nMake sure, that there is a variety of easy negatives across the dataset,\
\ using different strategies as outlined above.\nMakesure to have a few negatives\
\ in one query like in the example given.\nThe query should always include\
\ the job role and start with \"The <job role>\".\n"
runtime_parameters_info:
- name: resources
runtime_parameters_info:
- name: replicas
optional: true
description: The number of replicas for the step.
- name: cpus
optional: true
description: The number of CPUs assigned to each step replica.
- name: gpus
optional: true
description: The number of GPUs assigned to each step replica.
- name: memory
optional: true
description: The memory in bytes required for each step replica.
- name: resources
optional: true
description: A dictionary containing names of custom resources and the number
of those resources required for each step replica.
- name: input_batch_size
optional: true
description: The number of rows that will contain the batches processed by
the step.
- name: llm
runtime_parameters_info:
- name: generation_kwargs
description: The kwargs to be propagated to either `generate` or `agenerate`
methods within each `LLM`.
keys:
- name: max_new_tokens
optional: true
- name: logprobs
optional: true
- name: top_logprobs
optional: true
- name: echo
optional: true
- name: frequency_penalty
optional: true
- name: presence_penalty
optional: true
- name: temperature
optional: true
- name: top_p
optional: true
- name: stop
optional: true
- name: response_format
optional: true
- name: extra_body
optional: true
- name: use_offline_batch_generation
optional: true
description: Whether to use the `offline_batch_generate` method to generate
the responses.
- name: offline_batch_generation_block_until_done
optional: true
description: If provided, then polling will be done until the `ofline_batch_generate`
method is able to retrieve the results. The value indicate the time to
wait between each polling.
- name: base_url
optional: true
description: The base URL to use for the OpenAI API requests.
- name: api_key
optional: true
description: The API key to authenticate the requests to the OpenAI API.
- name: default_headers
optional: true
description: The default headers to use for the OpenAI API requests.
- name: max_retries
optional: true
description: The maximum number of times to retry the request to the API
before failing.
- name: timeout
optional: true
description: The maximum time in seconds to wait for a response from the
API.
- name: structured_output
optional: true
description: The structured output format to use across all the generations.
- name: add_raw_output
optional: true
description: Whether to include the raw output of the LLM in the key `raw_output_<TASK_NAME>`
of the `distilabel_metadata` dictionary output column
- name: add_raw_input
optional: true
description: Whether to include the raw input of the LLM in the key `raw_input_<TASK_NAME>`
of the `distilabel_metadata` dictionary column
- name: num_generations
optional: true
description: The number of generations to be produced per input.
type_info:
module: distilabel.steps.tasks.sentence_transformers
name: GenerateSentencePair
name: easy_triplets
- step:
name: easy_keywords
resources:
replicas: 1
cpus: null
gpus: null
memory: null
resources: null
input_mappings: {}
output_mappings: {}
use_cache: true
input_batch_size: 100
llm:
generation_kwargs:
temperature: 0.6
max_new_tokens: 512
use_offline_batch_generation: false
offline_batch_generation_block_until_done: null
jobs_ids: null
model: gpt-4.1-mini
base_url: https://api.openai.com/v1
default_headers: null
max_retries: 6
timeout: 120
structured_output: null
type_info:
module: distilabel.models.llms.openai
name: OpenAILLM
group_generations: false
add_raw_output: true
add_raw_input: true
num_generations: 1
use_default_structured_output: false
triplet: true
action: query
hard_negative: false
context: '
The text below is a job description from the Singapore SkillsFuture Framework.
Your task is to generate two things:
1. A list of key skills for the job (the positive).
2. A list of unrelated skills (the easy negative).
An **easy negative** is a set of keywords that is completely unrelated to
the job description and its industry. It should be easy for the model to distinguish
and serves to give the model a clear sense of what is definitively irrelevant.
Example:
Job Role: "Network Engineer"
Positive Keywords: "Network administration, Cisco, firewall management, VPN"
Easy Negative Keywords: "Retail inventory management, customer service, cash
handling, visual merchandising"
'
runtime_parameters_info:
- name: resources
runtime_parameters_info:
- name: replicas
optional: true
description: The number of replicas for the step.
- name: cpus
optional: true
description: The number of CPUs assigned to each step replica.
- name: gpus
optional: true
description: The number of GPUs assigned to each step replica.
- name: memory
optional: true
description: The memory in bytes required for each step replica.
- name: resources
optional: true
description: A dictionary containing names of custom resources and the number
of those resources required for each step replica.
- name: input_batch_size
optional: true
description: The number of rows that will contain the batches processed by
the step.
- name: llm
runtime_parameters_info:
- name: generation_kwargs
description: The kwargs to be propagated to either `generate` or `agenerate`
methods within each `LLM`.
keys:
- name: max_new_tokens
optional: true
- name: logprobs
optional: true
- name: top_logprobs
optional: true
- name: echo
optional: true
- name: frequency_penalty
optional: true
- name: presence_penalty
optional: true
- name: temperature
optional: true
- name: top_p
optional: true
- name: stop
optional: true
- name: response_format
optional: true
- name: extra_body
optional: true
- name: use_offline_batch_generation
optional: true
description: Whether to use the `offline_batch_generate` method to generate
the responses.
- name: offline_batch_generation_block_until_done
optional: true
description: If provided, then polling will be done until the `ofline_batch_generate`
method is able to retrieve the results. The value indicate the time to
wait between each polling.
- name: base_url
optional: true
description: The base URL to use for the OpenAI API requests.
- name: api_key
optional: true
description: The API key to authenticate the requests to the OpenAI API.
- name: default_headers
optional: true
description: The default headers to use for the OpenAI API requests.
- name: max_retries
optional: true
description: The maximum number of times to retry the request to the API
before failing.
- name: timeout
optional: true
description: The maximum time in seconds to wait for a response from the
API.
- name: structured_output
optional: true
description: The structured output format to use across all the generations.
- name: add_raw_output
optional: true
description: Whether to include the raw output of the LLM in the key `raw_output_<TASK_NAME>`
of the `distilabel_metadata` dictionary output column
- name: add_raw_input
optional: true
description: Whether to include the raw input of the LLM in the key `raw_input_<TASK_NAME>`
of the `distilabel_metadata` dictionary column
- name: num_generations
optional: true
description: The number of generations to be produced per input.
type_info:
module: distilabel.steps.tasks.sentence_transformers
name: GenerateSentencePair
name: easy_keywords
- step:
name: hard_keywords
resources:
replicas: 1
cpus: null
gpus: null
memory: null
resources: null
input_mappings: {}
output_mappings: {}
use_cache: true
input_batch_size: 100
llm:
generation_kwargs:
temperature: 0.6
max_new_tokens: 512
use_offline_batch_generation: false
offline_batch_generation_block_until_done: null
jobs_ids: null
model: gpt-4.1-mini
base_url: https://api.openai.com/v1
default_headers: null
max_retries: 6
timeout: 120
structured_output: null
type_info:
module: distilabel.models.llms.openai
name: OpenAILLM
group_generations: false
add_raw_output: true
add_raw_input: true
num_generations: 1
use_default_structured_output: false
triplet: true
action: query
hard_negative: true
context: '
The text below is a job description from the Singapore SkillsFuture Framework.
Your task is to generate two things:
1. A list of key skills for the job (the positive).
2. A list of unrelated skills (the easy negative).
An **easy negative** is a set of keywords that is completely unrelated to
the job description and its industry. It should be easy for the model to distinguish
and serves to give the model a clear sense of what is definitively irrelevant.
Example:
Job Role: "Network Engineer"
Positive Keywords: "Network administration, Cisco, firewall management, VPN"
Easy Negative Keywords: "Retail inventory management, customer service, cash
handling, visual merchandising"
'
runtime_parameters_info:
- name: resources
runtime_parameters_info:
- name: replicas
optional: true
description: The number of replicas for the step.
- name: cpus
optional: true
description: The number of CPUs assigned to each step replica.
- name: gpus
optional: true
description: The number of GPUs assigned to each step replica.
- name: memory
optional: true
description: The memory in bytes required for each step replica.
- name: resources
optional: true
description: A dictionary containing names of custom resources and the number
of those resources required for each step replica.
- name: input_batch_size
optional: true
description: The number of rows that will contain the batches processed by
the step.
- name: llm
runtime_parameters_info:
- name: generation_kwargs
description: The kwargs to be propagated to either `generate` or `agenerate`
methods within each `LLM`.
keys:
- name: max_new_tokens
optional: true
- name: logprobs
optional: true
- name: top_logprobs
optional: true
- name: echo
optional: true
- name: frequency_penalty
optional: true
- name: presence_penalty
optional: true
- name: temperature
optional: true
- name: top_p
optional: true
- name: stop
optional: true
- name: response_format
optional: true
- name: extra_body
optional: true
- name: use_offline_batch_generation
optional: true
description: Whether to use the `offline_batch_generate` method to generate
the responses.
- name: offline_batch_generation_block_until_done
optional: true
description: If provided, then polling will be done until the `ofline_batch_generate`
method is able to retrieve the results. The value indicate the time to
wait between each polling.
- name: base_url
optional: true
description: The base URL to use for the OpenAI API requests.
- name: api_key
optional: true
description: The API key to authenticate the requests to the OpenAI API.
- name: default_headers
optional: true
description: The default headers to use for the OpenAI API requests.
- name: max_retries
optional: true
description: The maximum number of times to retry the request to the API
before failing.
- name: timeout
optional: true
description: The maximum time in seconds to wait for a response from the
API.
- name: structured_output
optional: true
description: The structured output format to use across all the generations.
- name: add_raw_output
optional: true
description: Whether to include the raw output of the LLM in the key `raw_output_<TASK_NAME>`
of the `distilabel_metadata` dictionary output column
- name: add_raw_input
optional: true
description: Whether to include the raw input of the LLM in the key `raw_input_<TASK_NAME>`
of the `distilabel_metadata` dictionary column
- name: num_generations
optional: true
description: The number of generations to be produced per input.
type_info:
module: distilabel.steps.tasks.sentence_transformers
name: GenerateSentencePair
name: hard_keywords
connections:
- from: load_data_from_hub_0
to:
- hard_triplets
- easy_triplets
- easy_keywords
- hard_keywords
- from: hard_triplets
to: []
- from: easy_triplets
to: []
- from: easy_keywords
to: []
- from: hard_keywords
to: []
routing_batch_functions: []
type_info:
module: distilabel.pipeline.local
name: Pipeline
requirements: []
|