{
"cells": [
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"import os\n",
"from rich import print\n",
"os.chdir(\"/home/p289731/NWO_FrameNet/Code/football-chains-viz\")"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
"from ast import literal_eval"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"
(39, 5)\n",
"
\n"
],
"text/plain": [
"\u001b[1m(\u001b[0m\u001b[1;36m39\u001b[0m, \u001b[1;36m5\u001b[0m\u001b[1m)\u001b[0m\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" frame | \n",
" changed_roles | \n",
" unchanged_roles | \n",
" roles | \n",
" changed_role | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" (0, 0, Draw, draw, NOUN) | \n",
" [Rangers] | \n",
" [(COMPETITION_STAGE, [from, a, tight, Anglo-Sc... | \n",
" [(COMPETITION_STAGE, [from, a, tight, Anglo-Sc... | \n",
" Changed Something | \n",
"
\n",
" \n",
" 1 | \n",
" (0, 1, Match, contest, NOUN) | \n",
" [] | \n",
" [(MATCH_LOCATION, [at, Old, Trafford]), (COMPE... | \n",
" [(MATCH_LOCATION, [at, Old, Trafford]), (COMPE... | \n",
" No Changed | \n",
"
\n",
" \n",
" 2 | \n",
" (1, 0, Competition, titleholders, NOUN) | \n",
" [] | \n",
" [(TEAM, [Scottish])] | \n",
" [(TEAM, [Scottish])] | \n",
" No Changed | \n",
"
\n",
" \n",
" 3 | \n",
" (1, 1, Concede_Goal, conceded, VERB) | \n",
" [Rangers] | \n",
" [(CONCEDING_TEAM, [they]), (GOAL, [more, goals])] | \n",
" [(CONCEDING_TEAM, [they]), (CONCEDING_TEAM, [W... | \n",
" Changed Something | \n",
"
\n",
" \n",
" 4 | \n",
" (1, 2, Competition_Stage, group, NOUN) | \n",
" [] | \n",
" [(COMPETITION, [UEFA, Champions, League])] | \n",
" [(COMPETITION, [UEFA, Champions, League])] | \n",
" No Changed | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" frame changed_roles \\\n",
"0 (0, 0, Draw, draw, NOUN) [Rangers] \n",
"1 (0, 1, Match, contest, NOUN) [] \n",
"2 (1, 0, Competition, titleholders, NOUN) [] \n",
"3 (1, 1, Concede_Goal, conceded, VERB) [Rangers] \n",
"4 (1, 2, Competition_Stage, group, NOUN) [] \n",
"\n",
" unchanged_roles \\\n",
"0 [(COMPETITION_STAGE, [from, a, tight, Anglo-Sc... \n",
"1 [(MATCH_LOCATION, [at, Old, Trafford]), (COMPE... \n",
"2 [(TEAM, [Scottish])] \n",
"3 [(CONCEDING_TEAM, [they]), (GOAL, [more, goals])] \n",
"4 [(COMPETITION, [UEFA, Champions, League])] \n",
"\n",
" roles changed_role \n",
"0 [(COMPETITION_STAGE, [from, a, tight, Anglo-Sc... Changed Something \n",
"1 [(MATCH_LOCATION, [at, Old, Trafford]), (COMPE... No Changed \n",
"2 [(TEAM, [Scottish])] No Changed \n",
"3 [(CONCEDING_TEAM, [they]), (CONCEDING_TEAM, [W... Changed Something \n",
"4 [(COMPETITION, [UEFA, Champions, League])] No Changed "
]
},
"execution_count": 21,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"data = pd.read_csv(\n",
" \"data/2002829_mapped_roles.csv\", index_col=0, \n",
" converters={\"frame\": literal_eval, \"changed_roles\": literal_eval, \"unchanged_roles\": literal_eval, \"roles\": literal_eval}\n",
" )\n",
"print(data.shape)\n",
"data.head()"
]
},
{
"cell_type": "code",
"execution_count": 30,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" sentence_idx | \n",
" frame_idx | \n",
" frame_name | \n",
" frame_target | \n",
" changed_roles | \n",
" roles | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" 0 | \n",
" 0 | \n",
" Draw | \n",
" draw | \n",
" [Rangers] | \n",
" [(COMPETITION_STAGE, [from, a, tight, Anglo-Sc... | \n",
"
\n",
" \n",
" 1 | \n",
" 0 | \n",
" 1 | \n",
" Match | \n",
" contest | \n",
" [] | \n",
" [(MATCH_LOCATION, [at, Old, Trafford]), (COMPE... | \n",
"
\n",
" \n",
" 2 | \n",
" 1 | \n",
" 0 | \n",
" Competition | \n",
" titleholders | \n",
" [] | \n",
" [(TEAM, [Scottish])] | \n",
"
\n",
" \n",
" 3 | \n",
" 1 | \n",
" 1 | \n",
" Concede_Goal | \n",
" conceded | \n",
" [Rangers] | \n",
" [(CONCEDING_TEAM, [they]), (CONCEDING_TEAM, [W... | \n",
"
\n",
" \n",
" 4 | \n",
" 1 | \n",
" 2 | \n",
" Competition_Stage | \n",
" group | \n",
" [] | \n",
" [(COMPETITION, [UEFA, Champions, League])] | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" sentence_idx frame_idx frame_name frame_target changed_roles \\\n",
"0 0 0 Draw draw [Rangers] \n",
"1 0 1 Match contest [] \n",
"2 1 0 Competition titleholders [] \n",
"3 1 1 Concede_Goal conceded [Rangers] \n",
"4 1 2 Competition_Stage group [] \n",
"\n",
" roles \n",
"0 [(COMPETITION_STAGE, [from, a, tight, Anglo-Sc... \n",
"1 [(MATCH_LOCATION, [at, Old, Trafford]), (COMPE... \n",
"2 [(TEAM, [Scottish])] \n",
"3 [(CONCEDING_TEAM, [they]), (CONCEDING_TEAM, [W... \n",
"4 [(COMPETITION, [UEFA, Champions, League])] "
]
},
"execution_count": 30,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# max_roles_per_frame = \n",
"data_ = (\n",
" data\n",
" .assign(sentence_idx=data[\"frame\"].apply(lambda frame: frame[0]))\n",
" .assign(frame_idx=data[\"frame\"].apply(lambda frame: frame[1]))\n",
" .assign(frame_name=data[\"frame\"].apply(lambda frame: frame[2]))\n",
" .assign(frame_target=data[\"frame\"].apply(lambda frame: frame[3]))\n",
" .drop(columns=[\"frame\"])\n",
")[[\"sentence_idx\", \"frame_idx\", \"frame_name\", \"frame_target\", \"changed_roles\", \"roles\"]]\n",
"data_.head()\n"
]
},
{
"cell_type": "code",
"execution_count": 38,
"metadata": {},
"outputs": [],
"source": [
"max_sent = max(data_[\"sentence_idx\"])\n",
"max_frame_per_sent = data_.groupby(\"sentence_idx\").agg({\"frame_idx\": max}).reset_index()\n",
"sent_to_max_frame = dict(zip(max_frame_per_sent[\"sentence_idx\"], max_frame_per_sent[\"frame_idx\"]))"
]
},