size_categories:n<1K format:parquet modality:text library:datasets library:pandas library:mlcroissant library:polars library:distilabel arxiv:2310.01377 region:us synthetic distilabel rlaif
---
size_categories: n<1K
dataset_info:
  features:
  - name: instruction
    dtype: string
  - name: topic
    dtype: string
  - name: generations
    sequence: string
  - name: distilabel_metadata
    struct:
    - name: raw_output_ultra_feedback_0
      dtype: string
  - name: model_names
    sequence: string
  - name: ratings
    sequence: int64
  - name: rationales
    sequence: string
  - name: model_name
    dtype: string
  splits:
  - name: train
    num_bytes: 69555
    num_examples: 10
  download_size: 75989
  dataset_size: 69555
configs:
- config_name: default
  data_files:
  - split: train
    path: data/train-*
tags:
- synthetic
- distilabel
- rlaif
---

<p align="left">
  <a href="https://github.com/argilla-io/distilabel">
    <img src="https://raw.githubusercontent.com/argilla-io/distilabel/main/docs/assets/distilabel-badge-light.png" alt="Built with Distilabel" width="200" height="32"/>
  </a>
</p>

# Dataset Card for distilabel-demo

This dataset has been created with [distilabel](https://distilabel.argilla.io/).



## Dataset Summary

This dataset contains a `pipeline.yaml` which can be used to reproduce the pipeline that generated it in distilabel using the `distilabel` CLI:

```console
distilabel pipeline run --config "https://huggingface.co/datasets/K-Ray/distilabel-demo/raw/main/pipeline.yaml"
```

or explore the configuration:

```console
distilabel pipeline info --config "https://huggingface.co/datasets/K-Ray/distilabel-demo/raw/main/pipeline.yaml"
```

## Dataset structure

The examples have the following structure per configuration:


<details><summary> Configuration: default </summary><hr>

```json
{
    "distilabel_metadata": {
        "raw_output_ultra_feedback_0": "It seems like the provided text is not a single problem to be solved, but rather a guide on how to set up a complex workflow using various tools and services. However, I can attempt to extract a few specific questions or problems that might need to be addressed:\n\n1. How to use Google Cloud Functions to detect new PDF uploads in Google Drive?\n2. How to integrate extracted data from PDF documents into a designated Google Sheet using Google Apps Script?\n3. How to send an SMS notification using Twilio when a new PDF upload is detected?\n\nHere are some possible answers to these questions:\n\n**1. Using Google Cloud Functions to detect new PDF uploads**\n\nTo use Google Cloud Functions (GCF) to detect new PDF uploads in Google Drive, you can follow these steps:\n\n* Create a GCP project and enable the Google Drive API.\n* Create a new Cloud Function with a trigger set to \"Google Drive upload event\".\n* Use the `google-drive` library to monitor the Google Drive for new uploads.\n\nHere\u0027s some sample code:\n```javascript\nconst { google } = require(\u0027googleapis\u0027);\n\nexports.uploadDetection = async function(event) {\n  const drive = google.drive(\u0027v1\u0027);\n  \n  // Extract data from uploaded PDF document using API or service\n  const extractedData = await extractDataFromPDF(event.file.id);\n  \n  // Integrate extracted data into designated Google Sheet using Google Apps Script\n  await integrateDataIntoGoogleSheet(extractedData);\n};\n```\n\n**2. Integrating extracted data into a Google Sheet**\n\nTo integrate the extracted data from PDF documents into a designated Google Sheet using Google Apps Script, you can follow these steps:\n\n* Create a new Google Apps Script project and attach it to your Google Drive.\n* Use the `google-apps-script` library to interact with the Google Sheets API.\n* Write a script that extracts data from the uploaded PDF document and integrates it into the designated Google Sheet.\n\nHere\u0027s some sample code:\n```javascript\nfunction integrateDataIntoGoogleSheet(data) {\n  const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();\n  \n  // Add extracted data to Google Sheet\n  sheet.appendRow([data.customerName, data.customerEmail]);\n}\n```\n\n**3. Sending an SMS notification using Twilio**\n\nTo send an SMS notification using Twilio when a new PDF upload is detected, you can follow these steps:\n\n* Sign up for a Twilio account and create a new Twilio account SID and authentication token.\n* Use the `twilio` library to interact with the Twilio API.\n* Write a script that extracts data from the uploaded PDF document and sends an SMS notification using Twilio.\n\nHere\u0027s some sample code:\n```javascript\nconst twilio = require(\u0027twilio\u0027);\n\nexports.sendSMSNotification = async function(data) {\n  const accountSid = \u0027your-twilio-account-sid\u0027;\n  const authToken = \u0027your-twilio-auth-token\u0027;\n  \n  // Create a new Twilio client instance\n  const client = new twilio(accountSid, authToken);\n  \n  // Send SMS notification using Twilio\n  await client.messages.create({\n    from: \u0027+1234567890\u0027,\n    to: \u0027+9876543210\u0027,\n    body: `New PDF uploaded! Customer name: ${data.customerName}`\n  });\n};\n```\n\nNote that these are just examples and may require modification to suit your specific use case."
    },
    "generations": [
        "You\u0027ve outlined a powerful automation workflow! Let\u0027s break down how to achieve this using a combination of tools and techniques:\n\n**1. Data Extraction from PDFs:**\n\n* **Optical Character Recognition (OCR):** This is essential for converting scanned PDF text into searchable and editable format.\n    * **Google Cloud Vision API:** A robust cloud-based OCR service that can handle diverse document types, languages, and complex layouts.\n    * **Tesseract OCR:**  A free and open-source OCR engine with good accuracy.\n\n* **Document Parsing:** Extract specific data points (customer names, addresses, etc.) based on predefined rules or patterns. \n    * **Apache PDFBox:** A Java library for manipulating and extracting information from PDFs.\n    * **Python libraries like PyPDF2 or pdfminer:** Offer powerful parsing capabilities.\n    * **Machine Learning Models:** For complex documents with unstructured data, train a custom model to identify and extract relevant information (requires more expertise).\n\n**2. Data Integration into Google Sheets:**\n\n* **Google Apps Script:**  A scripting language that allows you to automate tasks within Google Workspace applications like Sheets.\n    * Use it to connect to the Google Cloud Vision API or other OCR tools, process extracted data, and then write it into a designated spreadsheet. \n\n**3. SMS Notification System:**\n\n* **Twilio API:** A popular platform for sending and receiving SMS messages programmatically.\n    * Integrate the Twilio API with your Google Apps Script to send notifications when new PDFs are uploaded to the sheet.\n\n**Workflow Outline:**\n\n1.  **PDF Upload:** Users upload PDF documents to a designated folder in Google Drive or directly to a shared spreadsheet.\n2.  **Trigger Event:** A script (within Google Apps Script) monitors for file uploads and triggers the data extraction process.\n3. **OCR \u0026 Data Parsing:** The script uses OCR to convert text within the PDFs and then applies parsing rules to identify customer information (name, address, etc.).\n4. **Data Insertion:** Extracted data is formatted and automatically added to the designated Google Sheet.\n5. **SMS Notification:** Upon successful data insertion, the script sends an SMS notification to your mobile device using the Twilio API.\n\n**Important Considerations:**\n\n* **Security:** Implement robust authentication and authorization measures to protect sensitive customer data. Use secure APIs and store credentials securely.\n* **Error Handling:** Build in error handling mechanisms to gracefully manage situations where OCR fails or parsing rules are not met. Log errors for debugging purposes.\n* **Scalability:** Design your workflow to handle increasing volumes of PDF documents efficiently. Consider cloud-based services like Google Cloud Functions for scalability.\n* **Testing and Refinement:** Thoroughly test each stage of the workflow with real-world PDF samples. Refine parsing rules, OCR settings, and notification messages as needed.\n\n**Tools \u0026 Resources:**\n\n* **Google Apps Script:** [https://developers.google.com/apps-script](https://developers.google.com/apps-script)\n* **Google Cloud Vision API:** [https://cloud.google.com/vision/docs/overview](https://cloud.google.com/vision/docs/overview)\n* **Twilio API:** [https://www.twilio.com/docs/api](https://www.twilio.com/docs/api)\n* **Apache PDFBox:** [http://apache.org/projects/pdfbox/](http://apache.org/projects/pdfbox/)\n* **Python Libraries (PyPDF2, pdfminer):**  [https://pypi.org/project/PyPDF2/](https://pypi.org/project/PyPDF2/) [https://pypi.org/project/pdfminer/](https://pypi.org/project/pdfminer/)\n* **Tesseract OCR:** [https://tesseract-ocr.github.io/tessdoc/](https://tesseract-ocr.github.io/tessdoc/)\n\n\n\nLet me know if you have any more specific questions as you develop your workflow!",
        "To create an efficient and robust workflow that utilizes advanced automation techniques to extract targeted data from diverse PDF documents, integrate it into a designated Google Sheet, and send an SMS notification upon new PDF uploads, you\u0027ll need to combine several tools and services. Here\u0027s a step-by-step guide to help you achieve this:\n\n**Tools and Services Needed:**\n\n1. **Google Cloud Platform (GCP)**: For automating tasks using Google Cloud Functions.\n2. **Google Drive**: To store and upload the PDF documents.\n3. **Google Sheets**: As the designated destination for integrated data.\n4. **Twilio**: A cloud communication platform for sending SMS notifications.\n\n**Workflow Components:**\n\n1. **PDF Document Processing**:\n\t* Utilize a third-party API or service (e.g., Google Cloud\u0027s AutoML Vision, Adobe PDF Extractor) to extract relevant customer information from the uploaded PDF documents.\n2. **Data Integration**:\n\t* Use Google Apps Script to integrate the extracted data into the designated Google Sheet.\n3. **New Upload Detection and SMS Notification**:\n\t* Employ a Google Cloud Function (GCF) to monitor the Google Drive for new uploads, trigger an event-driven workflow, and send an SMS notification using Twilio.\n\n**Implementation Steps:**\n\n1. **Set up Google Cloud Platform (GCP)**:\n\t* Create a GCP account or use an existing one.\n\t* Set up a project in the GCP Console.\n2. **Create a Google Cloud Function (GCF) for New Upload Detection**:\n\t* In the GCP Console, navigate to the \"Cloud Functions\" section.\n\t* Create a new function with the following properties:\n\t\t+ Runtime: Node.js 14\n\t\t+ Trigger: Google Drive upload event\n\t\t+ Event source: Google Drive (using the `google-drive` library)\n3. **Implement Data Extraction and Integration**:\n\t* In your GCF, use an API or service to extract data from uploaded PDF documents.\n\t* Use Google Apps Script to integrate the extracted data into the designated Google Sheet.\n4. **Configure Twilio for SMS Notifications**:\n\t* Sign up for a Twilio account (if you don\u0027t already have one).\n\t* Create a new Twilio account SID and authentication token.\n5. **Implement New Upload Detection and SMS Notification Logic**:\n\t* In your GCF, use the `google-drive` library to monitor the Google Drive for new uploads.\n\t* When a new upload is detected, trigger an event-driven workflow that sends an SMS notification using Twilio.\n\nHere\u0027s some sample code to get you started:\n\n**Google Cloud Function (GCF) for New Upload Detection**\n```javascript\nconst { google } = require(\u0027googleapis\u0027);\n\nexports.uploadDetection = async function(event) {\n  const drive = google.drive(\u0027v1\u0027);\n  \n  // Extract data from uploaded PDF document using API or service\n  const extractedData = await extractDataFromPDF(event.file.id);\n  \n  // Integrate extracted data into designated Google Sheet using Google Apps Script\n  await integrateDataIntoGoogleSheet(extractedData);\n  \n  // Send SMS notification using Twilio\n  const twilioMessage = await sendSMSNotificationUsingTwilio(extractedData);\n};\n```\n\n**Example Use Case:**\n\nLet\u0027s assume you have a PDF document containing customer information, and you want to extract this data and integrate it into your designated Google Sheet. Upon uploading the new PDF document, you receive an SMS notification on your mobile device with the updated data.\n\nIn this example:\n\n* The GCF monitors the Google Drive for new uploads.\n* When a new upload is detected, the GCF triggers an event-driven workflow that:\n\t+ Extracts customer information from the uploaded PDF document using Adobe PDF Extractor (API or service).\n\t+ Integrates the extracted data into your designated Google Sheet using Google Apps Script.\n\t+ Sends an SMS notification to your mobile device using Twilio, including the updated customer information.\n\n**Best Practices and Considerations:**\n\n* Ensure proper configuration of GCP services, Google Drive, Google Sheets, and Twilio accounts.\n* Regularly monitor and troubleshoot your workflow to prevent errors or issues.\n* Implement data validation, formatting, and cleanup as necessary for accurate integration into your designated Google Sheet.\n* Be mindful of data security and compliance regulations when handling sensitive customer information.\n\nBy following these steps and incorporating advanced automation techniques, you can create an efficient and robust workflow that effortlessly extracts targeted data from diverse PDF documents, integrates it into a designated Google Sheet, and sends real-time SMS notifications upon new uploads."
    ],
    "instruction": "How can I create an efficient and robust workflow that utilizes advanced automation techniques to extract targeted data, including customer information, from diverse PDF documents and effortlessly integrate it into a designated Google Sheet? Furthermore, I am interested in establishing a comprehensive and seamless system that promptly activates an SMS notification on my mobile device whenever a new PDF document is uploaded to the Google Sheet, ensuring real-time updates and enhanced accessibility.",
    "model_name": "llama3.1",
    "model_names": [
        "gemma2",
        "llama3.1"
    ],
    "ratings": [
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null
    ],
    "rationales": [
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        null
    ],
    "topic": "Software Development"
}
```

This subset can be loaded as:

```python
from datasets import load_dataset

ds = load_dataset("K-Ray/distilabel-demo", "default")
```

Or simply as it follows, since there's only one configuration and is named `default`: 

```python
from datasets import load_dataset

ds = load_dataset("K-Ray/distilabel-demo")
```


</details>



## References


```
@misc{cui2024ultrafeedbackboostinglanguagemodels,
    title={UltraFeedback: Boosting Language Models with Scaled AI Feedback},
    author={Ganqu Cui and Lifan Yuan and Ning Ding and Guanming Yao and Bingxiang He and Wei Zhu and Yuan Ni and Guotong Xie and Ruobing Xie and Yankai Lin and Zhiyuan Liu and Maosong Sun},
    year={2024},
    eprint={2310.01377},
    archivePrefix={arXiv},
    primaryClass={cs.CL},
    url={https://arxiv.org/abs/2310.01377},
}
```


