diff --git a/notebook/Beta/generative_model-maps.ipynb b/notebook/Beta/generative_model-maps.ipynb new file mode 100644 index 0000000..66f9413 --- /dev/null +++ b/notebook/Beta/generative_model-maps.ipynb @@ -0,0 +1,4435 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "GrLWLle74-mC" + }, + "source": [ + "## Installation\n", + "\n", + "We will need to install a number of libraries to start with." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "2IVQbA_GeDqN", + "outputId": "16320c46-f3f8-45a8-e4b2-182dee591187" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n", + "Collecting transformers\n", + " Downloading transformers-4.28.1-py3-none-any.whl (7.0 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m7.0/7.0 MB\u001b[0m \u001b[31m95.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: tqdm>=4.27 in /usr/local/lib/python3.9/dist-packages (from transformers) (4.65.0)\n", + "Requirement already satisfied: numpy>=1.17 in /usr/local/lib/python3.9/dist-packages (from transformers) (1.22.4)\n", + "Requirement already satisfied: requests in /usr/local/lib/python3.9/dist-packages (from transformers) (2.27.1)\n", + "Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.9/dist-packages (from transformers) (6.0)\n", + "Collecting tokenizers!=0.11.3,<0.14,>=0.11.1\n", + " Downloading tokenizers-0.13.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.8 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m7.8/7.8 MB\u001b[0m \u001b[31m119.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hCollecting huggingface-hub<1.0,>=0.11.0\n", + " Downloading huggingface_hub-0.13.4-py3-none-any.whl (200 kB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m200.1/200.1 kB\u001b[0m \u001b[31m22.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hRequirement already satisfied: regex!=2019.12.17 in /usr/local/lib/python3.9/dist-packages (from transformers) (2022.10.31)\n", + "Requirement already satisfied: filelock in /usr/local/lib/python3.9/dist-packages (from transformers) (3.11.0)\n", + "Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.9/dist-packages (from transformers) (23.0)\n", + "Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.9/dist-packages (from huggingface-hub<1.0,>=0.11.0->transformers) (4.5.0)\n", + "Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.9/dist-packages (from requests->transformers) (1.26.15)\n", + "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.9/dist-packages (from requests->transformers) (2022.12.7)\n", + "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.9/dist-packages (from requests->transformers) (3.4)\n", + "Requirement already satisfied: charset-normalizer~=2.0.0 in /usr/local/lib/python3.9/dist-packages (from requests->transformers) (2.0.12)\n", + "Installing collected packages: tokenizers, huggingface-hub, transformers\n", + "Successfully installed huggingface-hub-0.13.4 tokenizers-0.13.3 transformers-4.28.1\n", + "Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n", + "Collecting sentencepiece\n", + " Downloading sentencepiece-0.1.98-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB)\n", + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.3/1.3 MB\u001b[0m \u001b[31m41.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", + "\u001b[?25hInstalling collected packages: sentencepiece\n", + "Successfully installed sentencepiece-0.1.98\n" + ] + } + ], + "source": [ + "import networkx as nx\n", + "!pip install transformers\n", + "!pip install sentencepiece" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "ppJQOfF-3HT1" + }, + "source": [ + "We use flan alpaca model for speed and local execution." + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 620, + "referenced_widgets": [ + "00e9e80df0c140df9ec1378a6dd2c35f", + "1bb51bbeb77649f288570cc19162235c", + "bb6c9a2aad41428b884327624f990ba9", + "e446a3fc3209402aa9a422926c2ab32f", + "3bdeace6cfe84714af3f1afb94757905", + "0f6c6890d8cf45bd9fd4803cc19631aa", + "939c4ffc17f04b56bb7d3a1ecfde33e4", + "8733e0b092334534a58b92e63f29ade4", + "9712d3a74ff4431f8e7fcf4bab648783", + "26b84f7fb68941c894c367268407fff8", + "c1c91634ca5b4190a623f5c56b8bb467", + "6f511fcf0ebe4453819940455e26731c", + "a6be014e9a7d4cd9bd5cb073f17c1547", + "b0baf7c8ba5543f48b4d4765e31af9ec", + "4e6cba9c941b4d429e53d56fa251b2e3", + "8554012611df4aafa633f332e15028f9", + "a5c91061fb7d428d8f1eab3d6265e4ed", + "b2ab3b7bc0a64e5a91e1a11b429fb4b6", + "7b71df0b16614ecd834a8a074eaeaf5c", + "d9ac3bcdcbf24d52afa37a6280c2f358", + "3fb9bef7a16946a8bfeb7534e1ab09c7", + "d6d4d454ffa14d6f8d2f554ea85d5611", + "f22c4e27ab3e4b279cf4419aded461c8", + "6aa43d863a6b482f969886dc6ff1d663", + "763e774ecef74598a080867ba96a1d96", + "fe995a2a30f44c50bd26ae26309ba57b", + "659fc932ed374db294ff777555bb1917", + "d8292b0976b6415eb2278389cb0267e8", + "8ef7b6c0d5bf43d19d5b755b9e109538", + "5fe1f3c90d484d17a914e8389db35c95", + "60a28c62926e4a46a25460c2966a87b2", + "02ba677f3eb542f6a6029df52f0a699c", + "bc607f682d66468f99b882f5c171354e", + "1054346bd142484f8edac181f0cf54e5", + "4f6b7e33b38a4be982ed34f7cefd2d02", + "bf1e595182454f04bed1acdc7504bcd9", + "4c67c9ee767b4619bfc010124ef79676", + "2cf8417b20ca4409861f2f72020b9708", + "a0999a9ad26543e782113f2e77992a17", + "687f19c296784f15ab84fc4d9f033662", + "a32835fbb20f4f0c8b2afe403738afad", + "8de68e042810434688e03c51eb3350d8", + "8a2cc4063fdf472faee48234d91a4d95", + "829bcc42e30d46099679f987d33840a9", + "c3fb71f2989c4e039d051cbd30674599", + "c13eb8e2c502484fa999e70380706153", + "c2ea81c4548a497698fe3118170044a0", + "633454440014452faade862d58465085", + "56a3a46df78f40e9946b8f72b4b911fc", + "946cd697ab5f4841b63ef172969c8c5d", + "97e669facdb6415cb3a4a4dc1cb86f0e", + "c3a33ae088ad42ecbe40e984b0f53dfb", + "4fc2ced4b3ce44e59188468261ead796", + "7db7fe6ecd04456596a76c769979469b", + "d3deb5a6cf174acc8c5a1a77e1bfb7f2", + "b070db2dcdb44ac283bbbc80144604e2", + "1269b08a77eb4bf192a2da51ffdd8868", + "5bf6d78fdd3849b0a7a2700044f51a98", + "50c87bc5c7ae412cba7e91cf512b79a1", + "08227cf4c4554f818f588779d1958b50", + "20eafb8b16ca4f27be8ad383352d4355", + "3630ef6689224a3aa3300e282b18fb77", + "3146ce3e6b1a4f8587909d86c31b91f6", + "a7ddcc09036d4f0bb2304c3df6acea5e", + "56bc7049d87b4a2897181a81134fccf3", + "8d223f4d354d47629f797714de02312a", + "64eba6ee704f4809ac5f2041924f8a1c", + "197ecb7dde61482caec456b9083652d9", + "2377cca26da7420ab4802928b366d9a6", + "f383f671372c4297a8ff0892477e8b50", + "25aeb3bee46747a1bcaced31f9033126", + "699c41ffa6824409a4ca1b851daa9965", + "d551b28bf57346c2825d45ef2d7742b0", + "54e9d255c6ae4b6daaf9519e0f9dd3ab", + "edc9dadc92b44065a35c3ac8f7da5794", + "7cef268a570a42f98488ac897e42bdcc", + "21054ba8448a4d638a95823d4756d7de", + "8a0b15d9e6f847e5918499c0d29d43f7", + "8e96c3bac6034acbaa2aeea310cdbeb8", + "f7551a5cb8f74ab1a9655955b28f300b", + "ad5a6bfd1f874e1ca788b7c2a17b5673", + "ca54dba95ff3458c88a109adf7d35648", + "497896ea7d27492ea325c95dc5ff23ba", + "01b33d3a979146c6bb746c12d3408d0f", + "31825a4f0eb54334a5d79b3c994d7c01", + "364fbc2e60da46ca985195a566b1d08e", + "77f9bf0e2d9d4b748adb2995f227de40", + "7be5e5cb3ddd470d839c7a96669164fe", + "cca87842bea942d6a09499e8fd269397", + "20fd206a77544c0f96a69c38ff5fdfa0", + "edc9106d6df248fcaac91cc170a3009a", + "375ea16d2ad3470199c78597d6845610", + "1c3df5d21cc04d9e83ed8019e01ada67", + "4b65c6b088a94da7992cdd932c8045a3", + "4ca35956d28145568a538aba0a4836cb", + "e9f23241ba1447bcb29b0318c5b83505", + "0a30bb5a9f8d48159baff64c2d11563b", + "f036a03a35604724be7b7387d8f1fd19", + "4026b60eb9ee454fae1955e830cf32d8", + "11cbf60cba3d49bdb4168a85487733e1", + "cf64201aa9eb44b1b077f79a775e1f8c", + "57add803300a44fa8e1a36dbc69f3fae", + "2ecbb09af01e4b26b5854f625a4b12f2", + "20965b8ee5674c05875c0aaf8e86b4a2", + "579b1ad3d88945dc9f4de7fd1ca538b1", + "89ffff8e331940dbbf9ad39c414366dd", + "954868b479894b499d422959de4b4375", + "82d4f5ea403849b49c3d024b26a9578c", + "831065e9d8b14b71ac8119c8b273e184", + "3bdaa65b9dc34accace1af767a61cc39" + ] + }, + "id": "_5tljpoz0PNA", + "outputId": "62df551d-9833-4401-e25d-e75f9252571b" + }, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "00e9e80df0c140df9ec1378a6dd2c35f", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Downloading (…)lve/main/config.json: 0%| | 0.00/1.53k [00:00 512). Running this sequence through the model will result in indexing errors\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Toblen Stonehill I prepared breakfast and toast in the next hour. I read the morning paper before starting the day. I started the day by doing some errands and doing some exercises. I finished the day off with dinner. I set aside some time for myself to practice meditation. I studied the day ahead. I did something to make someone’s day better.\n", + "Daran Edermath I took notes before I left Phandalin.\n", + "Linene Graywind I went to the market to buy supplies. I got to the market before 9:30 am.\n", + "Halia Thornton I worked on finishing yesterdays tasks, enlisting new merchants, and settling disputes with rivals.\n", + "Qelline Alderleaf Qelline started her day by prepping her breakfast. Then, she made calls to friends and family to check in on them. Then, she started to write her blog posts about the town. Next, she chatted with Sister Garaele and Harbin Wester about their morning plans. Qelline finished her blog posts later in the day.\n", + "Sister Garaele I did this task for the second hour.\n", + "Harbin Wester Harbin Wester had breakfast, then plans out the day. He stops by the trading post to chat with Toblen Stonehill and Sister Garaele. He speaks to Terrill Five Fingers, then a neighbor to discuss a business plan. Harbin then goes to the local museum to check out the museums exhibits. He has lunch and finishes his paperwork for the meeting with the council members. Then he has dinner at one of the restaurants tables. Afterwards, he listens to the morning news. Once the meeting is over, he has a cup of tea.\n", + "Terrill Five Fingers Terrill Five Fingers met with a good businesswoman, learned some useful business jargon, and developed an understanding of what is happening in the nearby area.\n", + "Conrad Scarface I set up an opportunity meeting with the two Redbrand ruffians, Terrill Five Fingers and Valerie the Grin, and talked with them about current events and their respective roles.\n", + "Robbing Nellie I stole the treasure box at 8 am, broke into the bank at 9 am, started a search for the bounty at lunchtime, and took the money to the bank by 4 pm.\n", + "Valerie the Grin I started to plot my escape while the people in town talked.\n" + ] + } + ], + "source": [ + "action_results = {}\n", + "for name in town_people.keys():\n", + " action_results[name] = generate(prompt_meta.format(action_prompts[name]))\n", + " # Now clean the action\n", + " prompt = \"\"\"\n", + " Convert the following paragraph to first person past tense:\n", + " \"{}\"\n", + " \"\"\".format(action_results[name])\n", + " action_results[name] = generate(prompt_meta.format(prompt)).replace('\"', '').replace(\"'\", '')\n", + " print(name, action_results[name])" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "rLYWQcuDxfks" + }, + "source": [ + "Collect the memories people observe." + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "id": "qL0YTTv_3znD" + }, + "outputs": [], + "source": [ + "action_prompts = {}\n", + "for location in town_areas.keys():\n", + " people = []\n", + " for i in town_people.keys():\n", + " if locations[i] == location:\n", + " people.append(i)\n", + " \n", + " for name in people:\n", + " for name_two in people:\n", + " memories[name].append('[Time: {}. Person: {}. Memory: {}]\\n'.format(str(global_time), name_two, action_results[name_two]))" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "MmLy4OYssH32" + }, + "source": [ + "# Rank Memories" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "id": "jaUW3jeqsHV-" + }, + "outputs": [], + "source": [ + "import re\n", + "def get_rating(x):\n", + " nums = [int(i) for i in re.findall(r'\\d+', x)]\n", + " if len(nums)>0:\n", + " return min(nums)\n", + " else:\n", + " return None" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "jnqRL7-H5Xj8", + "outputId": "8762d438-eb38-4335-b704-aec26dea8b36" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[('4/5. I care deeply bc I understand what it means to balance a routine and be able to make my own decisions in life. I am looking forward to being more mindful throughout my life.', 4), (\"3 (Caring) - I can only care about the time, not the person or the background, but I'm conscious of the moment and have taken notes.\", 3), ('3 (I care about it but it would be better to have it in a different form)', 3), ('Rating: 3/5. Toblen Stonehill observes that Halia Thornton is working hard and seems like she has achieved a good amount of goals this morning, so this makes him want to get in the game and learn more.', 3), (\"2 Toblen Stonehill: This is an excellent example of how to start the day. We can learn a lot from her actions and it shows the importance of taking time for meaningful activities like this. We can also see why this is important to her; her actions demonstrate how commitment to her goals can make her life better. It's a great reminder to us to put ourselves first and be compassionate towards our neighbors. It's inspiring. 5\", 2), ('3 out of 5 (Need to work harder)', 3), ('5 (Because I care deeply about this),', 5), ('I care about this highly. It is important that Terrill Five Fingers can keep growing their skills and gain knowledge in the business world.', 0), ('3/5. I think this is great news and I wish the Scarface family luck for their upcoming encounter.', 3), ('3/5. I care about this scene because it symbolizes the impact of kindness in the world. I hope it reminds others of the importance of kindness and deeds of generosity.', 3), ('2 to make it more enjoyable to spend time in Phandalin Town Square.', 2)]\n", + "[('Daran Edermath cares greatly about his daily activities, and values the importance of self-care. He will be visiting Phandalin Town Square in the morning to discuss his daily plan and his goals.', 0), ('4/5. I care very much about starting my day on a positive note and remembering to take notes before I left Phandalin.', 4), (\"4 because I don't care about Linene's memory.\", 4), (\"4 (Not at all) - I'm not particularly interested in this person.\", 4), ('2 (Experience): I care about this greatly, as it allows me to learn more about Qelline.', 2), ('1 (Minor) - I am not really caring about this, since I am still working towards my daily goal of starting my day on a positive note.', 1), (\"5 (Caring): Harbin's story is an inspiration and I want to emulate his daily routines. This exercise has taught me many valuable lessons, such as having meaningful relationships with others and the importance of taking care of myself.\", 5), ('4: I care about this because I believe a positive start to a day is essential for overall well-being.', 4), ('3 (I am not sure how much I care about this yet.)', 3), (\"3 (Don't care much) because the plan I have for the day is to focus on enjoying the apple orchard and refining my skills.\", 3), (\"3 out of 5. I care about this mainly to see if I can make it to a positive conclusion for my day, and I don't care much about the person's memories here.\", 3)]\n", + "[('3/4. This was a good reminder of the importance of a healthy lifestyle.', 3), (\"3/5 on the importance level. Although the task doesn't seem too urgent, I care about the details and I want to make sure I don't miss out on anything.\", 3), ('5 (important) (The fact that I went to the market to buy supplies implies that I care about the task in a way that no other person can).', 5), ('3/5. I care very much about this person and all they have achieved. I consider them an inspiration and an excellent role model and greatly admire their courage and tenacity.', 3), ('3/10. Linene is likely not as interested as you in the content of this memory, since they may not find any useful information. You have limited time during this part of your day, and you would prefer to focus on your own work.', 3), ('3 out of 5 stars. I care about this scenario, as it will determine how effective my orders are placed in the market.', 3), (\"3 (Not very interested) because getting to the market at 9 AM isn't even on my agenda yet.\", 3), ('3/5. I care about this quite a bit and it serves as a good reminder of how important it is to network and stay connected to the business world.', 3), ('5 (very interested) because it could potentially be useful when I need to place another order.', 5), (\"4 (Caring) This is a minor detail. I hardly notice it as I am mainly focusing on my morning routine and the markets. I am far more interested in the details of my character's accomplishments.\", 4), ('2 As I have given myself an extra hour to finish my tasks, I find the idea of watching the people in town talk interesting.', 2)]\n", + "[('4 because I value this memory highly. It reminds me of how well I am doing and how much I care about my daily schedule.', 4), ('4 out of 5 ratings. I find it important to take note of these details since they could help me later in the day.', 4), ('I care about this. Please rate it a 4.', 4), ('5 (Very) Important. You are on the last night of your vacation and there’s still a lot of work you need to do before you leave. It’s important to do whatever it takes to ensure your success.', 5), ('4 This is something I care about. It is a wonderful example of what achieving your goals can bring.', 4), ('2/5. I do not care much about the present moment.', 2), (\"5 I care about this. I'm interested in what happens to Harbin and how he's spending his day.\", 5), ('3 out of 5 stars. This might seem like a trivial matter and it is, but it is still important to me. It demonstrates my ability to remain focused and motivated while running my business. Thanks for the prompt, Halia Thornton!', 3), ('4/5. I care about this because it is relevant to my daily tasks and I can use it to help me become a better leader and make better decisions.', 4), (\"3/5 I care about this. The timing of the crime and the fact that it was committed by the perpetrator's favorite criminal organization are important factors to consider when setting the agenda for another day.\", 3), ('3/5. I care about the background information provided to make this information relevant to my daily tasks.', 3)]\n", + "[(\"3/5. Toblen's actions are admirable and exemplify the importance of self-care and mindfulness. Qellerine can use this example to practice mindfulness and make the most of their daily schedule.\", 3), ('I care about this as much as the rest of the day.', 0), ('I care about this. I want to make sure Linene is as well.', 0), ('4. I care deeply about the daily routine of the townsfolk in Phandalin Town Square. I take pride in seeing the hard work and dedication our residents put into their daily activities. I hope the city authorities recognize our efforts and start to take advantage of them. We all must work together to bring order to the situation and progress both economically and socially.', 4), ('Qelline cares about her daily routine very much.', 0), ('3/5. I care about this because it shows that I take my roles in the community seriously and I am responsible for the decisions I make.', 3), ('4 out of 5; you care very much about how Harbin Wester spends his day.', 4), ('Qelline Alderleaf: I care about this greatly.', 0), (\"4 - I care about it a lot. I'm always interested in what Conrad and his team have to say about the latest developments and how they impact the game.\", 4), (\"4/5. I care deeply about this story and am deeply impressed by Qelline's resilience.\", 4), ('I care about this a lot. I enjoyed seeing how Valerie the Grin interacts and how she remembered what I told her about plotting my escape.', 0)]\n", + "[('3 I care very much about this. I am looking forward to the opportunities it opens up for me.', 3), ('3/5. It is interesting to observe what is going on in Phandalintown Square and how it is helping to shape the city.', 3), (\"4 The event is very important to me and I care about it greatly. It's a reminder of how hard I can work on my goals and how much I need to achieve.\", 4), ('4 (important) Thank you, Sister Garaele!', 4), (\"3+. You are concerned about QELLIN'S plan and think it is great that she took time to make her food before doing other activities. The memory adds insight into the type of person QELLIN is and how she is handling her day. It reminds me of how important it is to be kind and take care of ourselves so that we can help those around us.\", 3), ('5 (care) - I care about this situation more than others and I take pride in my effort to help others.', 5), ('3/5 stars. This day was a success and I am amazed by his resilience and commitment to his goals.', 3), ('4/5. I care greatly about the information gained by Terrill Five Fingers during this visit.', 4), ('Rating: 3/5. The meeting of Conrad Scarface with the two Redbrand ruffians and Valerie is an important step in Brotherhood unity and the exploration of Phandalin, and I am very proud of him for taking those steps.', 3), (\"3/5 stars. It's interesting to see where the random human is going, and I think it would be fun to find out in-game details.\", 3), (\"I'm not sure how much I care about this but it's pretty cool.\", 0)]\n", + "[('4 (Self-care) = 5 (Careful)', 4), ('I care about this because I am helping my neighbor with their issue and it is helping my own.', 0), ('3/5. I care about this because I think it can be helpful for my life.', 3), (\"I care about that a lot. It's amazing how fast progress has been made in the past few days.\", 0), ('3/5. The memory of Qelline and her tasks were inspiring and motivating.', 3), ('3/5. My concern is to make sure I get to my meeting on time.', 3), ('I care about this very much. It is the foundation of my interactions with others, and it is inspiring me to take time for planning and reflection. Every day, I can learn valuable lessons about how to make the most out of my time and effort.', 0), (\"I care about this. I value Terrill's experience and could use it to build my own career.\", 0), ('3/3 since you are only in Phandalin Town Square for a short time and not on an official mission.', 3), ('4 because I care about the importance of my time in the Square.', 4), ('3 out of 5 stars. I care about the memory of Valerie the Grin and the event she went through at 8. It evokes emotion and I look forward to further exploring the town and its inhabitants.', 3)]\n", + "[('4 This is something I care about deeply and I hope you do too.', 4), ('3/5. I care a lot about this and would like to learn more about Daran Edermath and his business, so I am paying increased attention.', 3), (\"3/5 (No care): I am at 8:00 and I can appreciate the person's efforts but I am not interested in learning more about their actions. This information is irrelevant to me as I need to focus on completing my mission.\", 0), ('5 (very important) I care about this a lot and am determined to meet Halia Thornton.', 5), (\"4 (Much cared for) because this is the memory of Qelline Alderleaf's morning activities.\", 4), ('3/5. I rate this task highly important, and I will do my best to complete it soon.', 3), (\"4 for importance. This is the best timeline I could find to observe Harbin Wester's daily routine.\", 4), ('5 out of 5 I care a lot about this.', 5), (\"3/5. Conrad Scarface deserves an outsize portion of Terrill Five Fingers' time.\", 3), ('3/5 I care about this. I want to learn more about the incident and want to start a conversation with Nellie.', 3), (\"3/5. This action is important for Terrill Five Fingers' plans and reflects how important it is for his progress.\", 3)]\n", + "[(\"1 because I don't care much about this person's daily routine.\", 1), ('5 because I care about it now, amidst my escape from prison and my financial security goals.', 5), ('I care about this very much, and I will take it into consideration when making my long-term plans.', 0), ('3 (Mean) to care about.', 3), (\"4 It is clear from your plan that you care greatly about Qelline Alderleaf's legacy. Moreover, you have heard many positive things about her, her values, and her legacy of supporting the people of Phandalin. Knowing that is why I care so much about her and her story.\", 4), ('I care about this slightly more than I care about the first task you gave me, so I rate it a 5 out of 5.', 5), (\"3 [Conrad: I am interested in what Harbin's day looks like. Is it his morning routine? Conrad: I have no idea. I guess I can just learn from Harbin's actions. Rating: 3]\", 3), ('I care about this a lot. I want to take more of a role in the community by making connections and taking part in initiatives to help make the area safe.', 0), ('3/5. This memory was very meaningful to me and I was truly delighted to have the opportunity to talk to an influential group of people about the current state of affairs.', 3), ('3/5 (Not Very) Seeing this person robbing Nellie gives me the idea that I should start looking for a job to help me make my payments more reliable.', 3), ('5 (Very Important)! It is important that I remember this important event to help me plan my escape.', 5)]\n", + "[('I care about this a lot. It is something I value highly and I plan to make it part of my daily routine. I am also very impressed with Toblen, and consider him a role model for others.', 0), ('4 I care about this. It helps me decide what to do next in my robbery plans.', 4), ('3 (Weak) This information is important to me because it reveals that the plans I have already in place could be more beneficial to me. The timing of my visit is better to steal the treasure box because it gives me enough time to reach the bank on time and prepare the money.', 3), ('1 (Not very important) for now. Before you go on your journey, you should check to see if the area has been marked for robbery.', 1), ('5! I care about this memory highly.', 5), ('I rate this activity a 2 out of 5.', 2), ('3 (Care): I care about Harbin and his daily routine, so I rate it 3.', 3), ('5 As this is an important part of my planning, I care about it highly. It will help me build the trust and confidence with Nellie and help me on my raid.', 5), ('3/5. We need to think of some better timing for your bank raid.', 3), ('3/10. It is easy to rob Nellie in a short time, but it requires effort.', 3), (\"1 (Nothing) - I don't care too much.\", 1)]\n", + "[('3/5. Toblen’s daily routine is very inspiring and I envy his ability to stay organized and complete all the things he needs to complete.', 3), ('4 because I am now part of Phandalin Town Square and I need to find out where Daran Edermath is, so I care about the time 8 and his presence.', 4), (\"2 (Weak) I care about this as I need to get to the market soon. I can take care of this and not be drawn too much attention. I wouldn't let this interfere with my plan to escape.\", 2), ('3 (Not very) because it has nothing to do with my plans.', 3), (\"4/5. I am intrigued by the life of Qelline Alderleaf and would like to take some time to learn more about her. I am impressed with the way she has organized her day and I'd love to hear more about her journey.\", 4), ('5 I care about this as I need to complete my plans in the next few hours.', 5), ('3 (I care about this but will not be focusing on it.)', 3), (\"3 (No, Valerie, she doesn't care).\", 3), ('2/5. You care about this very much, and it represents an important part of your future.', 2), (\"3 (adjusted) because I understand the person's motivation.\", 3), ('3/5. I care about this a great deal, and I hope you do too.', 3)]\n" + ] + } + ], + "source": [ + "memory_ratings = {}\n", + "for name in town_people.keys():\n", + " memory_ratings[name] = []\n", + " for i, memory in enumerate(memories[name]):\n", + " prompt = \"You are {}. Your plans are: {}. You are currently in {}. It is currently {}:00. You observe the following: {}. Give a rating, between 1 and 5, to how much you care about this.\".format(name, plans[name], locations[name], str(global_time), memory)\n", + " res = generate(prompt_meta.format(prompt))\n", + " rating = get_rating(res)\n", + " max_attempts = 2\n", + " current_attempt = 0\n", + " while rating is None and current_attempt" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "在15:00的时候, Terrill Five Fingers:在狮盾Coster,我和其他恶棍一起参加了今晚的聚会。\n", + "在15:00的时候, Conrad Scarface:在幸运神殿,我与康拉德·疤面煞星进行了互动,以获得他们的信任。\n", + "在15:00的时候, Robbing Nellie:在斯通希尔旅馆,我在公共休息室遇到了Robbing Nellie和Valerie the Grin。内莉在那里等我,问我是否知道她抢劫小镇的计划。我很好奇她对我和她有什么想法。在我离开之前,我们进行了简短的交谈并交换了几句话。\n", + "在15:00的时候, Valerie the Grin:在斯通希尔旅馆,我进入了斯通希尔旅馆。然后我去了Robbing Nellies。我们交换了几句话,我做了自我介绍。然后我们聊了一会儿,了解当天的活动,并谈论即将发生的事情。几分钟后,Robbing Nellie和我分开了。\n" + ] + } + ], + "source": [ + "\n", + "fig = plot_town_areas(global_time,town_areas_coords, town_people_coords)\n", + "display(fig)\n", + "for repeats in range(5):\n", + " global_time += 1\n", + " action_prompts = {}\n", + " for location in town_areas.keys():\n", + " people = []\n", + " for i in town_people.keys():\n", + " if locations[i] == location:\n", + " people.append(i)\n", + " \n", + " for name in people:\n", + " prompt = \"You are {}. Your plans are: {}. You are currently in {} with the following description: {}. Your memories are: {}. It is currently {}:00. The following people are in this area: {}. You can interact with them.\".format(name, plans[name], location, town_areas[location], '\\n'.join(compressed_memories_all[name][-5:]), str(global_time), ', '.join(people))\n", + " people_description = []\n", + " for i in people:\n", + " people_description.append(i+': '+town_people[i])\n", + " prompt += ' You know the following about people: ' + '. '.join(people_description)\n", + " memory_text = '. '.join(memories[name][-10:])\n", + " prompt += \"What do you do in the next hour? Use at most 10 words to explain.\"\n", + " action_prompts[name] = prompt\n", + " action_results = {}\n", + " for name in town_people.keys():\n", + " action_results[name] = generate(prompt_meta.format(action_prompts[name]))\n", + " # Now clean the action\n", + " prompt = \"\"\"\n", + " Convert the following paragraph to first person past tense:\n", + " \"{}\"\n", + " \"\"\".format(action_results[name])\n", + " action_results[name] = generate(prompt_meta.format(prompt)).replace('\"', '').replace(\"'\", '')\n", + " print(name, locations[name], global_time, action_results[name])\n", + " person_name, building_name = name,locations[name]\n", + " if person_name in town_people_coords and building_name in town_areas_coords:\n", + " town_people_coords[person_name] = town_areas_coords[building_name]\n", + " fig = plot_town_areas(global_time,town_areas_coords, town_people_coords)\n", + " clear_output(wait=True)\n", + " display(fig)\n", + " action_prompts = {}\n", + " for location in town_areas.keys():\n", + " people = []\n", + " for i in town_people.keys():\n", + " if locations[i] == location:\n", + " people.append(i)\n", + " \n", + " for name in people:\n", + " for name_two in people:\n", + " memories[name].append('[Time: {}. Person: {}. Memory: {}]\\n'.format(str(global_time), name_two, action_results[name_two]))\n", + "\n", + " memory_ratings = {}\n", + " for name in town_people.keys():\n", + " memory_ratings[name] = []\n", + " for i, memory in enumerate(memories[name]):\n", + " prompt = \"You are {}. Your plans are: {}. Your memories are: {}. You are currently in {}. It is currently {}:00. You observe the following: {}. Give a rating, between 1 and 5, to how much you care about this.\".format(name, plans[name], '\\n'.join(compressed_memories_all[name][-5:]), locations[name], str(global_time), memory)\n", + " res = generate(prompt_meta.format(prompt))\n", + " rating = get_rating(res)\n", + " max_attempts = 2\n", + " current_attempt = 0\n", + " while rating is None and current_attempt