
{
"cell_type": "code",
"execution_count": 64,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" sentence_idx | \n",
" frame_idx | \n",
" frame_name | \n",
" frame_target | \n",
" changed_roles | \n",
" roles | \n",
" time_point | \n",
" first_role | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" 0 | \n",
" 0 | \n",
" Draw | \n",
" draw | \n",
" [Rangers] | \n",
" [(COMPETITION_STAGE, [from, a, tight, Anglo-Sc... | \n",
" 0.000000 | \n",
" Rangers | \n",
"
\n",
" \n",
" 3 | \n",
" 1 | \n",
" 1 | \n",
" Concede_Goal | \n",
" conceded | \n",
" [Rangers] | \n",
" [(CONCEDING_TEAM, [they]), (CONCEDING_TEAM, [W... | \n",
" 0.187500 | \n",
" Rangers | \n",
"
\n",
" \n",
" 5 | \n",
" 1 | \n",
" 3 | \n",
" Bring_Off | \n",
" return | \n",
" [Man. United] | \n",
" [(SUBSTITUTED_PLAYER, [Antonio, Valencia]), (T... | \n",
" 0.229167 | \n",
" Man. United | \n",
"
\n",
" \n",
" 6 | \n",
" 1 | \n",
" 6 | \n",
" Bring_Off | \n",
" departing | \n",
" [Man. United] | \n",
" [(SUBSTITUTED_PLAYER, [Antonio, Valencia])] | \n",
" 0.291667 | \n",
" Man. United | \n",
"
\n",
" \n",
" 11 | \n",
" 2 | \n",
" 3 | \n",
" Victory | \n",
" triumph | \n",
" [Man. United] | \n",
" [(MATCH_LOCATION, [at, Leeds, United, AFC])] | \n",
" 0.433333 | \n",
" Man. United | \n",
"
\n",
" \n",
" 12 | \n",
" 2 | \n",
" 4 | \n",
" Deploy | \n",
" fielding | \n",
" [Rangers] | \n",
" [(COACH, [his]), (PLAYER, [of, three, central,... | \n",
" 0.466667 | \n",
" Rangers | \n",
"
\n",
" \n",
" 13 | \n",
" 2 | \n",
" 5 | \n",
" Player | \n",
" full-backs | \n",
" [Rangers] | \n",
" [(PLAYER, [Steven, Whittaker, and, Kirk, Broad... | \n",
" 0.500000 | \n",
" Rangers | \n",
"
\n",
" \n",
" 14 | \n",
" 3 | \n",
" 1 | \n",
" Draw | \n",
" draw | \n",
" [Man. United] | \n",
" [(TEAM1, [United, 's]), (MATCH_LOCATION, [at, ... | \n",
" 0.523810 | \n",
" Man. United | \n",
"
\n",
" \n",
" 15 | \n",
" 3 | \n",
" 2 | \n",
" Shot | \n",
" nod | \n",
" [Man. United] | \n",
" [(MOVING_BALL, [Fabio, 's, right-wing, cross])... | \n",
" 0.547619 | \n",
" Man. United | \n",
"
\n",
" \n",
" 16 | \n",
" 3 | \n",
" 3 | \n",
" Pass | \n",
" cross | \n",
" [Man. United] | \n",
" [(TARGET, [right-wing]), (PASSER, [Fabio, 's])] | \n",
" 0.571429 | \n",
" Man. United | \n",
"
\n",
" \n",
" 18 | \n",
" 3 | \n",
" 5 | \n",
" One_On_One | \n",
" two-on-one | \n",
" [Man. United, Rangers, Man. United] | \n",
" [(MOVING_BALL, [Fabio, 's, right-wing, cross])... | \n",
" 0.619048 | \n",
" Man. United | \n",
"
\n",
" \n",
" 20 | \n",
" 3 | \n",
" 7 | \n",
" Intervene | \n",
" avert | \n",
" [Rangers] | \n",
" [(SHOT, [the, threat]), (INTERVENING_PLAYER, [... | \n",
" 0.666667 | \n",
" Rangers | \n",
"
\n",
" \n",
" 25 | \n",
" 4 | \n",
" 7 | \n",
" Being_Free | \n",
" isolated | \n",
" [Rangers] | \n",
" [(RECIPIENT, [Kenny, Miller])] | \n",
" 0.796296 | \n",
" Rangers | \n",
"
\n",
" \n",
" 26 | \n",
" 4 | \n",
" 9 | \n",
" Team | \n",
" defence | \n",
" [Man. United] | \n",
" [(TEAM, [United, 's])] | \n",
" 0.833333 | \n",
" Man. United | \n",
"
\n",
" \n",
" 27 | \n",
" 5 | \n",
" 0 | \n",
" Control | \n",
" got | \n",
" [Rangers, Man. United, Rangers] | \n",
" [(RECIPIENT, [Kirk, Broadfoot]), (RECIPIENT, [... | \n",
" 0.833333 | \n",
" Rangers | \n",
"
\n",
" \n",
" 28 | \n",
" 5 | \n",
" 1 | \n",
" Pass | \n",
" cross | \n",
" [Rangers] | \n",
" [(PASSER, [Steven, Naismith])] | \n",
" 0.846154 | \n",
" Rangers | \n",
"
\n",
" \n",
" 30 | \n",
" 5 | \n",
" 3 | \n",
" Challenge | \n",
" challenge | \n",
" [Man. United] | \n",
" [(OPPONENT_PLAYER, [Smalling])] | \n",
" 0.871795 | \n",
" Man. United | \n",
"
\n",
" \n",
" 31 | \n",
" 5 | \n",
" 4 | \n",
" Field | \n",
" edge | \n",
" [Man. United] | \n",
" [(TEAM, [United])] | \n",
" 0.884615 | \n",
" Man. United | \n",
"
\n",
" \n",
" 33 | \n",
" 5 | \n",
" 6 | \n",
" Control | \n",
" latching | \n",
" [Rangers] | \n",
" [(RECIPIENT, [Kirk, Broadfoot])] | \n",
" 0.910256 | \n",
" Rangers | \n",
"
\n",
" \n",
" 34 | \n",
" 5 | \n",
" 7 | \n",
" Shot | \n",
" lofted | \n",
" [Man. United] | \n",
" [(TARGET, [over, the, top]), (SHOOTER, [Ryan, ... | \n",
" 0.923077 | \n",
" Man. United | \n",
"
\n",
" \n",
" 35 | \n",
" 5 | \n",
" 8 | \n",
" Pass | \n",
" ball | \n",
" [Man. United] | \n",
" [(TARGET, [over, the, top]), (PASSER, [Ryan, G... | \n",
" 0.935897 | \n",
" Man. United | \n",
"
\n",
" \n",
" 36 | \n",
" 5 | \n",
" 10 | \n",
" Shot_Supports | \n",
" shot | \n",
" [Man. United] | \n",
" [(SHOOTER, [Gibson])] | \n",
" 0.961538 | \n",
" Man. United | \n",
"
\n",
" \n",
" 37 | \n",
" 5 | \n",
" 11 | \n",
" Shot | \n",
" whisker | \n",
" [Man. United] | \n",
" [(TARGET, [over]), (SHOOTER, [Gibson])] | \n",
" 0.974359 | \n",
" Man. United | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" sentence_idx frame_idx frame_name frame_target \\\n",
"0 0 0 Draw draw \n",
"3 1 1 Concede_Goal conceded \n",
"5 1 3 Bring_Off return \n",
"6 1 6 Bring_Off departing \n",
"11 2 3 Victory triumph \n",
"12 2 4 Deploy fielding \n",
"13 2 5 Player full-backs \n",
"14 3 1 Draw draw \n",
"15 3 2 Shot nod \n",
"16 3 3 Pass cross \n",
"18 3 5 One_On_One two-on-one \n",
"20 3 7 Intervene avert \n",
"25 4 7 Being_Free isolated \n",
"26 4 9 Team defence \n",
"27 5 0 Control got \n",
"28 5 1 Pass cross \n",
"30 5 3 Challenge challenge \n",
"31 5 4 Field edge \n",
"33 5 6 Control latching \n",
"34 5 7 Shot lofted \n",
"35 5 8 Pass ball \n",
"36 5 10 Shot_Supports shot \n",
"37 5 11 Shot whisker \n",
"\n",
" changed_roles \\\n",
"0 [Rangers] \n",
"3 [Rangers] \n",
"5 [Man. United] \n",
"6 [Man. United] \n",
"11 [Man. United] \n",
"12 [Rangers] \n",
"13 [Rangers] \n",
"14 [Man. United] \n",
"15 [Man. United] \n",
"16 [Man. United] \n",
"18 [Man. United, Rangers, Man. United] \n",
"20 [Rangers] \n",
"25 [Rangers] \n",
"26 [Man. United] \n",
"27 [Rangers, Man. United, Rangers] \n",
"28 [Rangers] \n",
"30 [Man. United] \n",
"31 [Man. United] \n",
"33 [Rangers] \n",
"34 [Man. United] \n",
"35 [Man. United] \n",
"36 [Man. United] \n",
"37 [Man. United] \n",
"\n",
" roles time_point first_role \n",
"0 [(COMPETITION_STAGE, [from, a, tight, Anglo-Sc... 0.000000 Rangers \n",
"3 [(CONCEDING_TEAM, [they]), (CONCEDING_TEAM, [W... 0.187500 Rangers \n",
"5 [(SUBSTITUTED_PLAYER, [Antonio, Valencia]), (T... 0.229167 Man. United \n",
"6 [(SUBSTITUTED_PLAYER, [Antonio, Valencia])] 0.291667 Man. United \n",
"11 [(MATCH_LOCATION, [at, Leeds, United, AFC])] 0.433333 Man. United \n",
"12 [(COACH, [his]), (PLAYER, [of, three, central,... 0.466667 Rangers \n",
"13 [(PLAYER, [Steven, Whittaker, and, Kirk, Broad... 0.500000 Rangers \n",
"14 [(TEAM1, [United, 's]), (MATCH_LOCATION, [at, ... 0.523810 Man. United \n",
"15 [(MOVING_BALL, [Fabio, 's, right-wing, cross])... 0.547619 Man. United \n",
"16 [(TARGET, [right-wing]), (PASSER, [Fabio, 's])] 0.571429 Man. United \n",
"18 [(MOVING_BALL, [Fabio, 's, right-wing, cross])... 0.619048 Man. United \n",
"20 [(SHOT, [the, threat]), (INTERVENING_PLAYER, [... 0.666667 Rangers \n",
"25 [(RECIPIENT, [Kenny, Miller])] 0.796296 Rangers \n",
"26 [(TEAM, [United, 's])] 0.833333 Man. United \n",
"27 [(RECIPIENT, [Kirk, Broadfoot]), (RECIPIENT, [... 0.833333 Rangers \n",
"28 [(PASSER, [Steven, Naismith])] 0.846154 Rangers \n",
"30 [(OPPONENT_PLAYER, [Smalling])] 0.871795 Man. United \n",
"31 [(TEAM, [United])] 0.884615 Man. United \n",
"33 [(RECIPIENT, [Kirk, Broadfoot])] 0.910256 Rangers \n",
"34 [(TARGET, [over, the, top]), (SHOOTER, [Ryan, ... 0.923077 Man. United \n",
"35 [(TARGET, [over, the, top]), (PASSER, [Ryan, G... 0.935897 Man. United \n",
"36 [(SHOOTER, [Gibson])] 0.961538 Man. United \n",
"37 [(TARGET, [over]), (SHOOTER, [Gibson])] 0.974359 Man. United "
]
},
"execution_count": 64,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"data_with_time = data_.assign(\n",
" time_point= (data_\n",
" .apply(lambda row: (row[\"sentence_idx\"] + row[\"frame_idx\"] / (sent_to_max_frame[row[\"sentence_idx\"]])) / (max_sent + 1), axis=1)\n",
" )\n",
")\n",
"\n",
"\n",
"data_with_first_roles = data_with_time.assign(\n",
" first_role = data_with_time[\"changed_roles\"].apply(lambda roles: roles[0] if len(roles) > 0 else None)\n",
")\n",
"\n",
"data_with_first_roles.dropna(axis=0, subset=[\"first_role\"])"
]
},