{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "%matplotlib inline\n",
    "%config InlineBackend.figure_format='retina'\n",
    "import seaborn as sns\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<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>s1</th>\n",
       "      <th>s2</th>\n",
       "      <th>dataset</th>\n",
       "      <th>value</th>\n",
       "      <th>type</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Amrozi accused his brother, whom he called \"th...</td>\n",
       "      <td>Referring to him as only \"the witness\", Amrozi...</td>\n",
       "      <td>mrpc</td>\n",
       "      <td>0.199770</td>\n",
       "      <td>position deviation</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>They had published an advertisement on the Int...</td>\n",
       "      <td>On June 10, the ship's owners had published an...</td>\n",
       "      <td>mrpc</td>\n",
       "      <td>0.240221</td>\n",
       "      <td>position deviation</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>The stock rose $2.11, or about 11 percent, to ...</td>\n",
       "      <td>PG&amp;E Corp. shares jumped $1.63 or 8 percent to...</td>\n",
       "      <td>mrpc</td>\n",
       "      <td>0.196429</td>\n",
       "      <td>position deviation</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Revenue in the first quarter of the year dropp...</td>\n",
       "      <td>With the scandal hanging over Stewart's compan...</td>\n",
       "      <td>mrpc</td>\n",
       "      <td>0.137821</td>\n",
       "      <td>position deviation</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>The DVD-CCA then appealed to the state Supreme...</td>\n",
       "      <td>The DVD CCA appealed that decision to the U.S....</td>\n",
       "      <td>mrpc</td>\n",
       "      <td>0.067235</td>\n",
       "      <td>position deviation</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                  s1  \\\n",
       "0  Amrozi accused his brother, whom he called \"th...   \n",
       "1  They had published an advertisement on the Int...   \n",
       "2  The stock rose $2.11, or about 11 percent, to ...   \n",
       "3  Revenue in the first quarter of the year dropp...   \n",
       "4  The DVD-CCA then appealed to the state Supreme...   \n",
       "\n",
       "                                                  s2 dataset     value  \\\n",
       "0  Referring to him as only \"the witness\", Amrozi...    mrpc  0.199770   \n",
       "1  On June 10, the ship's owners had published an...    mrpc  0.240221   \n",
       "2  PG&E Corp. shares jumped $1.63 or 8 percent to...    mrpc  0.196429   \n",
       "3  With the scandal hanging over Stewart's compan...    mrpc  0.137821   \n",
       "4  The DVD CCA appealed that decision to the U.S....    mrpc  0.067235   \n",
       "\n",
       "                 type  \n",
       "0  position deviation  \n",
       "1  position deviation  \n",
       "2  position deviation  \n",
       "3  position deviation  \n",
       "4  position deviation  "
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.read_csv(\"./dataset_stats.csv\")\n",
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:title={'center':'MRPC Word Position Deviation'}, ylabel='Count'>"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 22324 characters]\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "image/png": {
       "height": 263,
       "width": 396
      },
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "mrpc_wpd = df[df[\"dataset\"]==\"mrpc\"]\n",
    "mrpc_wpd = mrpc_wpd[mrpc_wpd[\"type\"]==\"position deviation\"]\n",
    "mrpc_wpd_values = mrpc_wpd[\"value\"].tolist()\n",
    "plt.title(\"MRPC Word Position Deviation\")\n",
    "plt.xlim([0, 1.0])\n",
    "sns.histplot(mrpc_wpd_values)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:title={'center':'MRPC Lexical Deviation'}, ylabel='Count'>"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 20924 characters]\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "image/png": {
       "height": 263,
       "width": 396
      },
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "mrpc_wpd = df[df[\"dataset\"]==\"mrpc\"]\n",
    "mrpc_wpd = mrpc_wpd[mrpc_wpd[\"type\"]==\"lexical deviation\"]\n",
    "mrpc_wpd_values = mrpc_wpd[\"value\"].tolist()\n",
    "plt.title(\"MRPC Lexical Deviation\")\n",
    "plt.xlim([0, 1.0])\n",
    "sns.histplot(mrpc_wpd_values)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:title={'center':'MRPC Edit Distance'}, ylabel='Count'>"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 19180 characters]\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "image/png": {
       "height": 263,
       "width": 388
      },
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "mrpc_wpd = df[df[\"dataset\"]==\"mrpc\"]\n",
    "mrpc_wpd = mrpc_wpd[mrpc_wpd[\"type\"]==\"edit distance\"]\n",
    "mrpc_wpd_values = mrpc_wpd[\"value\"].tolist()\n",
    "plt.title(\"MRPC Edit Distance\")\n",
    "sns.histplot(mrpc_wpd_values)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:title={'center':'MRPC ROUGE-L'}, ylabel='Count'>"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 18012 characters]\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "image/png": {
       "height": 263,
       "width": 388
      },
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "mrpc_wpd = df[df[\"dataset\"]==\"mrpc\"]\n",
    "mrpc_wpd = mrpc_wpd[mrpc_wpd[\"type\"]==\"rouge-l\"]\n",
    "mrpc_wpd_values = mrpc_wpd[\"value\"].tolist()\n",
    "plt.title(\"MRPC ROUGE-L\")\n",
    "sns.histplot(mrpc_wpd_values)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:title={'center':'MRPC SELF-BLEU'}, ylabel='Count'>"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 19116 characters]\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "image/png": {
       "height": 263,
       "width": 392
      },
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "mrpc_wpd = df[df[\"dataset\"]==\"mrpc\"]\n",
    "mrpc_wpd = mrpc_wpd[mrpc_wpd[\"type\"]==\"self-bleu\"]\n",
    "mrpc_wpd_values = mrpc_wpd[\"value\"].tolist()\n",
    "plt.title(\"MRPC SELF-BLEU\")\n",
    "sns.histplot(mrpc_wpd_values)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:title={'center':'PAWS Word Position Deviation'}, ylabel='Count'>"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 24516 characters]\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "image/png": {
       "height": 263,
       "width": 403
      },
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "mrpc_wpd = df[df[\"dataset\"]==\"paws\"]\n",
    "mrpc_wpd = mrpc_wpd[mrpc_wpd[\"type\"]==\"position deviation\"]\n",
    "mrpc_wpd_values = mrpc_wpd[\"value\"].tolist()\n",
    "plt.title(\"PAWS Word Position Deviation\")\n",
    "plt.xlim([0, 1.0])\n",
    "sns.histplot(mrpc_wpd_values)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:title={'center':'PAWS Lexical Deviation'}, ylabel='Count'>"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 22068 characters]\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "image/png": {
       "height": 263,
       "width": 403
      },
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "mrpc_wpd = df[df[\"dataset\"]==\"paws\"]\n",
    "mrpc_wpd = mrpc_wpd[mrpc_wpd[\"type\"]==\"lexical deviation\"]\n",
    "mrpc_wpd_values = mrpc_wpd[\"value\"].tolist()\n",
    "plt.title(\"PAWS Lexical Deviation\")\n",
    "plt.xlim([0, 1.0])\n",
    "sns.histplot(mrpc_wpd_values)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:title={'center':'PAWS Edit Distance'}, ylabel='Count'>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 22352 characters]\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "image/png": {
       "height": 263,
       "width": 395
      },
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "mrpc_wpd = df[df[\"dataset\"]==\"paws\"]\n",
    "mrpc_wpd = mrpc_wpd[mrpc_wpd[\"type\"]==\"edit distance\"]\n",
    "mrpc_wpd_values = mrpc_wpd[\"value\"].tolist()\n",
    "plt.title(\"PAWS Edit Distance\")\n",
    "sns.histplot(mrpc_wpd_values)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:title={'center':'PAWS ROUGE-L'}, ylabel='Count'>"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 23040 characters]\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "image/png": {
       "height": 263,
       "width": 395
      },
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "mrpc_wpd = df[df[\"dataset\"]==\"paws\"]\n",
    "mrpc_wpd = mrpc_wpd[mrpc_wpd[\"type\"]==\"rouge-l\"]\n",
    "mrpc_wpd_values = mrpc_wpd[\"value\"].tolist()\n",
    "plt.title(\"PAWS ROUGE-L\")\n",
    "sns.histplot(mrpc_wpd_values)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<AxesSubplot:title={'center':'PAWS SELF-BLEU'}, ylabel='Count'>"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 20708 characters]\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "image/png": {
       "height": 263,
       "width": 395
      },
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "mrpc_wpd = df[df[\"dataset\"]==\"paws\"]\n",
    "mrpc_wpd = mrpc_wpd[mrpc_wpd[\"type\"]==\"self-bleu\"]\n",
    "mrpc_wpd_values = mrpc_wpd[\"value\"].tolist()\n",
    "plt.title(\"PAWS SELF-BLEU\")\n",
    "sns.histplot(mrpc_wpd_values)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "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.8.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
