Alpaca
Alpaca - Training LLMs to follow instructions
@kaggle.thedevastator_alpaca_instructions_word_level_classification
Alpaca - Training LLMs to follow instructions
@kaggle.thedevastator_alpaca_instructions_word_level_classification
inputInput | instructionInstruction | textText | outputOutput |
---|---|---|---|
[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 strings | Below 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) |
nan | Design 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 applicable | 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. | 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 Applicable | Create 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 numbers | Generate 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')) |
nan | Create 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]] |
nan | Create 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 applicable | 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 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
);
Anyone who has the link will be able to view this.