
{
"cell_type": "code",
"execution_count": 66,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Man. United 14\n",
"Rangers 9\n",
"Name: first_role, dtype: int64"
]
},
"execution_count": 66,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"data_with_first_roles.dropna(axis=0, subset=[\"first_role\"])[\"first_role\"].value_counts()"
]
},
{
"cell_type": "code",
"execution_count": 81,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" sentence_idx | \n",
" frame_idx | \n",
" frame_name | \n",
" frame_target | \n",
" changed_roles | \n",
" roles | \n",
" time_point | \n",
" first_role | \n",
"
\n",
" \n",
" \n",
" \n",
" 5 | \n",
" 1 | \n",
" 3 | \n",
" Bring_Off | \n",
" return | \n",
" [Man. United] | \n",
" [(SUBSTITUTED_PLAYER, [Antonio, Valencia]), (T... | \n",
" 0.229167 | \n",
" Man. United | \n",
"
\n",
" \n",
" 6 | \n",
" 1 | \n",
" 6 | \n",
" Bring_Off | \n",
" departing | \n",
" [Man. United] | \n",
" [(SUBSTITUTED_PLAYER, [Antonio, Valencia])] | \n",
" 0.291667 | \n",
" Man. United | \n",
"
\n",
" \n",
" 11 | \n",
" 2 | \n",
" 3 | \n",
" Victory | \n",
" triumph | \n",
" [Man. United] | \n",
" [(MATCH_LOCATION, [at, Leeds, United, AFC])] | \n",
" 0.433333 | \n",
" Man. United | \n",
"
\n",
" \n",
" 14 | \n",
" 3 | \n",
" 1 | \n",
" Draw | \n",
" draw | \n",
" [Man. United] | \n",
" [(TEAM1, [United, 's]), (MATCH_LOCATION, [at, ... | \n",
" 0.523810 | \n",
" Man. United | \n",
"
\n",
" \n",
" 15 | \n",
" 3 | \n",
" 2 | \n",
" Shot | \n",
" nod | \n",
" [Man. United] | \n",
" [(MOVING_BALL, [Fabio, 's, right-wing, cross])... | \n",
" 0.547619 | \n",
" Man. United | \n",
"
\n",
" \n",
" 16 | \n",
" 3 | \n",
" 3 | \n",
" Pass | \n",
" cross | \n",
" [Man. United] | \n",
" [(TARGET, [right-wing]), (PASSER, [Fabio, 's])] | \n",
" 0.571429 | \n",
" Man. United | \n",
"
\n",
" \n",
" 18 | \n",
" 3 | \n",
" 5 | \n",
" One_On_One | \n",
" two-on-one | \n",
" [Man. United, Rangers, Man. United] | \n",
" [(MOVING_BALL, [Fabio, 's, right-wing, cross])... | \n",
" 0.619048 | \n",
" Man. United | \n",
"
\n",
" \n",
" 26 | \n",
" 4 | \n",
" 9 | \n",
" Team | \n",
" defence | \n",
" [Man. United] | \n",
" [(TEAM, [United, 's])] | \n",
" 0.833333 | \n",
" Man. United | \n",
"
\n",
" \n",
" 30 | \n",
" 5 | \n",
" 3 | \n",
" Challenge | \n",
" challenge | \n",
" [Man. United] | \n",
" [(OPPONENT_PLAYER, [Smalling])] | \n",
" 0.871795 | \n",
" Man. United | \n",
"
\n",
" \n",
" 31 | \n",
" 5 | \n",
" 4 | \n",
" Field | \n",
" edge | \n",
" [Man. United] | \n",
" [(TEAM, [United])] | \n",
" 0.884615 | \n",
" Man. United | \n",
"
\n",
" \n",
" 34 | \n",
" 5 | \n",
" 7 | \n",
" Shot | \n",
" lofted | \n",
" [Man. United] | \n",
" [(TARGET, [over, the, top]), (SHOOTER, [Ryan, ... | \n",
" 0.923077 | \n",
" Man. United | \n",
"
\n",
" \n",
" 35 | \n",
" 5 | \n",
" 8 | \n",
" Pass | \n",
" ball | \n",
" [Man. United] | \n",
" [(TARGET, [over, the, top]), (PASSER, [Ryan, G... | \n",
" 0.935897 | \n",
" Man. United | \n",
"
\n",
" \n",
" 36 | \n",
" 5 | \n",
" 10 | \n",
" Shot_Supports | \n",
" shot | \n",
" [Man. United] | \n",
" [(SHOOTER, [Gibson])] | \n",
" 0.961538 | \n",
" Man. United | \n",
"
\n",
" \n",
" 37 | \n",
" 5 | \n",
" 11 | \n",
" Shot | \n",
" whisker | \n",
" [Man. United] | \n",
" [(TARGET, [over]), (SHOOTER, [Gibson])] | \n",
" 0.974359 | \n",
" Man. United | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" sentence_idx frame_idx frame_name frame_target \\\n",
"5 1 3 Bring_Off return \n",
"6 1 6 Bring_Off departing \n",
"11 2 3 Victory triumph \n",
"14 3 1 Draw draw \n",
"15 3 2 Shot nod \n",
"16 3 3 Pass cross \n",
"18 3 5 One_On_One two-on-one \n",
"26 4 9 Team defence \n",
"30 5 3 Challenge challenge \n",
"31 5 4 Field edge \n",
"34 5 7 Shot lofted \n",
"35 5 8 Pass ball \n",
"36 5 10 Shot_Supports shot \n",
"37 5 11 Shot whisker \n",
"\n",
" changed_roles \\\n",
"5 [Man. United] \n",
"6 [Man. United] \n",
"11 [Man. United] \n",
"14 [Man. United] \n",
"15 [Man. United] \n",
"16 [Man. United] \n",
"18 [Man. United, Rangers, Man. United] \n",
"26 [Man. United] \n",
"30 [Man. United] \n",
"31 [Man. United] \n",
"34 [Man. United] \n",
"35 [Man. United] \n",
"36 [Man. United] \n",
"37 [Man. United] \n",
"\n",
" roles time_point first_role \n",
"5 [(SUBSTITUTED_PLAYER, [Antonio, Valencia]), (T... 0.229167 Man. United \n",
"6 [(SUBSTITUTED_PLAYER, [Antonio, Valencia])] 0.291667 Man. United \n",
"11 [(MATCH_LOCATION, [at, Leeds, United, AFC])] 0.433333 Man. United \n",
"14 [(TEAM1, [United, 's]), (MATCH_LOCATION, [at, ... 0.523810 Man. United \n",
"15 [(MOVING_BALL, [Fabio, 's, right-wing, cross])... 0.547619 Man. United \n",
"16 [(TARGET, [right-wing]), (PASSER, [Fabio, 's])] 0.571429 Man. United \n",
"18 [(MOVING_BALL, [Fabio, 's, right-wing, cross])... 0.619048 Man. United \n",
"26 [(TEAM, [United, 's])] 0.833333 Man. United \n",
"30 [(OPPONENT_PLAYER, [Smalling])] 0.871795 Man. United \n",
"31 [(TEAM, [United])] 0.884615 Man. United \n",
"34 [(TARGET, [over, the, top]), (SHOOTER, [Ryan, ... 0.923077 Man. United \n",
"35 [(TARGET, [over, the, top]), (PASSER, [Ryan, G... 0.935897 Man. United \n",
"36 [(SHOOTER, [Gibson])] 0.961538 Man. United \n",
"37 [(TARGET, [over]), (SHOOTER, [Gibson])] 0.974359 Man. United "
]
},
"execution_count": 81,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"data_with_first_roles[data_with_first_roles[\"first_role\"] == \"Man. United\"]"
]
},