From 210732f9f8bdb6e5df4d015bb0c01d27b0848e0f Mon Sep 17 00:00:00 2001 From: Mathieu Broillet Date: Tue, 7 Nov 2023 20:58:43 +0100 Subject: [PATCH] start llamma integration --- src/text/engine/llama/__init__.py | 0 .../engine/llama/dataset_action_qualifier.csv | 94 +++++++++++++++++++ src/text/engine/llama/generate_datasets.py | 14 +++ 3 files changed, 108 insertions(+) create mode 100644 src/text/engine/llama/__init__.py create mode 100644 src/text/engine/llama/dataset_action_qualifier.csv create mode 100644 src/text/engine/llama/generate_datasets.py diff --git a/src/text/engine/llama/__init__.py b/src/text/engine/llama/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/text/engine/llama/dataset_action_qualifier.csv b/src/text/engine/llama/dataset_action_qualifier.csv new file mode 100644 index 0000000..fbdee47 --- /dev/null +++ b/src/text/engine/llama/dataset_action_qualifier.csv @@ -0,0 +1,94 @@ +user_question,bot_answer +hey can you turn on the office room lights?, {"type": "action"} +hey could you turn off the living room lights?, {"type": "action"} +hey can you turn on the kitchen lights?, {"type": "action"} +hey can you turn on the bedroom lights?, {"type": "action"} +hey can you turn on the bathroom lights?, {"type": "action"} +turn off the office room lights, {"type": "action"} +turn off the living room lights, {"type": "action"} +turn on the television in mathieu's room, {"type": "action"} +turn on the television in the living room, {"type": "action"} +turn off the tv in the living room, {"type": "action"} +turn off the tv in mathieu's room, {"type": "action"} +turn on the computer in mathieu's room, {"type": "action"} +turn on the computer in the living room, {"type": "action"} +turn off the computer in mathieu's room, {"type": "action"} +can you turn on my computer?, {"type": "action"} +hey, can you dim the lights in the bedroom?, {"type": "action"} +please turn on the heater in the office room, {"type": "action"} +turn off the music in the kitchen, {"type": "action"} +hey, can you play some jazz in the living room?, {"type": "action"} +turn off the fan in the bathroom, {"type": "action"} +hey, can you lock the front door?, {"type": "action"} +turn on the sprinklers in the garden, {"type": "action"} +turn on the AC in the guest room, {"type": "action"} +hey, can you set the thermostat to 72 degrees?, {"type": "action"} +please close the curtains in the dining room, {"type": "action"} +turn on the coffee maker in the kitchen, {"type": "action"} +hey, can you start the dishwasher?, {"type": "action"} +please turn on the humidifier in the bedroom, {"type": "action"} +hey, can you open the garage door?, {"type": "action"} +turn off the oven in the kitchen, {"type": "action"} +turn off the lights in the hallway, {"type": "action"} +turn on the night mode for the entire house, {"type": "action"} +hey, can you schedule a cleaning for tomorrow?, {"type": "action"} +please water the plants in the garden, {"type": "action"} +turn on the porch lights at 7 PM, {"type": "action"} +turn off all the electronics in the house, {"type": "action"} +please start the washing machine, {"type": "action"} +hey, can you turn on the porch lights and set them to green?, {"type": "action"} +turn off the bedroom lights and play some relaxing music, {"type": "action"} +please turn on the coffee machine in the kitchen and brew a cup, {"type": "action"} +hey, can you activate the security system and lock all the doors?, {"type": "action"} +turn off the TV in the living room and switch to channel 5, {"type": "action"} +please turn on the fireplace in the family room, {"type": "action"} +hey, can you start the cleaning robot in the living room?, {"type": "action"} +adjust the thermostat in the bedroom to 68 degrees, {"type": "action"} +please water the garden and turn on the sprinklers, {"type": "action"} +hey, can you close the garage door and turn on the outdoor cameras?, {"type": "action"} +turn off the music in the office room and increase the volume in the kitchen, {"type": "action"} +please activate the home theater system in the media room, {"type": "action"} +hey, can you check the fridge's temperature in the kitchen?, {"type": "action"} +adjust the lighting in the dining room for a romantic dinner, {"type": "action"} +please set a reminder for my appointment tomorrow at 3 PM, {"type": "action"} +hey, can you make a shopping list and display it on the kitchen screen?, {"type": "action"} +turn on the ceiling fan in the living room and set it to medium speed, {"type": "action"} +please order a pizza for dinner and have it delivered, {"type": "action"} +hey, can you locate my phone? I can't find it anywhere, {"type": "action"} +turn on the outdoor fountain and the garden lights for a backyard party, {"type": "action"} + +hey, when did barack obama become president?, {"type": "answer_question"} +when did the statue of liberty has been made?, {"type": "answer_question"} +hey, who is the current president of the United States?, {"type": "answer_question"} +when was the Eiffel Tower constructed?, {"type": "answer_question"} +what's the capital of Japan?, {"type": "answer_question"} +who wrote the play "Romeo and Juliet"?, {"type": "answer_question"} +tell me a joke, {"type": "answer_question"} +what's the capital of France?, {"type": "answer_question"} +who is the author of "To Kill a Mockingbird"?, {"type": "answer_question"} +when was the first computer invented?, {"type": "answer_question"} +what's the recipe for chocolate chip cookies?, {"type": "answer_question"} +tell me a riddle, {"type": "answer_question"} + +what is the temperature in the living room ?, {"type": "smart_home_question"} +are the kitchen lights on ?, {"type": "smart_home_question"} +what's the humidity level in the bedroom?, {"type": "smart_home_question"} +is the front door locked?, {"type": "smart_home_question"} +what's the weather like outside?, {"type": "smart_home_question"} +is the garage door closed?, {"type": "smart_home_question"} +are the windows in the kitchen open?, {"type": "smart_home_question"} +what's the air quality in the kitchen?, {"type": "smart_home_question"} +is the garage door open or closed?, {"type": "smart_home_question"} +what's the current energy consumption of the house?, {"type": "smart_home_question"} +are the blinds in the bedroom open or closed?, {"type": "smart_home_question"} +is the security system armed or disarmed?, {"type": "smart_home_question"} + +do you like orange juice ?, {"type": "other"} +what's your favorite color?, {"type": "other"} +tell me a fun fact, {"type": "other"} +do you like chocolate or vanilla ice cream?, {"type": "other"} +what's your favorite movie?, {"type": "other"} +what's your favorite season?, {"type": "other"} +tell me a random fact about llamas, {"type": "other"} +do you prefer sunrise or sunset?, {"type": "other"} +what's your favorite book?, {"type": "other"} \ No newline at end of file diff --git a/src/text/engine/llama/generate_datasets.py b/src/text/engine/llama/generate_datasets.py new file mode 100644 index 0000000..a459aec --- /dev/null +++ b/src/text/engine/llama/generate_datasets.py @@ -0,0 +1,14 @@ +from src.get_path_file import project_path + +if __name__ == '__main__': + + dataset_actions = open(project_path / "text" / "engine" / "llama" / "dataset_action_qualifier.csv", "r").read() + dataset_actions_output = open(project_path / "text" / "engine" / "llama" / "dataset_action_qualifier.txt", "w") + + # read the dataset as csv and for each entry write the text to a txt file + for line in dataset_actions.split("\n"): + # skip the first line and empty lines + if line == "" or line.startswith("user_question,bot_answer"): + continue + + dataset_actions_output.write("" + line + "\n")