476 lines
26 KiB
Plaintext
476 lines
26 KiB
Plaintext
|
|
{
|
|||
|
|
"nbformat": 4,
|
|||
|
|
"nbformat_minor": 0,
|
|||
|
|
"metadata": {
|
|||
|
|
"colab": {
|
|||
|
|
"provenance": []
|
|||
|
|
},
|
|||
|
|
"kernelspec": {
|
|||
|
|
"name": "python3",
|
|||
|
|
"display_name": "Python 3"
|
|||
|
|
},
|
|||
|
|
"language_info": {
|
|||
|
|
"name": "python"
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
"cells": [
|
|||
|
|
{
|
|||
|
|
"cell_type": "code",
|
|||
|
|
"execution_count": 1,
|
|||
|
|
"metadata": {
|
|||
|
|
"colab": {
|
|||
|
|
"base_uri": "https://localhost:8080/"
|
|||
|
|
},
|
|||
|
|
"id": "3wNPxkw1lxmU",
|
|||
|
|
"outputId": "998eeaf1-b917-408b-dc9e-c52d05671bba"
|
|||
|
|
},
|
|||
|
|
"outputs": [
|
|||
|
|
{
|
|||
|
|
"output_type": "stream",
|
|||
|
|
"name": "stdout",
|
|||
|
|
"text": [
|
|||
|
|
"Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n",
|
|||
|
|
"Collecting openai\n",
|
|||
|
|
" Downloading openai-0.27.2-py3-none-any.whl (70 kB)\n",
|
|||
|
|
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m70.1/70.1 KB\u001b[0m \u001b[31m1.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
|||
|
|
"\u001b[?25hRequirement already satisfied: tqdm in /usr/local/lib/python3.9/dist-packages (from openai) (4.65.0)\n",
|
|||
|
|
"Collecting aiohttp\n",
|
|||
|
|
" Downloading aiohttp-3.8.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.0 MB)\n",
|
|||
|
|
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.0/1.0 MB\u001b[0m \u001b[31m7.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
|||
|
|
"\u001b[?25hRequirement already satisfied: requests>=2.20 in /usr/local/lib/python3.9/dist-packages (from openai) (2.27.1)\n",
|
|||
|
|
"Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.9/dist-packages (from requests>=2.20->openai) (3.4)\n",
|
|||
|
|
"Requirement already satisfied: charset-normalizer~=2.0.0 in /usr/local/lib/python3.9/dist-packages (from requests>=2.20->openai) (2.0.12)\n",
|
|||
|
|
"Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.9/dist-packages (from requests>=2.20->openai) (2022.12.7)\n",
|
|||
|
|
"Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.9/dist-packages (from requests>=2.20->openai) (1.26.15)\n",
|
|||
|
|
"Collecting frozenlist>=1.1.1\n",
|
|||
|
|
" Downloading frozenlist-1.3.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (158 kB)\n",
|
|||
|
|
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m158.8/158.8 KB\u001b[0m \u001b[31m8.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
|||
|
|
"\u001b[?25hCollecting multidict<7.0,>=4.5\n",
|
|||
|
|
" Downloading multidict-6.0.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (114 kB)\n",
|
|||
|
|
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m114.2/114.2 KB\u001b[0m \u001b[31m3.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
|||
|
|
"\u001b[?25hCollecting aiosignal>=1.1.2\n",
|
|||
|
|
" Downloading aiosignal-1.3.1-py3-none-any.whl (7.6 kB)\n",
|
|||
|
|
"Collecting async-timeout<5.0,>=4.0.0a3\n",
|
|||
|
|
" Downloading async_timeout-4.0.2-py3-none-any.whl (5.8 kB)\n",
|
|||
|
|
"Collecting yarl<2.0,>=1.0\n",
|
|||
|
|
" Downloading yarl-1.8.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (264 kB)\n",
|
|||
|
|
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m264.6/264.6 KB\u001b[0m \u001b[31m11.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
|||
|
|
"\u001b[?25hRequirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.9/dist-packages (from aiohttp->openai) (22.2.0)\n",
|
|||
|
|
"Installing collected packages: multidict, frozenlist, async-timeout, yarl, aiosignal, aiohttp, openai\n",
|
|||
|
|
"Successfully installed aiohttp-3.8.4 aiosignal-1.3.1 async-timeout-4.0.2 frozenlist-1.3.3 multidict-6.0.4 openai-0.27.2 yarl-1.8.2\n"
|
|||
|
|
]
|
|||
|
|
}
|
|||
|
|
],
|
|||
|
|
"source": [
|
|||
|
|
"!pip install openai"
|
|||
|
|
]
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"cell_type": "code",
|
|||
|
|
"source": [
|
|||
|
|
"import os\n",
|
|||
|
|
"os.environ['OPENAI_API_KEY'] = \"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\""
|
|||
|
|
],
|
|||
|
|
"metadata": {
|
|||
|
|
"id": "gEIVE6v_mBYK"
|
|||
|
|
},
|
|||
|
|
"execution_count": 14,
|
|||
|
|
"outputs": []
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"cell_type": "code",
|
|||
|
|
"source": [
|
|||
|
|
"import openai"
|
|||
|
|
],
|
|||
|
|
"metadata": {
|
|||
|
|
"id": "LucF0Obmm8x6"
|
|||
|
|
},
|
|||
|
|
"execution_count": 7,
|
|||
|
|
"outputs": []
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"cell_type": "code",
|
|||
|
|
"source": [
|
|||
|
|
"context = '''\n",
|
|||
|
|
"Team A had 60% ball possession, 10 shots on target, 5 corners, and 2 yellow cards. Team B had 40% ball possession, 8 shots on target, 3 corners, and 3 yellow cards. Team A 2 goals and Team B 2 goals.\n",
|
|||
|
|
"\n",
|
|||
|
|
"If the team A wants to win the match what to do in stratygic way?\n",
|
|||
|
|
"'''"
|
|||
|
|
],
|
|||
|
|
"metadata": {
|
|||
|
|
"id": "fddGtWjKm_bY"
|
|||
|
|
},
|
|||
|
|
"execution_count": 15,
|
|||
|
|
"outputs": []
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"cell_type": "code",
|
|||
|
|
"source": [
|
|||
|
|
"def call(context):\n",
|
|||
|
|
" try:\n",
|
|||
|
|
" response = openai.Completion.create(\n",
|
|||
|
|
" api_key = \"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\",\n",
|
|||
|
|
" engine=\"text-davinci-003\",\n",
|
|||
|
|
" prompt=context,\n",
|
|||
|
|
" temperature=1,\n",
|
|||
|
|
" max_tokens=900,\n",
|
|||
|
|
" top_p=1,\n",
|
|||
|
|
" frequency_penalty=0,\n",
|
|||
|
|
" presence_penalty=0\n",
|
|||
|
|
" )\n",
|
|||
|
|
" return response['choices'][0]['text']\n",
|
|||
|
|
" except Exception as e:\n",
|
|||
|
|
" print (e)\n",
|
|||
|
|
" return \"\"\n",
|
|||
|
|
"\n",
|
|||
|
|
"print(call(context))"
|
|||
|
|
],
|
|||
|
|
"metadata": {
|
|||
|
|
"colab": {
|
|||
|
|
"base_uri": "https://localhost:8080/"
|
|||
|
|
},
|
|||
|
|
"id": "LmuD-v2zmrgh",
|
|||
|
|
"outputId": "2044b5a6-8326-4c75-c995-485d44b58532"
|
|||
|
|
},
|
|||
|
|
"execution_count": 16,
|
|||
|
|
"outputs": [
|
|||
|
|
{
|
|||
|
|
"output_type": "stream",
|
|||
|
|
"name": "stdout",
|
|||
|
|
"text": [
|
|||
|
|
"\n",
|
|||
|
|
"Team A should focus on maintaining possession of the ball and creating more chances on goal. They should try to create more opportunities on set pieces like with corners or free kicks, as this will increase their chances of scoring. Additionally, they could look to exploit any gaps in Team B’s defense and press forward in order to create more goal-scoring opportunities. Finally, they must be disciplined to avoid unnecessary yellow cards and reduce any extra pressure on the team.\n"
|
|||
|
|
]
|
|||
|
|
}
|
|||
|
|
]
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"cell_type": "code",
|
|||
|
|
"source": [
|
|||
|
|
"context_2 = '''\n",
|
|||
|
|
"Team A had a possession percentage of 60%, with a pass accuracy of 85%. They had a total of 10 shots on target, but only managed to score 1 goal. They were awarded 5 corners and 10 free kicks, and committed 15 fouls, resulting in 2 yellow cards and 1 red card. Their defense was solid, with 20 tackles and 8 interceptions, but they were caught offside 3 times. The goalkeeper made 5 saves and the team covered a total distance of 115 kilometers.\n",
|
|||
|
|
"\n",
|
|||
|
|
"Team B, on the other hand, had a possession percentage of 40%, with a pass accuracy of 75%. They had a total of 4 shots on target and managed to score 2 goals. They were awarded 3 corners and 7 free kicks, and committed 10 fouls, resulting in 1 yellow card. Their defense was not as strong, with only 12 tackles and 4 interceptions, but they were caught offside only once. The goalkeeper made 7 saves and the team covered a total distance of 108 kilometers.\n",
|
|||
|
|
"\n",
|
|||
|
|
"\n",
|
|||
|
|
"In this situation if Team A wants to win the match what they have to do?\n",
|
|||
|
|
"'''"
|
|||
|
|
],
|
|||
|
|
"metadata": {
|
|||
|
|
"id": "_hUmt0TTnYzv"
|
|||
|
|
},
|
|||
|
|
"execution_count": 17,
|
|||
|
|
"outputs": []
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"cell_type": "code",
|
|||
|
|
"source": [
|
|||
|
|
"print(call(context_2))"
|
|||
|
|
],
|
|||
|
|
"metadata": {
|
|||
|
|
"colab": {
|
|||
|
|
"base_uri": "https://localhost:8080/"
|
|||
|
|
},
|
|||
|
|
"id": "auecd8CjtBBD",
|
|||
|
|
"outputId": "53b30c57-8bcf-4eb9-974a-7f9c565fc2b6"
|
|||
|
|
},
|
|||
|
|
"execution_count": 18,
|
|||
|
|
"outputs": [
|
|||
|
|
{
|
|||
|
|
"output_type": "stream",
|
|||
|
|
"name": "stdout",
|
|||
|
|
"text": [
|
|||
|
|
"\n",
|
|||
|
|
"Team A needs to focus on maintaining their possession of the ball and utilizing their passes more effectively in order to create more scoring opportunities. They should also tighten up their defense and be aware of offsides so they can avoid giving the ball away. Additionally, they need to aim for more shots on target, as they only had 10 shots with 1 goal, and increase the pressure on their opponent to win the ball back. Finally, they should use their free kicks and corners to their advantage in order to increase their chances of scoring.\n"
|
|||
|
|
]
|
|||
|
|
}
|
|||
|
|
]
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"cell_type": "code",
|
|||
|
|
"source": [
|
|||
|
|
"context_3 = '''\n",
|
|||
|
|
"Team A had a possession percentage of 60%, with a pass accuracy of 85%. They had a total of 10 shots on target, but only managed to score 1 goal. They were awarded 5 corners and 10 free kicks, and committed 15 fouls, resulting in 2 yellow cards and 1 red card. Their defense was solid, with 20 tackles and 8 interceptions, but they were caught offside 3 times. The goalkeeper made 5 saves and the team covered a total distance of 115 kilometers.\n",
|
|||
|
|
"\n",
|
|||
|
|
"Team B, on the other hand, had a possession percentage of 40%, with a pass accuracy of 75%. They had a total of 4 shots on target and managed to score 2 goals. They were awarded 3 corners and 7 free kicks, and committed 10 fouls, resulting in 1 yellow card. Their defense was not as strong, with only 12 tackles and 4 interceptions, but they were caught offside only once. The goalkeeper made 7 saves and the team covered a total distance of 108 kilometers.\n",
|
|||
|
|
"\n",
|
|||
|
|
"Tean A is playsing 4-4-2\n",
|
|||
|
|
"Tean B is playing 3-4-1-2\n",
|
|||
|
|
"Question 1 : In this situation if Team A wants to win the match what they have to do?\n",
|
|||
|
|
"Question 2: Is the team A need to change their formation to win the match?\n",
|
|||
|
|
"'''"
|
|||
|
|
],
|
|||
|
|
"metadata": {
|
|||
|
|
"id": "KP_51QZatEjG"
|
|||
|
|
},
|
|||
|
|
"execution_count": 19,
|
|||
|
|
"outputs": []
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"cell_type": "code",
|
|||
|
|
"source": [
|
|||
|
|
"print(call(context_3))"
|
|||
|
|
],
|
|||
|
|
"metadata": {
|
|||
|
|
"colab": {
|
|||
|
|
"base_uri": "https://localhost:8080/"
|
|||
|
|
},
|
|||
|
|
"id": "rn_hvuBSuMsO",
|
|||
|
|
"outputId": "9ba2a5d4-eb11-4786-ecf8-059bc7dc7d31"
|
|||
|
|
},
|
|||
|
|
"execution_count": 20,
|
|||
|
|
"outputs": [
|
|||
|
|
{
|
|||
|
|
"output_type": "stream",
|
|||
|
|
"name": "stdout",
|
|||
|
|
"text": [
|
|||
|
|
"\n",
|
|||
|
|
"Answer 1: In this situation, Team A needs to focus on improving their offensive output, while also tightening up their defensive line and reducing their fouls and offsides. They can do this by making more accurate and strategic passes, shooting more shots on target, and taking fewer risks when challenging for the ball.\n",
|
|||
|
|
"\n",
|
|||
|
|
"Answer 2: No, Team A does not need to change their formation in order to win the match. Instead, they should focus on improving their offensive and defensive effectiveness, and ensuring they remain disciplined and organized on the field.\n"
|
|||
|
|
]
|
|||
|
|
}
|
|||
|
|
]
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"cell_type": "code",
|
|||
|
|
"source": [
|
|||
|
|
"data = {'Context': [\"Team A had 60% ball possession, 10 shots on target, 5 corners, and 2 yellow cards. Team B had 40% ball possession, 8 shots on target, 3 corners, and 3 yellow cards. Team A 2 goals and Team B 2 goals.If the team A wants to win the match what to do in stratygic way?\",\"Team A had a possession percentage of 60%, with a pass accuracy of 85%. They had a total of 10 shots on target, but only managed to score 1 goal. They were awarded 5 corners and 10 free kicks, and committed 15 fouls, resulting in 2 yellow cards and 1 red card. Their defense was solid, with 20 tackles and 8 interceptions, but they were caught offside 3 times. The goalkeeper made 5 saves and the team covered a total distance of 115 kilometers.Team B, on the other hand, had a possession percentage of 40%, with a pass accuracy of 75%. They had a total of 4 shots on target and managed to score 2 goals. They were awarded 3 corners and 7 free kicks, and committed 10 fouls, resulting in 1 yellow card. Their defense was not as strong, with only 12 tackles and 4 interceptions, but they were caught offside only once. The goalkeeper made 7 saves and the team covered a total distance of 108 kilometers.In this situation if Team A wants to win the match what they have to do?\",\"Team A had a possession percentage of 60%, with a pass accuracy of 85%. They had a total of 10 shots on target, but only managed to score 1 goal. They were awarded 5 corners and 10 free kicks, and committed 15 fouls, resulting in 2 yellow cards and 1 red card. Their defense was solid, with 20 tackles and 8 interceptions, but they were caught offside 3 times. The goalkeeper made 5 saves and the team covered a total distance of 115 kilometers.Team B, on the other hand, had a possession percentage of 40%, with a pass accuracy of 75%. They had a total of 4 shots on target and managed to score 2 goals. They were awarded 3 corners and 7 free kicks, and committed 10 fouls, resulting in 1 yellow card. Their defense was not as strong, with only 12 tackles and 4 interceptions, but they were caught offside only once. The goalkeeper made 7 saves and the team covered a total distance of 108 kilometers.Tean A is playsing 4-4-2 Tean B is playing 3-4-1-2 Question 1 : In this situation if Team A wants to win the match what they have to do? Question 2: Is the team A need to change their formation to win the match?\"] ,\n",
|
|||
|
|
" 'Result': [\"Team A should focus on maintaining possession of the ball and creating more chances on goal. They should try to create more opportunities on set pieces like with corners or free kicks, as this will increase their chances of scoring. Additionally, they could look to exploit any gaps in Team B’s defense and press forward in order to create more goal-scoring opportunities. Finally, they must be disciplined to avoid unnecessary yellow cards and reduce any extra pressure on the team.\",\"Team A needs to focus on maintaining their possession of the ball and utilizing their passes more effectively in order to create more scoring opportunities. They should also tighten up their defense and be aware of offsides so they can avoid giving the ball away. Additionally, they need to aim for more shots on target, as they only had 10 shots with 1 goal, and increase the pressure on their opponent to win the ball back. Finally, they should use their free kicks and corners to their advantage in order to increase their chances of scoring.\",\"Answer 1: In this situation, Team A needs to focus on improving their offensive output, while also tightening up their defensive line and reducing their fouls and offsides. They can do this by making more accurate and strategic passes, shooting more shots on target, and taking fewer risks when challenging for the ball.Answer 2: No, Team A does not need to change their formation in order to win the match. Instead, they should focus on improving their offensive and defensive effectiveness, and ensuring they remain disciplined and organized on the field.\"]}"
|
|||
|
|
],
|
|||
|
|
"metadata": {
|
|||
|
|
"id": "pJDX7iIOxwe2"
|
|||
|
|
},
|
|||
|
|
"execution_count": 30,
|
|||
|
|
"outputs": []
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"cell_type": "code",
|
|||
|
|
"source": [
|
|||
|
|
"import pandas as pd\n",
|
|||
|
|
"data_frame = pd.DataFrame(data)\n",
|
|||
|
|
"data_frame.head()"
|
|||
|
|
],
|
|||
|
|
"metadata": {
|
|||
|
|
"colab": {
|
|||
|
|
"base_uri": "https://localhost:8080/",
|
|||
|
|
"height": 143
|
|||
|
|
},
|
|||
|
|
"id": "alk4WD59ziBm",
|
|||
|
|
"outputId": "66f51d4c-d76f-46bf-a2b8-cd390aeb577c"
|
|||
|
|
},
|
|||
|
|
"execution_count": 31,
|
|||
|
|
"outputs": [
|
|||
|
|
{
|
|||
|
|
"output_type": "execute_result",
|
|||
|
|
"data": {
|
|||
|
|
"text/plain": [
|
|||
|
|
" Context \\\n",
|
|||
|
|
"0 Team A had 60% ball possession, 10 shots on ta... \n",
|
|||
|
|
"1 Team A had a possession percentage of 60%, wit... \n",
|
|||
|
|
"2 Team A had a possession percentage of 60%, wit... \n",
|
|||
|
|
"\n",
|
|||
|
|
" Result \n",
|
|||
|
|
"0 Team A should focus on maintaining possession ... \n",
|
|||
|
|
"1 Team A needs to focus on maintaining their pos... \n",
|
|||
|
|
"2 Answer 1: In this situation, Team A needs to f... "
|
|||
|
|
],
|
|||
|
|
"text/html": [
|
|||
|
|
"\n",
|
|||
|
|
" <div id=\"df-f64dc659-5dd8-47ab-9d4b-011b450b5201\">\n",
|
|||
|
|
" <div class=\"colab-df-container\">\n",
|
|||
|
|
" <div>\n",
|
|||
|
|
"<style scoped>\n",
|
|||
|
|
" .dataframe tbody tr th:only-of-type {\n",
|
|||
|
|
" vertical-align: middle;\n",
|
|||
|
|
" }\n",
|
|||
|
|
"\n",
|
|||
|
|
" .dataframe tbody tr th {\n",
|
|||
|
|
" vertical-align: top;\n",
|
|||
|
|
" }\n",
|
|||
|
|
"\n",
|
|||
|
|
" .dataframe thead th {\n",
|
|||
|
|
" text-align: right;\n",
|
|||
|
|
" }\n",
|
|||
|
|
"</style>\n",
|
|||
|
|
"<table border=\"1\" class=\"dataframe\">\n",
|
|||
|
|
" <thead>\n",
|
|||
|
|
" <tr style=\"text-align: right;\">\n",
|
|||
|
|
" <th></th>\n",
|
|||
|
|
" <th>Context</th>\n",
|
|||
|
|
" <th>Result</th>\n",
|
|||
|
|
" </tr>\n",
|
|||
|
|
" </thead>\n",
|
|||
|
|
" <tbody>\n",
|
|||
|
|
" <tr>\n",
|
|||
|
|
" <th>0</th>\n",
|
|||
|
|
" <td>Team A had 60% ball possession, 10 shots on ta...</td>\n",
|
|||
|
|
" <td>Team A should focus on maintaining possession ...</td>\n",
|
|||
|
|
" </tr>\n",
|
|||
|
|
" <tr>\n",
|
|||
|
|
" <th>1</th>\n",
|
|||
|
|
" <td>Team A had a possession percentage of 60%, wit...</td>\n",
|
|||
|
|
" <td>Team A needs to focus on maintaining their pos...</td>\n",
|
|||
|
|
" </tr>\n",
|
|||
|
|
" <tr>\n",
|
|||
|
|
" <th>2</th>\n",
|
|||
|
|
" <td>Team A had a possession percentage of 60%, wit...</td>\n",
|
|||
|
|
" <td>Answer 1: In this situation, Team A needs to f...</td>\n",
|
|||
|
|
" </tr>\n",
|
|||
|
|
" </tbody>\n",
|
|||
|
|
"</table>\n",
|
|||
|
|
"</div>\n",
|
|||
|
|
" <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-f64dc659-5dd8-47ab-9d4b-011b450b5201')\"\n",
|
|||
|
|
" title=\"Convert this dataframe to an interactive table.\"\n",
|
|||
|
|
" style=\"display:none;\">\n",
|
|||
|
|
" \n",
|
|||
|
|
" <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
|
|||
|
|
" width=\"24px\">\n",
|
|||
|
|
" <path d=\"M0 0h24v24H0V0z\" fill=\"none\"/>\n",
|
|||
|
|
" <path d=\"M18.56 5.44l.94 2.06.94-2.06 2.06-.94-2.06-.94-.94-2.06-.94 2.06-2.06.94zm-11 1L8.5 8.5l.94-2.06 2.06-.94-2.06-.94L8.5 2.5l-.94 2.06-2.06.94zm10 10l.94 2.06.94-2.06 2.06-.94-2.06-.94-.94-2.06-.94 2.06-2.06.94z\"/><path d=\"M17.41 7.96l-1.37-1.37c-.4-.4-.92-.59-1.43-.59-.52 0-1.04.2-1.43.59L10.3 9.45l-7.72 7.72c-.78.78-.78 2.05 0 2.83L4 21.41c.39.39.9.59 1.41.59.51 0 1.02-.2 1.41-.59l7.78-7.78 2.81-2.81c.8-.78.8-2.07 0-2.86zM5.41 20L4 18.59l7.72-7.72 1.47 1.35L5.41 20z\"/>\n",
|
|||
|
|
" </svg>\n",
|
|||
|
|
" </button>\n",
|
|||
|
|
" \n",
|
|||
|
|
" <style>\n",
|
|||
|
|
" .colab-df-container {\n",
|
|||
|
|
" display:flex;\n",
|
|||
|
|
" flex-wrap:wrap;\n",
|
|||
|
|
" gap: 12px;\n",
|
|||
|
|
" }\n",
|
|||
|
|
"\n",
|
|||
|
|
" .colab-df-convert {\n",
|
|||
|
|
" background-color: #E8F0FE;\n",
|
|||
|
|
" border: none;\n",
|
|||
|
|
" border-radius: 50%;\n",
|
|||
|
|
" cursor: pointer;\n",
|
|||
|
|
" display: none;\n",
|
|||
|
|
" fill: #1967D2;\n",
|
|||
|
|
" height: 32px;\n",
|
|||
|
|
" padding: 0 0 0 0;\n",
|
|||
|
|
" width: 32px;\n",
|
|||
|
|
" }\n",
|
|||
|
|
"\n",
|
|||
|
|
" .colab-df-convert:hover {\n",
|
|||
|
|
" background-color: #E2EBFA;\n",
|
|||
|
|
" box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
|
|||
|
|
" fill: #174EA6;\n",
|
|||
|
|
" }\n",
|
|||
|
|
"\n",
|
|||
|
|
" [theme=dark] .colab-df-convert {\n",
|
|||
|
|
" background-color: #3B4455;\n",
|
|||
|
|
" fill: #D2E3FC;\n",
|
|||
|
|
" }\n",
|
|||
|
|
"\n",
|
|||
|
|
" [theme=dark] .colab-df-convert:hover {\n",
|
|||
|
|
" background-color: #434B5C;\n",
|
|||
|
|
" box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
|
|||
|
|
" filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
|
|||
|
|
" fill: #FFFFFF;\n",
|
|||
|
|
" }\n",
|
|||
|
|
" </style>\n",
|
|||
|
|
"\n",
|
|||
|
|
" <script>\n",
|
|||
|
|
" const buttonEl =\n",
|
|||
|
|
" document.querySelector('#df-f64dc659-5dd8-47ab-9d4b-011b450b5201 button.colab-df-convert');\n",
|
|||
|
|
" buttonEl.style.display =\n",
|
|||
|
|
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
|
|||
|
|
"\n",
|
|||
|
|
" async function convertToInteractive(key) {\n",
|
|||
|
|
" const element = document.querySelector('#df-f64dc659-5dd8-47ab-9d4b-011b450b5201');\n",
|
|||
|
|
" const dataTable =\n",
|
|||
|
|
" await google.colab.kernel.invokeFunction('convertToInteractive',\n",
|
|||
|
|
" [key], {});\n",
|
|||
|
|
" if (!dataTable) return;\n",
|
|||
|
|
"\n",
|
|||
|
|
" const docLinkHtml = 'Like what you see? Visit the ' +\n",
|
|||
|
|
" '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
|
|||
|
|
" + ' to learn more about interactive tables.';\n",
|
|||
|
|
" element.innerHTML = '';\n",
|
|||
|
|
" dataTable['output_type'] = 'display_data';\n",
|
|||
|
|
" await google.colab.output.renderOutput(dataTable, element);\n",
|
|||
|
|
" const docLink = document.createElement('div');\n",
|
|||
|
|
" docLink.innerHTML = docLinkHtml;\n",
|
|||
|
|
" element.appendChild(docLink);\n",
|
|||
|
|
" }\n",
|
|||
|
|
" </script>\n",
|
|||
|
|
" </div>\n",
|
|||
|
|
" </div>\n",
|
|||
|
|
" "
|
|||
|
|
]
|
|||
|
|
},
|
|||
|
|
"metadata": {},
|
|||
|
|
"execution_count": 31
|
|||
|
|
}
|
|||
|
|
]
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"cell_type": "code",
|
|||
|
|
"source": [
|
|||
|
|
"data_frame['Result'].iloc[0]"
|
|||
|
|
],
|
|||
|
|
"metadata": {
|
|||
|
|
"colab": {
|
|||
|
|
"base_uri": "https://localhost:8080/",
|
|||
|
|
"height": 72
|
|||
|
|
},
|
|||
|
|
"id": "zv3b7vi9xQSf",
|
|||
|
|
"outputId": "c2290523-ac94-4670-8aa4-cfcfcb657ac3"
|
|||
|
|
},
|
|||
|
|
"execution_count": 32,
|
|||
|
|
"outputs": [
|
|||
|
|
{
|
|||
|
|
"output_type": "execute_result",
|
|||
|
|
"data": {
|
|||
|
|
"text/plain": [
|
|||
|
|
"'Team A should focus on maintaining possession of the ball and creating more chances on goal. They should try to create more opportunities on set pieces like with corners or free kicks, as this will increase their chances of scoring. Additionally, they could look to exploit any gaps in Team B’s defense and press forward in order to create more goal-scoring opportunities. Finally, they must be disciplined to avoid unnecessary yellow cards and reduce any extra pressure on the team.'"
|
|||
|
|
],
|
|||
|
|
"application/vnd.google.colaboratory.intrinsic+json": {
|
|||
|
|
"type": "string"
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
"metadata": {},
|
|||
|
|
"execution_count": 32
|
|||
|
|
}
|
|||
|
|
]
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"cell_type": "code",
|
|||
|
|
"source": [
|
|||
|
|
"data_frame['Result'].iloc[1]"
|
|||
|
|
],
|
|||
|
|
"metadata": {
|
|||
|
|
"colab": {
|
|||
|
|
"base_uri": "https://localhost:8080/",
|
|||
|
|
"height": 72
|
|||
|
|
},
|
|||
|
|
"id": "F5S13FxZ0AvO",
|
|||
|
|
"outputId": "c53058fe-35bd-45f2-d95e-da36a98b2ca1"
|
|||
|
|
},
|
|||
|
|
"execution_count": 33,
|
|||
|
|
"outputs": [
|
|||
|
|
{
|
|||
|
|
"output_type": "execute_result",
|
|||
|
|
"data": {
|
|||
|
|
"text/plain": [
|
|||
|
|
"'Team A needs to focus on maintaining their possession of the ball and utilizing their passes more effectively in order to create more scoring opportunities. They should also tighten up their defense and be aware of offsides so they can avoid giving the ball away. Additionally, they need to aim for more shots on target, as they only had 10 shots with 1 goal, and increase the pressure on their opponent to win the ball back. Finally, they should use their free kicks and corners to their advantage in order to increase their chances of scoring.'"
|
|||
|
|
],
|
|||
|
|
"application/vnd.google.colaboratory.intrinsic+json": {
|
|||
|
|
"type": "string"
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
"metadata": {},
|
|||
|
|
"execution_count": 33
|
|||
|
|
}
|
|||
|
|
]
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
"cell_type": "code",
|
|||
|
|
"source": [],
|
|||
|
|
"metadata": {
|
|||
|
|
"id": "AhhyXcz_8AmN"
|
|||
|
|
},
|
|||
|
|
"execution_count": null,
|
|||
|
|
"outputs": []
|
|||
|
|
}
|
|||
|
|
]
|
|||
|
|
}
|