
{
"cell_type": "code",
"execution_count": 79,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"{\n",
" 'Intervene': 'Shot',\n",
" 'Challenge': 'One_On_One',\n",
" 'Award_Goal': 'Goal',\n",
" 'Deny': 'One_On_One',\n",
" 'Intercept': 'Pass',\n",
" 'Shot_Supports': 'Shot',\n",
" 'Save': 'Shot',\n",
" 'Pass': 'Pass',\n",
" 'Ball_Bounce': 'Motion',\n",
" 'Mark': 'Pass',\n",
" 'Goal_Kickoff': 'Shot',\n",
" 'Finish': 'Shot',\n",
" 'Beat': 'One_On_One',\n",
" 'Offside': 'Foul',\n",
" 'Bad_Pass': 'Pass',\n",
" 'Goal': 'Goal',\n",
" 'Set_Piece': 'Foul',\n",
" 'Shot': 'Shot',\n",
" 'Player_Move_With_Ball': 'Motion',\n",
" 'Sanction': 'Foul',\n",
" 'Move': 'Move',\n",
" 'Control': 'Pass',\n",
" 'Shoot_At': 'Shot',\n",
" 'Start_End_Match': 'Match',\n",
" 'Match': 'Match',\n",
" 'Deploy': 'Lineup',\n",
" 'Start': 'Lineup',\n",
" 'Player_Move': 'Motion',\n",
" 'Elimination': 'Match',\n",
" 'Result': 'Match',\n",
" 'Bring_Off': 'Substitution',\n",
" 'Away_Game': 'Match',\n",
" 'Possession': 'State_Of_Match',\n",
" 'Pass_Combination': 'Pass',\n",
" 'Lose_Ball': 'One_On_One',\n",
" 'Defense_Shot': 'Mix-Up',\n",
" 'Receive_Card': 'Foul',\n",
" 'Victory': 'Match',\n",
" 'Supply_Pass': 'Pass',\n",
" 'Bring_On': 'Substitution',\n",
" 'Chance': 'Chance',\n",
" 'Multiple_Goals': 'Goal',\n",
" 'One_On_One': 'One_On_One',\n",
" 'Substitute': 'Substitution',\n",
" 'Own_Goal': 'Goal',\n",
" 'Convert_Chance': 'Goal',\n",
" 'Ball_Land': 'Motion',\n",
" 'Progression': 'Match',\n",
" 'Home_Game': 'Match',\n",
" 'Referee_Decision': 'Foul',\n",
" 'Concede_Goal': 'Goal',\n",
" 'Mistake': 'Mix-Up',\n",
" 'Tactics': 'State_Of_Match',\n",
" 'Foul': 'Foul',\n",
" 'Being_Free': 'Pass',\n",
" 'Lead': 'State_Of_Match',\n",
" 'Create_Chance': 'Chance',\n",
" 'Win_Compensation': 'Foul',\n",
" 'Trail': 'State_Of_Match',\n",
" 'Ball_Move': 'Motion',\n",
" 'Defeat': 'Match',\n",
" 'Dissent': 'Foul',\n",
" 'Follow_Up': 'Shot',\n",
" 'Score': 'State_Of_Match',\n",
" 'Draw': 'Match',\n",
" 'Pass_Back': 'Pass',\n",
" 'Simulation': 'Foul',\n",
" 'Miss_Goal': 'Shot',\n",
" 'Miss_Chance': 'Chance',\n",
" 'Flick_On': 'Pass',\n",
" 'Ball_Escape': 'Motion',\n",
" 'Give_Card': 'Foul',\n",
" 'Take_On': 'One_On_One',\n",
" 'Connect': 'Pass',\n",
" 'Goalkeeper_Advance': 'Motion',\n",
" 'Hit': 'Shot',\n",
" 'Advantage': 'Foul',\n",
" 'Feign': 'Shot',\n",
" 'Overcome_Goalkeeper': 'Goal',\n",
" 'Prepare_Goal': 'Goal',\n",
" 'Ball': 'Actors',\n",
" 'Spectator_Activity': 'State_Of_Match',\n",
" 'Goal_Target': 'Field',\n",
" 'Player': 'Actors',\n",
" 'Referee': 'Actors',\n",
" 'Field': 'Field',\n",
" 'Team': 'Actors',\n",
" 'Bench': 'Field',\n",
" 'Coach': 'Actors',\n",
" 'Concede_Compensation': 'Foul',\n",
" 'Match_Temporal_Subdivision': 'Match',\n",
" 'Confusion': 'Mix-up',\n",
" 'Score_Goal': 'Goal',\n",
" 'Celebrate_Goal': 'Goal',\n",
" 'Suspension': 'Lineup',\n",
" 'Spectators': 'Actors',\n",
" 'Competition_Stage': 'Competition',\n",
" 'Body_Parts': 'Actors',\n",
" 'Trick': 'One_On_One',\n",
" 'Competition': 'Competition',\n",
" 'Stadium': 'Field',\n",
" 'Match_Quality': 'State_Of_Match',\n",
" 'Ball_And_Goal': 'Shot',\n",
" 'Equipment': 'Actors',\n",
" 'Injuries': 'Foul',\n",
" 'Shot_Quality': 'Shot'\n",
"}\n",
"
\n"
],
"text/plain": [
"\u001b[1m{\u001b[0m\n",
" \u001b[32m'Intervene'\u001b[0m: \u001b[32m'Shot'\u001b[0m,\n",
" \u001b[32m'Challenge'\u001b[0m: \u001b[32m'One_On_One'\u001b[0m,\n",
" \u001b[32m'Award_Goal'\u001b[0m: \u001b[32m'Goal'\u001b[0m,\n",
" \u001b[32m'Deny'\u001b[0m: \u001b[32m'One_On_One'\u001b[0m,\n",
" \u001b[32m'Intercept'\u001b[0m: \u001b[32m'Pass'\u001b[0m,\n",
" \u001b[32m'Shot_Supports'\u001b[0m: \u001b[32m'Shot'\u001b[0m,\n",
" \u001b[32m'Save'\u001b[0m: \u001b[32m'Shot'\u001b[0m,\n",
" \u001b[32m'Pass'\u001b[0m: \u001b[32m'Pass'\u001b[0m,\n",
" \u001b[32m'Ball_Bounce'\u001b[0m: \u001b[32m'Motion'\u001b[0m,\n",
" \u001b[32m'Mark'\u001b[0m: \u001b[32m'Pass'\u001b[0m,\n",
" \u001b[32m'Goal_Kickoff'\u001b[0m: \u001b[32m'Shot'\u001b[0m,\n",
" \u001b[32m'Finish'\u001b[0m: \u001b[32m'Shot'\u001b[0m,\n",
" \u001b[32m'Beat'\u001b[0m: \u001b[32m'One_On_One'\u001b[0m,\n",
" \u001b[32m'Offside'\u001b[0m: \u001b[32m'Foul'\u001b[0m,\n",
" \u001b[32m'Bad_Pass'\u001b[0m: \u001b[32m'Pass'\u001b[0m,\n",
" \u001b[32m'Goal'\u001b[0m: \u001b[32m'Goal'\u001b[0m,\n",
" \u001b[32m'Set_Piece'\u001b[0m: \u001b[32m'Foul'\u001b[0m,\n",
" \u001b[32m'Shot'\u001b[0m: \u001b[32m'Shot'\u001b[0m,\n",
" \u001b[32m'Player_Move_With_Ball'\u001b[0m: \u001b[32m'Motion'\u001b[0m,\n",
" \u001b[32m'Sanction'\u001b[0m: \u001b[32m'Foul'\u001b[0m,\n",
" \u001b[32m'Move'\u001b[0m: \u001b[32m'Move'\u001b[0m,\n",
" \u001b[32m'Control'\u001b[0m: \u001b[32m'Pass'\u001b[0m,\n",
" \u001b[32m'Shoot_At'\u001b[0m: \u001b[32m'Shot'\u001b[0m,\n",
" \u001b[32m'Start_End_Match'\u001b[0m: \u001b[32m'Match'\u001b[0m,\n",
" \u001b[32m'Match'\u001b[0m: \u001b[32m'Match'\u001b[0m,\n",
" \u001b[32m'Deploy'\u001b[0m: \u001b[32m'Lineup'\u001b[0m,\n",
" \u001b[32m'Start'\u001b[0m: \u001b[32m'Lineup'\u001b[0m,\n",
" \u001b[32m'Player_Move'\u001b[0m: \u001b[32m'Motion'\u001b[0m,\n",
" \u001b[32m'Elimination'\u001b[0m: \u001b[32m'Match'\u001b[0m,\n",
" \u001b[32m'Result'\u001b[0m: \u001b[32m'Match'\u001b[0m,\n",
" \u001b[32m'Bring_Off'\u001b[0m: \u001b[32m'Substitution'\u001b[0m,\n",
" \u001b[32m'Away_Game'\u001b[0m: \u001b[32m'Match'\u001b[0m,\n",
" \u001b[32m'Possession'\u001b[0m: \u001b[32m'State_Of_Match'\u001b[0m,\n",
" \u001b[32m'Pass_Combination'\u001b[0m: \u001b[32m'Pass'\u001b[0m,\n",
" \u001b[32m'Lose_Ball'\u001b[0m: \u001b[32m'One_On_One'\u001b[0m,\n",
" \u001b[32m'Defense_Shot'\u001b[0m: \u001b[32m'Mix-Up'\u001b[0m,\n",
" \u001b[32m'Receive_Card'\u001b[0m: \u001b[32m'Foul'\u001b[0m,\n",
" \u001b[32m'Victory'\u001b[0m: \u001b[32m'Match'\u001b[0m,\n",
" \u001b[32m'Supply_Pass'\u001b[0m: \u001b[32m'Pass'\u001b[0m,\n",
" \u001b[32m'Bring_On'\u001b[0m: \u001b[32m'Substitution'\u001b[0m,\n",
" \u001b[32m'Chance'\u001b[0m: \u001b[32m'Chance'\u001b[0m,\n",
" \u001b[32m'Multiple_Goals'\u001b[0m: \u001b[32m'Goal'\u001b[0m,\n",
" \u001b[32m'One_On_One'\u001b[0m: \u001b[32m'One_On_One'\u001b[0m,\n",
" \u001b[32m'Substitute'\u001b[0m: \u001b[32m'Substitution'\u001b[0m,\n",
" \u001b[32m'Own_Goal'\u001b[0m: \u001b[32m'Goal'\u001b[0m,\n",
" \u001b[32m'Convert_Chance'\u001b[0m: \u001b[32m'Goal'\u001b[0m,\n",
" \u001b[32m'Ball_Land'\u001b[0m: \u001b[32m'Motion'\u001b[0m,\n",
" \u001b[32m'Progression'\u001b[0m: \u001b[32m'Match'\u001b[0m,\n",
" \u001b[32m'Home_Game'\u001b[0m: \u001b[32m'Match'\u001b[0m,\n",
" \u001b[32m'Referee_Decision'\u001b[0m: \u001b[32m'Foul'\u001b[0m,\n",
" \u001b[32m'Concede_Goal'\u001b[0m: \u001b[32m'Goal'\u001b[0m,\n",
" \u001b[32m'Mistake'\u001b[0m: \u001b[32m'Mix-Up'\u001b[0m,\n",
" \u001b[32m'Tactics'\u001b[0m: \u001b[32m'State_Of_Match'\u001b[0m,\n",
" \u001b[32m'Foul'\u001b[0m: \u001b[32m'Foul'\u001b[0m,\n",
" \u001b[32m'Being_Free'\u001b[0m: \u001b[32m'Pass'\u001b[0m,\n",
" \u001b[32m'Lead'\u001b[0m: \u001b[32m'State_Of_Match'\u001b[0m,\n",
" \u001b[32m'Create_Chance'\u001b[0m: \u001b[32m'Chance'\u001b[0m,\n",
" \u001b[32m'Win_Compensation'\u001b[0m: \u001b[32m'Foul'\u001b[0m,\n",
" \u001b[32m'Trail'\u001b[0m: \u001b[32m'State_Of_Match'\u001b[0m,\n",
" \u001b[32m'Ball_Move'\u001b[0m: \u001b[32m'Motion'\u001b[0m,\n",
" \u001b[32m'Defeat'\u001b[0m: \u001b[32m'Match'\u001b[0m,\n",
" \u001b[32m'Dissent'\u001b[0m: \u001b[32m'Foul'\u001b[0m,\n",
" \u001b[32m'Follow_Up'\u001b[0m: \u001b[32m'Shot'\u001b[0m,\n",
" \u001b[32m'Score'\u001b[0m: \u001b[32m'State_Of_Match'\u001b[0m,\n",
" \u001b[32m'Draw'\u001b[0m: \u001b[32m'Match'\u001b[0m,\n",
" \u001b[32m'Pass_Back'\u001b[0m: \u001b[32m'Pass'\u001b[0m,\n",
" \u001b[32m'Simulation'\u001b[0m: \u001b[32m'Foul'\u001b[0m,\n",
" \u001b[32m'Miss_Goal'\u001b[0m: \u001b[32m'Shot'\u001b[0m,\n",
" \u001b[32m'Miss_Chance'\u001b[0m: \u001b[32m'Chance'\u001b[0m,\n",
" \u001b[32m'Flick_On'\u001b[0m: \u001b[32m'Pass'\u001b[0m,\n",
" \u001b[32m'Ball_Escape'\u001b[0m: \u001b[32m'Motion'\u001b[0m,\n",
" \u001b[32m'Give_Card'\u001b[0m: \u001b[32m'Foul'\u001b[0m,\n",
" \u001b[32m'Take_On'\u001b[0m: \u001b[32m'One_On_One'\u001b[0m,\n",
" \u001b[32m'Connect'\u001b[0m: \u001b[32m'Pass'\u001b[0m,\n",
" \u001b[32m'Goalkeeper_Advance'\u001b[0m: \u001b[32m'Motion'\u001b[0m,\n",
" \u001b[32m'Hit'\u001b[0m: \u001b[32m'Shot'\u001b[0m,\n",
" \u001b[32m'Advantage'\u001b[0m: \u001b[32m'Foul'\u001b[0m,\n",
" \u001b[32m'Feign'\u001b[0m: \u001b[32m'Shot'\u001b[0m,\n",
" \u001b[32m'Overcome_Goalkeeper'\u001b[0m: \u001b[32m'Goal'\u001b[0m,\n",
" \u001b[32m'Prepare_Goal'\u001b[0m: \u001b[32m'Goal'\u001b[0m,\n",
" \u001b[32m'Ball'\u001b[0m: \u001b[32m'Actors'\u001b[0m,\n",
" \u001b[32m'Spectator_Activity'\u001b[0m: \u001b[32m'State_Of_Match'\u001b[0m,\n",
" \u001b[32m'Goal_Target'\u001b[0m: \u001b[32m'Field'\u001b[0m,\n",
" \u001b[32m'Player'\u001b[0m: \u001b[32m'Actors'\u001b[0m,\n",
" \u001b[32m'Referee'\u001b[0m: \u001b[32m'Actors'\u001b[0m,\n",
" \u001b[32m'Field'\u001b[0m: \u001b[32m'Field'\u001b[0m,\n",
" \u001b[32m'Team'\u001b[0m: \u001b[32m'Actors'\u001b[0m,\n",
" \u001b[32m'Bench'\u001b[0m: \u001b[32m'Field'\u001b[0m,\n",
" \u001b[32m'Coach'\u001b[0m: \u001b[32m'Actors'\u001b[0m,\n",
" \u001b[32m'Concede_Compensation'\u001b[0m: \u001b[32m'Foul'\u001b[0m,\n",
" \u001b[32m'Match_Temporal_Subdivision'\u001b[0m: \u001b[32m'Match'\u001b[0m,\n",
" \u001b[32m'Confusion'\u001b[0m: \u001b[32m'Mix-up'\u001b[0m,\n",
" \u001b[32m'Score_Goal'\u001b[0m: \u001b[32m'Goal'\u001b[0m,\n",
" \u001b[32m'Celebrate_Goal'\u001b[0m: \u001b[32m'Goal'\u001b[0m,\n",
" \u001b[32m'Suspension'\u001b[0m: \u001b[32m'Lineup'\u001b[0m,\n",
" \u001b[32m'Spectators'\u001b[0m: \u001b[32m'Actors'\u001b[0m,\n",
" \u001b[32m'Competition_Stage'\u001b[0m: \u001b[32m'Competition'\u001b[0m,\n",
" \u001b[32m'Body_Parts'\u001b[0m: \u001b[32m'Actors'\u001b[0m,\n",
" \u001b[32m'Trick'\u001b[0m: \u001b[32m'One_On_One'\u001b[0m,\n",
" \u001b[32m'Competition'\u001b[0m: \u001b[32m'Competition'\u001b[0m,\n",
" \u001b[32m'Stadium'\u001b[0m: \u001b[32m'Field'\u001b[0m,\n",
" \u001b[32m'Match_Quality'\u001b[0m: \u001b[32m'State_Of_Match'\u001b[0m,\n",
" \u001b[32m'Ball_And_Goal'\u001b[0m: \u001b[32m'Shot'\u001b[0m,\n",
" \u001b[32m'Equipment'\u001b[0m: \u001b[32m'Actors'\u001b[0m,\n",
" \u001b[32m'Injuries'\u001b[0m: \u001b[32m'Foul'\u001b[0m,\n",
" \u001b[32m'Shot_Quality'\u001b[0m: \u001b[32m'Shot'\u001b[0m\n",
"\u001b[1m}\u001b[0m\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"{\n",
" 'Intervene': 'ON_THE_PITCH',\n",
" 'Challenge': 'ON_THE_PITCH',\n",
" 'Award_Goal': 'ON_THE_PITCH',\n",
" 'Deny': 'ON_THE_PITCH',\n",
" 'Intercept': 'ON_THE_PITCH',\n",
" 'Shot_Supports': 'SUPPORTS',\n",
" 'Save': 'ON_THE_PITCH',\n",
" 'Pass': 'ON_THE_PITCH',\n",
" 'Ball_Bounce': 'ON_THE_PITCH',\n",
" 'Mark': 'ON_THE_PITCH',\n",
" 'Goal_Kickoff': 'ON_THE_PITCH',\n",
" 'Finish': 'ON_THE_PITCH',\n",
" 'Beat': 'ON_THE_PITCH',\n",
" 'Offside': 'ON_THE_PITCH',\n",
" 'Bad_Pass': 'ON_THE_PITCH',\n",
" 'Goal': 'ON_THE_PITCH',\n",
" 'Set_Piece': 'ON_THE_PITCH',\n",
" 'Shot': 'ON_THE_PITCH',\n",
" 'Player_Move_With_Ball': 'ON_THE_PITCH',\n",
" 'Sanction': 'ON_THE_PITCH',\n",
" 'Move': 'ON_THE_PITCH',\n",
" 'Control': 'ON_THE_PITCH',\n",
" 'Shoot_At': 'ON_THE_PITCH',\n",
" 'Start_End_Match': 'MATCH_IN_A_COMPETITION',\n",
" 'Match': 'MATCH_IN_A_COMPETITION',\n",
" 'Deploy': 'MATCH_IN_A_COMPETITION',\n",
" 'Start': 'MATCH_IN_A_COMPETITION',\n",
" 'Player_Move': 'ON_THE_PITCH',\n",
" 'Elimination': 'MATCH_IN_A_COMPETITION',\n",
" 'Result': 'MATCH_IN_A_COMPETITION',\n",
" 'Bring_Off': 'ON_THE_PITCH',\n",
" 'Away_Game': 'MATCH_IN_A_COMPETITION',\n",
" 'Possession': 'ON_THE_PITCH',\n",
" 'Pass_Combination': 'ON_THE_PITCH',\n",
" 'Lose_Ball': 'ON_THE_PITCH',\n",
" 'Defense_Shot': 'ON_THE_PITCH',\n",
" 'Receive_Card': 'SUPPORTS',\n",
" 'Victory': 'MATCH_IN_A_COMPETITION',\n",
" 'Supply_Pass': 'SUPPORTS',\n",
" 'Bring_On': 'ON_THE_PITCH',\n",
" 'Chance': 'ON_THE_PITCH',\n",
" 'Multiple_Goals': 'ON_THE_PITCH',\n",
" 'One_On_One': 'ON_THE_PITCH',\n",
" 'Substitute': 'ON_THE_PITCH',\n",
" 'Own_Goal': 'ON_THE_PITCH',\n",
" 'Convert_Chance': 'ON_THE_PITCH',\n",
" 'Ball_Land': 'ON_THE_PITCH',\n",
" 'Progression': 'MATCH_IN_A_COMPETITION',\n",
" 'Home_Game': 'MATCH_IN_A_COMPETITION',\n",
" 'Referee_Decision': 'ON_THE_PITCH',\n",
" 'Concede_Goal': 'SUPPORTS',\n",
" 'Mistake': 'ON_THE_PITCH',\n",
" 'Tactics': 'ON_THE_PITCH',\n",
" 'Foul': 'ON_THE_PITCH',\n",
" 'Being_Free': 'ON_THE_PITCH',\n",
" 'Lead': 'MATCH_IN_A_COMPETITION',\n",
" 'Create_Chance': 'ON_THE_PITCH',\n",
" 'Win_Compensation': 'ON_THE_PITCH',\n",
" 'Trail': 'MATCH_IN_A_COMPETITION',\n",
" 'Ball_Move': 'ON_THE_PITCH',\n",
" 'Defeat': 'MATCH_IN_A_COMPETITION',\n",
" 'Dissent': 'ON_THE_PITCH',\n",
" 'Follow_Up': 'ON_THE_PITCH',\n",
" 'Score': 'MATCH_IN_A_COMPETITION',\n",
" 'Draw': 'MATCH_IN_A_COMPETITION',\n",
" 'Pass_Back': 'ON_THE_PITCH',\n",
" 'Simulation': 'ON_THE_PITCH',\n",
" 'Miss_Goal': 'ON_THE_PITCH',\n",
" 'Miss_Chance': 'ON_THE_PITCH',\n",
" 'Flick_On': 'ON_THE_PITCH',\n",
" 'Ball_Escape': 'ON_THE_PITCH',\n",
" 'Give_Card': 'SUPPORTS',\n",
" 'Take_On': 'ON_THE_PITCH',\n",
" 'Connect': 'ON_THE_PITCH',\n",
" 'Goalkeeper_Advance': 'ON_THE_PITCH',\n",
" 'Hit': 'ON_THE_PITCH',\n",
" 'Advantage': 'ON_THE_PITCH',\n",
" 'Feign': 'ON_THE_PITCH',\n",
" 'Overcome_Goalkeeper': 'ON_THE_PITCH',\n",
" 'Prepare_Goal': 'ON_THE_PITCH',\n",
" 'Ball': 'ACTORS_AND_OBJECTS',\n",
" 'Spectator_Activity': 'ON_THE_PITCH',\n",
" 'Goal_Target': 'ACTORS_AND_OBJECTS',\n",
" 'Player': 'ACTORS_AND_OBJECTS',\n",
" 'Referee': 'ACTORS_AND_OBJECTS',\n",
" 'Field': 'ACTORS_AND_OBJECTS',\n",
" 'Team': 'ACTORS_AND_OBJECTS',\n",
" 'Bench': 'ACTORS_AND_OBJECTS',\n",
" 'Coach': 'ACTORS_AND_OBJECTS',\n",
" 'Concede_Compensation': 'ON_THE_PITCH',\n",
" 'Match_Temporal_Subdivision': 'MATCH_IN_A_COMPETITION',\n",
" 'Confusion': 'ON_THE_PITCH',\n",
" 'Score_Goal': 'ON_THE_PITCH',\n",
" 'Celebrate_Goal': 'ON_THE_PITCH',\n",
" 'Suspension': 'MATCH_IN_A_COMPETITION',\n",
" 'Spectators': 'ACTORS_AND_OBJECTS',\n",
" 'Competition_Stage': 'ACTORS_AND_OBJECTS',\n",
" 'Body_Parts': 'ACTORS_AND_OBJECTS',\n",
" 'Trick': 'ON_THE_PITCH',\n",
" 'Competition': 'ACTORS_AND_OBJECTS',\n",
" 'Stadium': 'ACTORS_AND_OBJECTS',\n",
" 'Match_Quality': 'ON_THE_PITCH',\n",
" 'Ball_And_Goal': 'ACTORS_AND_OBJECTS',\n",
" 'Equipment': 'ACTORS_AND_OBJECTS',\n",
" 'Injuries': 'ON_THE_PITCH',\n",
" 'Shot_Quality': 'ON_THE_PITCH'\n",
"}\n",
"
\n"
],
"text/plain": [
"\u001b[1m{\u001b[0m\n",
" \u001b[32m'Intervene'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Challenge'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Award_Goal'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Deny'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Intercept'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Shot_Supports'\u001b[0m: \u001b[32m'SUPPORTS'\u001b[0m,\n",
" \u001b[32m'Save'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Pass'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Ball_Bounce'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Mark'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Goal_Kickoff'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Finish'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Beat'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Offside'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Bad_Pass'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Goal'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Set_Piece'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Shot'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Player_Move_With_Ball'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Sanction'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Move'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Control'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Shoot_At'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Start_End_Match'\u001b[0m: \u001b[32m'MATCH_IN_A_COMPETITION'\u001b[0m,\n",
" \u001b[32m'Match'\u001b[0m: \u001b[32m'MATCH_IN_A_COMPETITION'\u001b[0m,\n",
" \u001b[32m'Deploy'\u001b[0m: \u001b[32m'MATCH_IN_A_COMPETITION'\u001b[0m,\n",
" \u001b[32m'Start'\u001b[0m: \u001b[32m'MATCH_IN_A_COMPETITION'\u001b[0m,\n",
" \u001b[32m'Player_Move'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Elimination'\u001b[0m: \u001b[32m'MATCH_IN_A_COMPETITION'\u001b[0m,\n",
" \u001b[32m'Result'\u001b[0m: \u001b[32m'MATCH_IN_A_COMPETITION'\u001b[0m,\n",
" \u001b[32m'Bring_Off'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Away_Game'\u001b[0m: \u001b[32m'MATCH_IN_A_COMPETITION'\u001b[0m,\n",
" \u001b[32m'Possession'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Pass_Combination'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Lose_Ball'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Defense_Shot'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Receive_Card'\u001b[0m: \u001b[32m'SUPPORTS'\u001b[0m,\n",
" \u001b[32m'Victory'\u001b[0m: \u001b[32m'MATCH_IN_A_COMPETITION'\u001b[0m,\n",
" \u001b[32m'Supply_Pass'\u001b[0m: \u001b[32m'SUPPORTS'\u001b[0m,\n",
" \u001b[32m'Bring_On'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Chance'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Multiple_Goals'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'One_On_One'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Substitute'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Own_Goal'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Convert_Chance'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Ball_Land'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Progression'\u001b[0m: \u001b[32m'MATCH_IN_A_COMPETITION'\u001b[0m,\n",
" \u001b[32m'Home_Game'\u001b[0m: \u001b[32m'MATCH_IN_A_COMPETITION'\u001b[0m,\n",
" \u001b[32m'Referee_Decision'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Concede_Goal'\u001b[0m: \u001b[32m'SUPPORTS'\u001b[0m,\n",
" \u001b[32m'Mistake'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Tactics'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Foul'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Being_Free'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Lead'\u001b[0m: \u001b[32m'MATCH_IN_A_COMPETITION'\u001b[0m,\n",
" \u001b[32m'Create_Chance'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Win_Compensation'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Trail'\u001b[0m: \u001b[32m'MATCH_IN_A_COMPETITION'\u001b[0m,\n",
" \u001b[32m'Ball_Move'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Defeat'\u001b[0m: \u001b[32m'MATCH_IN_A_COMPETITION'\u001b[0m,\n",
" \u001b[32m'Dissent'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Follow_Up'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Score'\u001b[0m: \u001b[32m'MATCH_IN_A_COMPETITION'\u001b[0m,\n",
" \u001b[32m'Draw'\u001b[0m: \u001b[32m'MATCH_IN_A_COMPETITION'\u001b[0m,\n",
" \u001b[32m'Pass_Back'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Simulation'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Miss_Goal'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Miss_Chance'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Flick_On'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Ball_Escape'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Give_Card'\u001b[0m: \u001b[32m'SUPPORTS'\u001b[0m,\n",
" \u001b[32m'Take_On'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Connect'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Goalkeeper_Advance'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Hit'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Advantage'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Feign'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Overcome_Goalkeeper'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Prepare_Goal'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Ball'\u001b[0m: \u001b[32m'ACTORS_AND_OBJECTS'\u001b[0m,\n",
" \u001b[32m'Spectator_Activity'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Goal_Target'\u001b[0m: \u001b[32m'ACTORS_AND_OBJECTS'\u001b[0m,\n",
" \u001b[32m'Player'\u001b[0m: \u001b[32m'ACTORS_AND_OBJECTS'\u001b[0m,\n",
" \u001b[32m'Referee'\u001b[0m: \u001b[32m'ACTORS_AND_OBJECTS'\u001b[0m,\n",
" \u001b[32m'Field'\u001b[0m: \u001b[32m'ACTORS_AND_OBJECTS'\u001b[0m,\n",
" \u001b[32m'Team'\u001b[0m: \u001b[32m'ACTORS_AND_OBJECTS'\u001b[0m,\n",
" \u001b[32m'Bench'\u001b[0m: \u001b[32m'ACTORS_AND_OBJECTS'\u001b[0m,\n",
" \u001b[32m'Coach'\u001b[0m: \u001b[32m'ACTORS_AND_OBJECTS'\u001b[0m,\n",
" \u001b[32m'Concede_Compensation'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Match_Temporal_Subdivision'\u001b[0m: \u001b[32m'MATCH_IN_A_COMPETITION'\u001b[0m,\n",
" \u001b[32m'Confusion'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Score_Goal'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Celebrate_Goal'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Suspension'\u001b[0m: \u001b[32m'MATCH_IN_A_COMPETITION'\u001b[0m,\n",
" \u001b[32m'Spectators'\u001b[0m: \u001b[32m'ACTORS_AND_OBJECTS'\u001b[0m,\n",
" \u001b[32m'Competition_Stage'\u001b[0m: \u001b[32m'ACTORS_AND_OBJECTS'\u001b[0m,\n",
" \u001b[32m'Body_Parts'\u001b[0m: \u001b[32m'ACTORS_AND_OBJECTS'\u001b[0m,\n",
" \u001b[32m'Trick'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Competition'\u001b[0m: \u001b[32m'ACTORS_AND_OBJECTS'\u001b[0m,\n",
" \u001b[32m'Stadium'\u001b[0m: \u001b[32m'ACTORS_AND_OBJECTS'\u001b[0m,\n",
" \u001b[32m'Match_Quality'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Ball_And_Goal'\u001b[0m: \u001b[32m'ACTORS_AND_OBJECTS'\u001b[0m,\n",
" \u001b[32m'Equipment'\u001b[0m: \u001b[32m'ACTORS_AND_OBJECTS'\u001b[0m,\n",
" \u001b[32m'Injuries'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m,\n",
" \u001b[32m'Shot_Quality'\u001b[0m: \u001b[32m'ON_THE_PITCH'\u001b[0m\n",
"\u001b[1m}\u001b[0m\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from lxml import etree as ET\n",
"kicktionary = ET.parse(\"kicktionary_lu_info.xml\")\n",
"frame_to_scenario = {\n",
" lu.attrib[\"frame\"]: lu.attrib[\"scenario\"]\n",
" for lu in kicktionary.xpath(\".//LEXICAL-UNIT\") if lu.attrib[\"frame\"]\n",
"}\n",
"frame_to_super_scenario = {\n",
" lu.attrib[\"frame\"]: lu.attrib[\"super-scenario\"]\n",
" for lu in kicktionary.xpath(\".//LEXICAL-UNIT\") if lu.attrib[\"frame\"]\n",
"}\n",
"\n",
"print(frame_to_scenario)\n",
"print(frame_to_super_scenario)"
]
}
],
"metadata": {
"interpreter": {
"hash": "1c3e697aa4e6ae3f4f7b554c053a671f50a0156c07fd90d57948174b29e29a61"
},
"kernelspec": {
"display_name": "Python 3.9.7 ('perspredict')",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.7"
},
"orig_nbformat": 4
},
"nbformat": 4,
"nbformat_minor": 2
}