PreferanceDataset / README.md
MargiPandya's picture
Upload README.md with huggingface_hub
f401ad1 verified
|
Raw History Blame Contribute Delete
16 kB
metadata
size_categories: n<1K
dataset_info:
  features:
    - name: instruction
      dtype: string
    - name: topic
      dtype: string
    - name: generations
      list: string
    - name: model_names
      list: string
    - name: distilabel_metadata
      struct:
        - name: raw_input_ultra_feedback_0
          list:
            - name: content
              dtype: string
            - name: role
              dtype: string
        - name: raw_output_ultra_feedback_0
          dtype: 'null'
    - name: ratings
      list: 'null'
    - name: rationales
      list: 'null'
    - name: model_name
      dtype: string
    - name: prompt
      dtype: 'null'
    - name: prompt_id
      dtype: 'null'
    - name: chosen
      dtype: 'null'
    - name: chosen_model
      dtype: 'null'
    - name: chosen_rating
      dtype: 'null'
    - name: rejected
      dtype: 'null'
    - name: rejected_model
      dtype: 'null'
    - name: rejected_rating
      dtype: 'null'
  splits:
    - name: train
      num_bytes: 105943
      num_examples: 20
  download_size: 76196
  dataset_size: 105943
configs:
  - config_name: default
    data_files:
      - split: train
        path: data/train-*
tags:
  - synthetic
  - distilabel
  - rlaif

Built with Distilabel

Dataset Card for PreferanceDataset

This dataset has been created with distilabel.

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:

distilabel pipeline run --config "https://huggingface.co/datasets/MargiPandya/PreferanceDataset/raw/main/pipeline.yaml"

or explore the configuration:

distilabel pipeline info --config "https://huggingface.co/datasets/MargiPandya/PreferanceDataset/raw/main/pipeline.yaml"

Dataset structure

The examples have the following structure per configuration:

