Baselight

Alpaca

Alpaca - Training LLMs to follow instructions

@kaggle.thedevastator_alpaca_instructions_word_level_classification

Train
@kaggle.thedevastator_alpaca_instructions_word_level_classification.train

  • 67.48 MB
  • 121959 rows
  • 4 columns
input

Input

instruction

Instruction

text

Text

output

Output

[1, 2, 3, 4, 5]Create a function to calculate the sum of a sequence of integers.Below is an instruction that describes a task. Write a response that appropriately completes the request. ### Instruction: Create a function to calculate the sum of a sequence of integers. ### Input: [1, 2, 3, 4, 5] ### Output: # Python code def sum_sequence(sequence): sum = 0 for num in sequenc…# Python code def sum_sequence(sequence): sum = 0 for num in sequence: sum += num return sum
str1 = "Hello " str2 = "world"Develop a function that will add two stringsBelow is an instruction that describes a task. Write a response that appropriately completes the request. ### Instruction: Develop a function that will add two strings ### Input: str1 = "Hello " str2 = "world" ### Output: def add_strings(str1, str2): """This function takes two strings and return…def add_strings(str1, str2): """This function takes two strings and returns the sum of them.""" return str1 + str2 str1 = "Hello " str2 = "world" sum_of_strings = add_strings(str1, str2)
nanDesign a data structure in C++ to store information of a grocery store inventory.Below is an instruction that describes a task. Write a response that appropriately completes the request. ### Instruction: Design a data structure in C++ to store information of a grocery store inventory. ### Input: No input ### Output: #include <map> #include <string> class GroceryStoreInventory {…#include <map> #include <string> class GroceryStoreInventory { private: std::map<std::string, int> items; public: void addItems(std::string item, int quantity) { items[item] = quantity; } int getQuantity(std::string item) { if (items.find(item) != items.end()) { …
[3, 1, 4, 5, 9, 0]Implement a sorting algorithm to sort a given array.Below is an instruction that describes a task. Write a response that appropriately completes the request. ### Instruction: Implement a sorting algorithm to sort a given array. ### Input: [3, 1, 4, 5, 9, 0] ### Output: def bubble_sort(arr): n = len(arr) # Traverse through all array elements…def bubble_sort(arr): n = len(arr) # Traverse through all array elements for i in range(n): # Last i elements are already in place for j in range(0, n-i-1): # traverse the array from 0 to n-i-1 # Swap if the element found is greater …
Not applicableDesign a Swift application for tracking expenses. The app should have a view for creating new expenses, and a view for displaying all expenses in a table view.Below is an instruction that describes a task. Write a response that appropriately completes the request. ### Instruction: Design a Swift application for tracking expenses. The app should have a view for creating new expenses, and a view for displaying all expenses in a table view. ### Input: Not ap…import UIKit class ExpenseViewController: UIViewController { // MARK: - Variables var expenses = [Expense]() @IBOutlet weak var tableView: UITableView! // MARK: - UIViewController override func viewDidLoad() { super.viewDidLoad() tableView.dataSource = self tableView.delegate = se…
Not ApplicableCreate a REST API to convert a UNIX timestamp to human readable date.Below is an instruction that describes a task. Write a response that appropriately completes the request. ### Instruction: Create a REST API to convert a UNIX timestamp to human readable date. ### Input: Not Applicable ### Output: <?php $timestamp = $_GET['timestamp']; if(empty($timestamp)) { echo…<?php $timestamp = $_GET['timestamp']; if(empty($timestamp)) { echo json_encode(["error" => "Please provide a valid UNIX timestamp."]); die(); } $date = date("Y-m-d H:i", $timestamp); echo json_encode(["date" => $date]); ?>
website: www.example.com data to crawl: phone numbersGenerate a Python code for crawling a website for a specific type of data.Below is an instruction that describes a task. Write a response that appropriately completes the request. ### Instruction: Generate a Python code for crawling a website for a specific type of data. ### Input: website: www.example.com data to crawl: phone numbers ### Output: import requests import r…import requests import re def crawl_website_for_phone_numbers(website): response = requests.get(website) phone_numbers = re.findall('\d{3}-\d{3}-\d{4}', response.text) return phone_numbers if __name__ == '__main__': print(crawl_website_for_phone_numbers('www.example.com'))
nanCreate a Python list comprehension to get the squared values of a list [1, 2, 3, 5, 8, 13].Below is an instruction that describes a task. Write a response that appropriately completes the request. ### Instruction: Create a Python list comprehension to get the squared values of a list [1, 2, 3, 5, 8, 13]. ### Input: No input ### Output: [x*x for x in [1, 2, 3, 5, 8, 13]][x*x for x in [1, 2, 3, 5, 8, 13]]
nanCreate a MySQL query to find the most expensive product from the table "products".Below is an instruction that describes a task. Write a response that appropriately completes the request. ### Instruction: Create a MySQL query to find the most expensive product from the table "products". ### Input: No input ### Output: SELECT * FROM products ORDER BY price DESC LIMIT 1;SELECT * FROM products ORDER BY price DESC LIMIT 1;
Not applicableCreate a data structure in Java for storing and managing books in a library. The data structure should include methods for adding a new book, checking if a particular book is available, and borrowing a book from the library.Below is an instruction that describes a task. Write a response that appropriately completes the request. ### Instruction: Create a data structure in Java for storing and managing books in a library. The data structure should include methods for adding a new book, checking if a particular book is av…public class Library { // map of books in the library, key is book id, value is Book object private Map<String, Book> books; // Constructor public Library() { books = new HashMap<>(); } public void addBook(Book book) { books.put(book.getId(), book); } public boolean hasBook(Strin…

CREATE TABLE train (
  "input" VARCHAR,
  "instruction" VARCHAR,
  "text" VARCHAR,
  "output" VARCHAR
);

Share link

Anyone who has the link will be able to view this.