Configuration: default
{
    "chosen": null,
    "chosen_model": null,
    "chosen_rating": null,
    "distilabel_metadata": {
        "raw_input_ultra_feedback_0": [
            {
                "content": "Your role is to evaluate text quality based on given criteria.\nYou\u0027ll receive an instructional description (\"Instruction\") and 2 text outputs (\"Text\").\nUnderstand and interpret instructions to evaluate effectively.\nProvide annotations for each text with a rating and rationale.\nThe 2 texts given are independent, and should be evaluated separately.\n",
                "role": "system"
            },
            {
                "content": "# Instruction Following Assessment\n\nEvaluate alignment between output and intent. Assess understanding of task goal and restrictions.\n\n**Instruction Components**: Task Goal (intended outcome), Restrictions (text styles, formats, or designated methods, etc).\n\n**Scoring**: Rate outputs 1 to 5:\n1. **Irrelevant**: No alignment.\n2. **Partial Focus**: Addresses one aspect poorly.\n3. **Partial Compliance**:\n    - (1) Meets goal or restrictions, neglecting other.\n    - (2) Acknowledges both but slight deviations.\n4. **Almost There**: Near alignment, minor deviations.\n5. **Comprehensive Compliance**: Fully aligns, meets all requirements.\n\n## Format:\n\n### Input\nInstruction: [Clearly specify the task goal and restrictions]\n\nTexts:\n\u003ctext 1\u003e [Text 1]\n\u003ctext 2\u003e [Text 2]\n\n### Output\n#### Output for Text 1\nRating: [Rating for text 1]\nRationale: [Rationale for the rating in short sentences]\n\n#### Output for Text 2\nRating: [Rating]\nRationale: [Rationale]\n\n---\n\n## Annotation\n\n### Input\nInstruction: 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.\n\nTexts:\n\u003ctext 1\u003e To achieve an efficient and robust workflow that utilizes advanced automation techniques to extract targeted data, integrate it into a Google Sheet, and send SMS notifications, you can use the following tools:\n\n1. **Google Cloud Vision API**: For extracting data from PDF documents.\n2. **Google Cloud Function**: For automating the workflow and integrating with Google Cloud Vision API.\n3. **Google Cloud Storage**: For storing uploaded PDF documents.\n4. **Google Sheets API**: For updating the Google Sheet with extracted data.\n5. **Twilio**: For sending SMS notifications.\n\n**Step 1: Set up Google Cloud Platform and enable APIs**\n\n1. Create a Google Cloud Platform account and enable the following APIs:\n\t* Google Cloud Vision API\n\t* Google Cloud Function\n\t* Google Cloud Storage\n\t* Google Sheets API\n2. Create a project and enable billing.\n\n**Step 2: Set up Google Cloud Function**\n\n1. Create a new Cloud Function using the Cloud Console or the Google Cloud CLI.\n2. Choose the \"Node.js\" runtime and set up a new function with the following code:\n```javascript\nconst { Storage } = require(\u0027@google-cloud/storage\u0027);\nconst { Sheets } = require(\u0027@google-cloud/sheets\u0027);\nconst { StorageClient } = require(\u0027@google-cloud/storage\u0027);\nconst { vision } = require(\u0027@google-cloud/vision\u0027);\n\nconst storage = new Storage();\nconst sheets = new Sheets();\n\nasync function extractDataFromPdf(file) {\n  const client = new vision.ImageAnnotatorClient();\n  const [result] = await client.annotateImage({\n    image: {\n      content: file.buffer,\n    },\n    features: [\n      {\n        type: \u0027TEXT_DETECTION\u0027,\n      },\n    ],\n  });\n\n  return result.fullTextAnnotation.text;\n}\n\nasync function updateGoogleSheet(data) {\n  const sheet = sheets.spreadsheets.get(\u0027spreadsheetId\u0027);\n  const values = [[data]];\n  await sheet.values.update(\u0027Sheet1!A1\u0027, values);\n}\n\nasync function handleUpload(event, context) {\n  const file = storage.bucket(event.bucket.name).file(event.name);\n  const data = await extractDataFromPdf(file);\n  await updateGoogleSheet(data);\n}\n\nexports.handleUpload = handleUpload;\n```\nThis code extracts data from the uploaded PDF document using the Google Cloud Vision API and updates the Google Sheet with the extracted data.\n\n**Step 3: Configure Twilio for SMS notifications**\n\n1. Create a Twilio account and purchase a phone number.\n2. Install the Twilio Node.js library using npm\n\u003ctext 2\u003e To create an efficient and robust workflow that automates the extraction of targeted data from PDF documents and integrates it into a designated Google Sheet, while also setting up an SMS notification system, you can follow these steps:\n\n### Step 1: Data Extraction from PDFs\n\n1. **Choose a PDF Parsing Library:**\n   - For Python, libraries such as `PyPDF2`, `pdfplumber`, or `tabula-py` can be used to extract text and tabular data.\n   - For JavaScript, you can use `pdf-parse` or `pdfjs`.\n\n2. **Identify Data Fields:**\n   - Determine which fields you are interested in extracting (e.g., customer names, addresses, phone numbers).\n\n3. **Develop Extraction Logic:**\n   - Write code to parse the PDFs and extract the specified fields. This may involve regular expressions, keyword searches, or more complex data parsing techniques.\n\n### Step 2: Integrate with Google Sheets\n\n1. **Set Up Google Sheets API:**\n   - Create a Google Sheets API project in the Google Cloud Platform Console.\n   - Enable the Google Sheets API for your project.\n   - Obtain credentials (OAuth 2.0 client ID and secret) to authorize access to the Google Sheets API.\n\n2. **Write Script to Update Google Sheets:**\n   - Use `google-api-python-client` to interact with the Google Sheets API.\n   - Write a script that reads the extracted data and writes it to the appropriate cells in the Google Sheet.\n\n### Step 3: Automate the Workflow\n\n1. **Use Cron Jobs or Task Schedulers:**\n   - Set up a cron job (Linux) or task scheduler (Windows) to run your data extraction and integration script at regular intervals.\n\n2. **Cloud Functions or Serverless:**\n   - Deploy your script as a cloud function (e.g., AWS Lambda, Google Cloud Functions) that triggers on new file uploads to a GCS bucket or a specific folder in Google Drive.\n\n### Step 4: Set Up SMS Notifications\n\n1. **Choose an SMS Service Provider:**\n   - Select an SMS service provider that supports API integration (e.g., Twilio, Nexmo, Messagesmith).\n\n2. **Set Up API Credentials:**\n   - Obtain the necessary API credentials from the SMS provider.\n\n3. **Write Script for SMS Notifications:**\n   - Write a script that uses the SMS provider\u2019s API to send an SMS notification when a new PDF document is detected in the Google Sheet.\n\n4.\n\n### Output\n",
                "role": "user"
            }
        ],
        "raw_output_ultra_feedback_0": null
    },
    "generations": [
        "To achieve an efficient and robust workflow that utilizes advanced automation techniques to extract targeted data, integrate it into a Google Sheet, and send SMS notifications, you can use the following tools:\n\n1. **Google Cloud Vision API**: For extracting data from PDF documents.\n2. **Google Cloud Function**: For automating the workflow and integrating with Google Cloud Vision API.\n3. **Google Cloud Storage**: For storing uploaded PDF documents.\n4. **Google Sheets API**: For updating the Google Sheet with extracted data.\n5. **Twilio**: For sending SMS notifications.\n\n**Step 1: Set up Google Cloud Platform and enable APIs**\n\n1. Create a Google Cloud Platform account and enable the following APIs:\n\t* Google Cloud Vision API\n\t* Google Cloud Function\n\t* Google Cloud Storage\n\t* Google Sheets API\n2. Create a project and enable billing.\n\n**Step 2: Set up Google Cloud Function**\n\n1. Create a new Cloud Function using the Cloud Console or the Google Cloud CLI.\n2. Choose the \"Node.js\" runtime and set up a new function with the following code:\n```javascript\nconst { Storage } = require(\u0027@google-cloud/storage\u0027);\nconst { Sheets } = require(\u0027@google-cloud/sheets\u0027);\nconst { StorageClient } = require(\u0027@google-cloud/storage\u0027);\nconst { vision } = require(\u0027@google-cloud/vision\u0027);\n\nconst storage = new Storage();\nconst sheets = new Sheets();\n\nasync function extractDataFromPdf(file) {\n  const client = new vision.ImageAnnotatorClient();\n  const [result] = await client.annotateImage({\n    image: {\n      content: file.buffer,\n    },\n    features: [\n      {\n        type: \u0027TEXT_DETECTION\u0027,\n      },\n    ],\n  });\n\n  return result.fullTextAnnotation.text;\n}\n\nasync function updateGoogleSheet(data) {\n  const sheet = sheets.spreadsheets.get(\u0027spreadsheetId\u0027);\n  const values = [[data]];\n  await sheet.values.update(\u0027Sheet1!A1\u0027, values);\n}\n\nasync function handleUpload(event, context) {\n  const file = storage.bucket(event.bucket.name).file(event.name);\n  const data = await extractDataFromPdf(file);\n  await updateGoogleSheet(data);\n}\n\nexports.handleUpload = handleUpload;\n```\nThis code extracts data from the uploaded PDF document using the Google Cloud Vision API and updates the Google Sheet with the extracted data.\n\n**Step 3: Configure Twilio for SMS notifications**\n\n1. Create a Twilio account and purchase a phone number.\n2. Install the Twilio Node.js library using npm",
        "To create an efficient and robust workflow that automates the extraction of targeted data from PDF documents and integrates it into a designated Google Sheet, while also setting up an SMS notification system, you can follow these steps:\n\n### Step 1: Data Extraction from PDFs\n\n1. **Choose a PDF Parsing Library:**\n   - For Python, libraries such as `PyPDF2`, `pdfplumber`, or `tabula-py` can be used to extract text and tabular data.\n   - For JavaScript, you can use `pdf-parse` or `pdfjs`.\n\n2. **Identify Data Fields:**\n   - Determine which fields you are interested in extracting (e.g., customer names, addresses, phone numbers).\n\n3. **Develop Extraction Logic:**\n   - Write code to parse the PDFs and extract the specified fields. This may involve regular expressions, keyword searches, or more complex data parsing techniques.\n\n### Step 2: Integrate with Google Sheets\n\n1. **Set Up Google Sheets API:**\n   - Create a Google Sheets API project in the Google Cloud Platform Console.\n   - Enable the Google Sheets API for your project.\n   - Obtain credentials (OAuth 2.0 client ID and secret) to authorize access to the Google Sheets API.\n\n2. **Write Script to Update Google Sheets:**\n   - Use `google-api-python-client` to interact with the Google Sheets API.\n   - Write a script that reads the extracted data and writes it to the appropriate cells in the Google Sheet.\n\n### Step 3: Automate the Workflow\n\n1. **Use Cron Jobs or Task Schedulers:**\n   - Set up a cron job (Linux) or task scheduler (Windows) to run your data extraction and integration script at regular intervals.\n\n2. **Cloud Functions or Serverless:**\n   - Deploy your script as a cloud function (e.g., AWS Lambda, Google Cloud Functions) that triggers on new file uploads to a GCS bucket or a specific folder in Google Drive.\n\n### Step 4: Set Up SMS Notifications\n\n1. **Choose an SMS Service Provider:**\n   - Select an SMS service provider that supports API integration (e.g., Twilio, Nexmo, Messagesmith).\n\n2. **Set Up API Credentials:**\n   - Obtain the necessary API credentials from the SMS provider.\n\n3. **Write Script for SMS Notifications:**\n   - Write a script that uses the SMS provider\u2019s API to send an SMS notification when a new PDF document is detected in the Google Sheet.\n\n4."
    ],
    "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": "meta-llama/Meta-Llama-3-70B-Instruct",
    "model_names": [
        "meta-llama/Meta-Llama-3-8B-Instruct",
        "Qwen/Qwen2.5-7B-Instruct"
    ],
    "prompt": null,
    "prompt_id": null,
    "ratings": [
        null,
        null
    ],
    "rationales": [
        null,
        null
    ],
    "rejected": null,
    "rejected_model": null,
    "rejected_rating": null,
    "topic": "Software Development"
}

This subset can be loaded as:

from datasets import load_dataset

ds = load_dataset("MargiPandya/PreferanceDataset", "default")

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

from datasets import load_dataset

ds = load_dataset("MargiPandya/PreferanceDataset")

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},
}