mirror of
https://github.com/openai/openai-cookbook
synced 2024-11-04 06:00:33 +00:00
240 lines
62 KiB
Plaintext
240 lines
62 KiB
Plaintext
{
|
|
"cells": [
|
|
{
|
|
"attachments": {},
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Zero-shot classification with embeddings\n",
|
|
"\n",
|
|
"In this notebook we will classify the sentiment of reviews using embeddings and zero labeled data! The dataset is created in the [Get_embeddings_from_dataset Notebook](Get_embeddings_from_dataset.ipynb).\n",
|
|
"\n",
|
|
"We'll define positive sentiment to be 4- and 5-star reviews, and negative sentiment to be 1- and 2-star reviews. 3-star reviews are considered neutral and we won't use them for this example.\n",
|
|
"\n",
|
|
"We will perform zero-shot classification by embedding descriptions of each class and then comparing new samples to those class embeddings."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 1,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"# imports\n",
|
|
"import pandas as pd\n",
|
|
"import numpy as np\n",
|
|
"from ast import literal_eval\n",
|
|
"\n",
|
|
"from sklearn.metrics import classification_report\n",
|
|
"\n",
|
|
"# parameters\n",
|
|
"EMBEDDING_MODEL = \"text-embedding-ada-002\"\n",
|
|
"\n",
|
|
"# load data\n",
|
|
"datafile_path = \"data/fine_food_reviews_with_embeddings_1k.csv\"\n",
|
|
"\n",
|
|
"df = pd.read_csv(datafile_path)\n",
|
|
"df[\"embedding\"] = df.embedding.apply(literal_eval).apply(np.array)\n",
|
|
"\n",
|
|
"# convert 5-star rating to binary sentiment\n",
|
|
"df = df[df.Score != 3]\n",
|
|
"df[\"sentiment\"] = df.Score.replace({1: \"negative\", 2: \"negative\", 4: \"positive\", 5: \"positive\"})\n"
|
|
]
|
|
},
|
|
{
|
|
"attachments": {},
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"### Zero-Shot Classification\n",
|
|
"To perform zero shot classification, we want to predict labels for our samples without any training. To do this, we can simply embed short descriptions of each label, such as positive and negative, and then compare the cosine distance between embeddings of samples and label descriptions. \n",
|
|
"\n",
|
|
"The highest similarity label to the sample input is the predicted label. We can also define a prediction score to be the difference between the cosine distance to the positive and to the negative label. This score can be used for plotting a precision-recall curve, which can be used to select a different tradeoff between precision and recall, by selecting a different threshold."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 2,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
" precision recall f1-score support\n",
|
|
"\n",
|
|
" negative 0.61 0.88 0.72 136\n",
|
|
" positive 0.98 0.90 0.94 789\n",
|
|
"\n",
|
|
" accuracy 0.90 925\n",
|
|
" macro avg 0.79 0.89 0.83 925\n",
|
|
"weighted avg 0.92 0.90 0.91 925\n",
|
|
"\n"
|
|
]
|
|
},
|
|
{
|
|
"data": {
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEWCAYAAAB8LwAVAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAA5S0lEQVR4nO3dd3xW5f3/8dc7A8IGAREZgogioKBGXFWQKg7EXUddWBy0dfy0ddW60FZarf1qtSoWKo6CSq1SRREVXLWVIRsExAgBlT0DIePz++OcxJt4JzkhuXNnfJ6PRx65z3XW57oD9+c+13XOdcnMcM4550pKSXYAzjnnaiZPEM455+LyBOGccy4uTxDOOefi8gThnHMuLk8Qzjnn4vIE4aqUpKGSPk52HFVJ0iWS3omw3VOS7qqOmKqDpCxJJ4Wv75X0QrJjctXLE4RDUkNJoyV9LWmrpNmSTkt2XFGEH2I7JG2T9J2kZyU1rcpzmNmLZjYownbDzez+qjx3EUkmaXtYz1WSHpGUmohzOVfEE4QDSANWAv2BFsBvgZcldUlmUBUwxMyaAocDmQTx70ZSWrVHVfX6hPX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tGnTbse66qqr+PjjjznjjDM4//zzd0tEo0ePpkWLFkyfPp3c3FyOO+44Bg0aBMCsWbOYP39+3Fs7P/nkE55++uni5ddff51TTz2VAw88kNatWzNz5swf1DMnJ4f33nuPESNG/OB4xx9/PFu3bv1B+cMPP1x8FVRk1apVdOoUtFSmpaXRokUL1q9fT5s2bYq36d27N3feeSfr16+nUaNGTJo0iczMTAB69erF66+/ztlnn80rr7zCypXf3zeRmZnJyJEjPUE4V4qEJoiapKxv+smWl5fHddddx+zZs0lNTS3+Bn/kkUfys5/9jLy8PM4++2z69u3L/vvvz/Lly7n++usZPHhw8Qd8FO+88w5z584tbnLavHkzS5cupUGDBvTr16/U+/43bNhAs2bNipfHjRvHjTfeCMBFF13EuHHjihPEl19+Sd++fZHEWWedxWmnnfaD43300UeRY47i4IMP5rbbbmPQoEE0adKEvn37kpoajBQzZswYbrjhBu6//37OPPNMGjRoULzf3nvvzerVq0s7rHP1Xr1JEMnQq1evSO3/f/7zn2nXrh1z5syhsLCQjIwMAE444QQ+/PBD3nzzTYYOHcrNN9/M5Zdfzpw5c5g8eTJPPfUUL7/8MmPGjIkUj5nxl7/8hVNOOWW38mnTptGkSZNS90tLS6OwsJCUlBQ2bNjA+++/z7x585BEQUEBkorb9ov6IMpSkSuIDh06sHLlSjp27Eh+fj6bN2+mdevWP9h32LBhDBs2DIDf/OY3dOzYEYAePXrwzjvvALBkyRLefPP7lsqdO3fSqFGjMmN1rj5L9m2uddrAgQPJzc1l1KhRxWVz5879wTfozZs30759e1JSUnj++ecpKAieCfz6669p164dV199NVdddRWzZs1i3bp1FBYWct555/HAAw8wa9asyPGccsopPPnkk+TlBQ+lL1mypLjfoywHHXQQy5cvB2DChAlcdtllfP3112RlZbFy5Uq6du1aoauCjz76iNmzZ//gp2RyADjzzDMZO3Zs8bkHDhwY9zmFNWvWALBixQpeffVVfvrTn+5WXlhYyAMPPLBbf9CSJUuq9E4y5+oaTxAJJIl//etfvPvuu3Tr1o1evXpxxx13sM8+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0MJkgWQ4A7wzpGNR64jqB/aoaZbZUkYIqZXVzKPhkEf1dXA/gVhKu0cEa6GwgGR8sBvpL0EyieJ7eoyeA9gmlNi9rSWxAMqb4xTA49CL5hRj3vRiA1bHopy3/4fuDFSwjaupHUzcz+Z2Z3E4zy2anEflsJhgePd+4vCQa9u4vvv5F/AbRVMPcAktIl9Yq3f4xmwDdh89QlJdb9RFKKpG4EU2t+QZCIfx5uj6QDY5pxokghGKkY4KfAx+GV3EZJx4fllwEfKLgDrJOZTQVuI/hbNS1xvFLfI4ImrMMJZrMbH5b9FzhO0gFh/E0kHRizz4FAtdyN5crnCcJVCTP7nKA54mKCD7phYbPRAr6fCvJG4MSwOWUmQVPD20CapEXASIIPkIp4h++bjEpzPXClpLkEH343huUPSZqn4PbQ/xDMaxzr38A5YQfs8fzQS8ClfD/nwC6CD98/hHWfTcxdUKW4i6Cp6BNgcYl1K4DPCGb5G25mO4G/AQuBWWHcT1OiJaCcPojtQL9w34HAiLD8CoL3Yy7QNyxPBV4I/16fA4/FmWBoPHCLpM/DRFYsvLPsDeC08DdmtpZgsqZx4bk+JWg6Q1I7gqvSb0uJ3VUzH83V1WoKpg+9ycwuS3YstYGkbWZW8iqgRlAwLPcWMxud7FhcwK8gXK1mZrOAqeGdVK5220TQQe5qCL+CcM45F5dfQTjnnIvLE4Rzzrm4PEE455yLyxOEc865uDxBOOeci+v/A7qNNh/O/Qb4AAAAAElFTkSuQmCC",
|
|
"text/plain": [
|
|
"<Figure size 432x288 with 1 Axes>"
|
|
]
|
|
},
|
|
"metadata": {
|
|
"needs_background": "light"
|
|
},
|
|
"output_type": "display_data"
|
|
}
|
|
],
|
|
"source": [
|
|
"from openai.embeddings_utils import cosine_similarity, get_embedding\n",
|
|
"from sklearn.metrics import PrecisionRecallDisplay\n",
|
|
"\n",
|
|
"def evaluate_embeddings_approach(\n",
|
|
" labels = ['negative', 'positive'], \n",
|
|
" model = EMBEDDING_MODEL,\n",
|
|
"):\n",
|
|
" label_embeddings = [get_embedding(label, engine=model) for label in labels]\n",
|
|
"\n",
|
|
" def label_score(review_embedding, label_embeddings):\n",
|
|
" return cosine_similarity(review_embedding, label_embeddings[1]) - cosine_similarity(review_embedding, label_embeddings[0])\n",
|
|
"\n",
|
|
" probas = df[\"embedding\"].apply(lambda x: label_score(x, label_embeddings))\n",
|
|
" preds = probas.apply(lambda x: 'positive' if x>0 else 'negative')\n",
|
|
"\n",
|
|
" report = classification_report(df.sentiment, preds)\n",
|
|
" print(report)\n",
|
|
"\n",
|
|
" display = PrecisionRecallDisplay.from_predictions(df.sentiment, probas, pos_label='positive')\n",
|
|
" _ = display.ax_.set_title(\"2-class Precision-Recall curve\")\n",
|
|
"\n",
|
|
"evaluate_embeddings_approach(labels=['negative', 'positive'], model=EMBEDDING_MODEL)"
|
|
]
|
|
},
|
|
{
|
|
"attachments": {},
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"We can see that this classifier already performs extremely well. We used similarity embeddings, and the simplest possible label name. Let's try to improve on this by using more descriptive label names, and search embeddings."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 3,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
" precision recall f1-score support\n",
|
|
"\n",
|
|
" negative 0.98 0.73 0.84 136\n",
|
|
" positive 0.96 1.00 0.98 789\n",
|
|
"\n",
|
|
" accuracy 0.96 925\n",
|
|
" macro avg 0.97 0.86 0.91 925\n",
|
|
"weighted avg 0.96 0.96 0.96 925\n",
|
|
"\n"
|
|
]
|
|
},
|
|
{
|
|
"data": {
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEWCAYAAAB8LwAVAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAz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77LEMGjSI119/nUmTJnHttdfy3nvvNfi1hgwZwoEHHgjAvffey+WXX86UKVPo3r17jR+sVa1c+cWH5kePHs0uu+xCx46fPxs5fPhwvvrVrzJ8+PDV9u3Tpw9Tpkxh2rRpvPTSSzz44INrVqCkZ8+e3HnnnZx88sk17ved73yH22+/nVmzZjFr1iwee+wxAK677joOOOAAZs2axQEHHMB112U30g0ePJiHHnqIpUuX1is+s5asZHcxRcRKSReSfdi3BoZGxExJQ4CJETEK+B/gdkmXkA1YnxnZV7+Fkn5DVskEMDoiHqlPPFc/NJOX3llS+4510HeLjlx5ZL9q88eNG0fbtm254IILVqXtsssuQPZtu9KcOXM47bTT+OSTbLmNG2+8kb333pt58+ZxwgknsGTJElauXMnNN9/M3nvvzdlnn83EiRORxLe//W0uueQSzjzzTI444ggWLVrEiBEjGDNmDI8++ijXXHMNRxxxBDNmzKC8vJzLLruM8ePHs3z5cr73ve9x/vnnM378eH7605+y6aab8sorr/Daa6+tVo57772X8847b9X2xx9/zLPPPsu4ceM48sgjufrqq79Q9jZt2rD33nsze/bsNXpvK/Xq1QuAVq2q/y4zb948lixZwp577gnA6aefzoMPPshhhx3GP/7xD8aPHw/AGWecwaBBg/jlL3+JJAYNGsTDDz/Mt771rXrFaNZSlfQ5iPRMw+gqaVcUvH4J2KeaY+8hu9V1rTVjxgx22223WvfbbLPNGDt2LO3atWPWrFmcdNJJTJw4kb/85S8ccsgh/PjHP6a8vJylS5cyZcoU5s6dy4wZMwBYtGjRauc655xzePbZZzniiCM4/vjjV6uI7rjjDjbeeGMmTJjA8uXL2WeffTj44IMBmDx5MjNmzCh6a+dzzz3Hrbfeumr7H//4B4ceeijbbbcdnTp1YtKkSV8o59KlS3niiScYMmTIF86377778tFHH30h/YYbbljVCqqLuXPn0qNHj1XbPXr0YO7crDfzvffeo1u3bgBsvvnmq7XeBgwYwDPPPOMKwqwaJa0gmpOavuk3tRUrVnDhhRcyZcoUWrduveob/O677863v/1tVqxYwTHHHEP//v3ZeuuteeONN7jooosYPHjwqg/4PP75z38ybdq0VV1OixcvZtasWay33noMHDiw2vv+FyxYQIcOHVZtDx8+nO9///sAnHjiiQwfPnxVBfH666/Tv39/JHH00Udz2GGHfeF8zzzzTO6YG5Kk1e5Q2myzzXjnnXdqOMJs3bbOVBBNoV+/frn6/3/729/StWtXpk6dSkVFBe3atQPga1/7Gk8//TSPPPIIZ555Jpdeeimnn346U6dOZcyYMdxyyy2MGDGCoUOH5oonIvjDH/7AIYccslr6+PHjad++fbXHtWnThoqKClq1asWCBQt48sknmT59OpIoLy9HEtdffz3w+RhETRq6BdG9e3fKyspWbZeVldG9e3ZHddeuXZk3bx7dunVj3rx5bLbZZqv2W7ZsGRtssEGdr2e2rmjq21xbtP3335/ly5dz2223rUqbNm3aF75BL168mG7dutGqVSvuvvtuysuzZwLffPNNunbtyrnnnss555zD5MmT+eCDD6ioqOC4447j5z//OZMnT84dzyGHHMLNN9/MihXZQ+mvvfbaqnGPmnz5y1/mjTfeAGDkyJGcdtppvPnmm8yZM4e3336b3r1716lV8MwzzzBlypQv/KxJ5QDQrVs3OnbsyAsvvEBEcNddd3H00dkzmUcddRTDhg0DYNiwYavSISt/Q95JZtbSuIIoIUn8/e9/5/HHH6dPnz7069ePyy+/nM0333y1/b773e8ybNgwdtllF1555ZVV3+bHjx/PLrvswle+8hX++te/8v3vf5+5c+cyaNAg+vfvz6mnnsq1116bO55zzjmHvn37suuuu7Ljjjty/vnnF71rqarBgwevGugdPnw4xx577Gr5xx133BfuZmooEyZMoEePHtx///2cf/759Ov3eVdh//79V73+4x//yDnnnMM222xDnz59VnVtXXbZZYwdO5Ztt92Wxx9/nMsuu2zVMePGjWPw4MElidusJVDl/eJruwEDBsTEiRNXS3v55ZfZYYcdmiiilmPevHmcfvrpjB07tqlDaTDvvfceJ598Mk888UTRfP/bsbXFjU/OYuln5fzo0O3X6HhJkyJiQLE8j0FYrbp168a5557LkiVLVnsWYm321ltv8etfe5l1W/tduP+2JTu3KwjLpaXdCrr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9FzwCtV8t4C/kO2yt8FEbEM+BPwEjA5xX0rVXoCahmD+AQYmI7dHxiS0s8gez+mAf1TemvgnvT3ehH4fZEFhu4DfijpxVSRrZLuLHsYOCz9JiLmky3WNDxd63myrjMkdSVrlb5bTezWyDybq63VlC0feklEnNbUsawNJH0cEVVbAc2Csmm5l0TEHU0di2XcgrC1WkRMBsalO6ls7baIbIDcmgm3IMzMrCi3IMzMrChXEGZmVpQrCDMzK8oVhJmZFeUKwszMivr/42vvGa3GwGsAAAAASUVORK5CYII=",
|
|
"text/plain": [
|
|
"<Figure size 432x288 with 1 Axes>"
|
|
]
|
|
},
|
|
"metadata": {
|
|
"needs_background": "light"
|
|
},
|
|
"output_type": "display_data"
|
|
}
|
|
],
|
|
"source": [
|
|
"evaluate_embeddings_approach(labels=['An Amazon review with a negative sentiment.', 'An Amazon review with a positive sentiment.'])"
|
|
]
|
|
},
|
|
{
|
|
"attachments": {},
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"Using the search embeddings and descriptive names leads to an additional improvement in performance."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 4,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
" precision recall f1-score support\n",
|
|
"\n",
|
|
" negative 0.98 0.73 0.84 136\n",
|
|
" positive 0.96 1.00 0.98 789\n",
|
|
"\n",
|
|
" accuracy 0.96 925\n",
|
|
" macro avg 0.97 0.86 0.91 925\n",
|
|
"weighted avg 0.96 0.96 0.96 925\n",
|
|
"\n"
|
|
]
|
|
},
|
|
{
|
|
"data": {
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEWCAYAAAB8LwAVAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYA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zz+r8WgMGDOCAAw4A4NFHH+Wqq65i0qRJdOjQocoba0UrVnz/pfkRI0aw00470arVd+9GDhkyhL333pshQ4assm+3bt2YNGkSU6ZM4a233uLJJ59cvQylOnfuzEMPPcQpp5xS5X4/+9nPeOCBB5gxYwYzZszgueeeA+Cmm25i//33Z8aMGey///7cdFPyIF3fvn156qmnWLx4ca3iM2vMCvYUU0SskHQxyc2+KTAwIqZLGgCMj4jhwP8AD0i6nKTD+qxIvvrNl3Q7SSETwIiIeKY28Vz/1HTe+mRR9TvWQPfNW3HtET0q3T5mzBiaN2/OhRdeuDJtp512ApJv2+VmzZrF6aefzjffJNNt3Hnnney5557MmTOHE088kUWLFrFixQruuece9txzT84991zGjx+PJM455xwuv/xyzjrrLA4//HAWLFjA0KFDGTlyJM8++yw33HADhx9+ONOmTaO0tJT+/fszduxYli1bxkUXXcQFF1zA2LFjufrqq9lkk0145513eO+991bJx6OPPkq/fv1Wrn/99de8+uqrjBkzhiOOOILrr7/+e3lv1qwZe+65JzNnzlytz7Zcly5dAGjSpPLvMnPmzGHRokXsvvvuAJxxxhk8+eSTHHroofzzn/9k7NixAJx55pn06dOHm2++GUn06dOHp59+mhNOOKFWMZo1VgV9DyJ9p2FEhbRrcpbfAvaq5NhHSB51XWNNmzaNXXbZpdr9Nt10U0aNGkWLFi2YMWMGJ598MuPHj+evf/0rBx98ML/61a8oLS1l8eLFTJo0idmzZzNt2jQAFixYsMq5zjvvPF599VUOP/xwjj/++FUKogcffJCNNtqIcePGsWzZMvbaay8OOuggACZOnMi0adPyPtr52muvcd99961c/+c//8khhxzCNttsQ+vWrZkwYcL38rl48WJefPFFBgwY8L3z7bPPPnz11VffS7/11ltX1oJqYvbs2XTs2HHleseOHZk9O2nN/Oyzz2jfvj0Am2222Sq1t169evHKK6+4gDCrREELiIakqm/6xbZ8+XIuvvhiJk2aRNOmTVd+g991110555xzWL58OUcffTQ9e/Zkyy235IMPPuCSSy6hb9++K2/wWTz//PNMmTJlZZPTwoULmTFjBuussw69e/eu9Ln/efPm0bJly5XrQ4YM4bLLLgPgpJNOYsiQISsLiPfff5+ePXsiiaOOOopDDz30e+d75ZVXMsdclySt8oTSpptuyieffFLFEWZrt7WmgCiGHj16ZGr//8Mf/kC7du2YPHkyZWVltGjRAoAf//jHvPzyyzzzzDOcddZZXHHFFZxxxhlMnjyZkSNHcu+99zJ06FAGDhyYKZ6I4E9/+hMHH3zwKuljx45lgw02qPS4Zs2aUVZWRpMmTZg3bx6jR49m6tSpSKK0tBRJ3HLLLcB3fRBVqesaRIcOHSgpKVm5XlJSQocOyRPV7dq1Y86cObRv3545c+aw6aabrtxv6dKlrLfeejW+ntnaotiPuTZq++23H8uWLeP+++9fmTZlypTvfYNeuHAh7du3p0mTJjz88MOUlibvBH744Ye0a9eO888/n/POO4+JEyfyxRdfUFZWxnHHHcdvf/tbJk6cmDmegw8+mHvuuYfly5OX0t97772V/R5V+eEPf8gHH3wAwLBhwzj99NP58MMPmTVrFh9//DFdu3atUa3glVdeYdKkSd/7WZ3CAaB9+/a0atWKN954g4hg8ODBHHVU8k7mkUceyaBBgwAYNGjQynRI8l+XT5KZNTYuIApIEv/4xz944YUX6NatGz169OCqq65is802W2W/n//85wwaNIiddtqJd955Z+W3+bFjx7LTTjvxox/9iL/97W9cdtllzJ49mz59+tCzZ09OO+00brzxxszxnHfeeXTv3p2dd96Z7bffngsuuCDvU0sV9e3bd2VH75AhQzjmmGNW2X7cccd972mmujJu3Dg6duzI448/zgUXXECPHt81Ffbs2XPl8t133815553HVlttRbdu3VY2bfXv359Ro0ax9dZb88ILL9C/f/+Vx4wZM4a+ffsWJG6zxkDlz4uv6Xr16hXjx49fJe3tt99mu+22K1JEjcecOXM444wzGDVqVLFDqTOfffYZp5xyCi+++GLe7f63Y2uKO0fPYPG3pfzykG1X63hJEyKiV75t7oOwarVv357zzz+fRYsWrfIuxJrso48+4rbbPM26rfku3m/rgp3bBYRl0tgeBd11112LHYJZg9fo+yAaSxOa1R//mzFLNOoCokW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4M/AW8DENO77qNASUE0fxDdA7/TY/YABafqZJJ/HFKBnmt4UeCT9e70J3JFngqHHgCslvZkWZCulT5Y9DRya/iYi5pJM1jQkvdbrJE1nSGpHUiv9tJLYrZ55NFdboymZPvTyiDi92LGsCSR9HREVawENgpJhuRdFxIPFjsUSrkHYGi0iJgJj0iepbM22gKSD3BoI1yDMzCwv1yDMzCwvFxBmZpaXCwgzM8vLBYSZmeXlAsLMzPL6/+I+7HODzXRXAAAAAElFTkSuQmCC",
|
|
"text/plain": [
|
|
"<Figure size 432x288 with 1 Axes>"
|
|
]
|
|
},
|
|
"metadata": {
|
|
"needs_background": "light"
|
|
},
|
|
"output_type": "display_data"
|
|
}
|
|
],
|
|
"source": [
|
|
"evaluate_embeddings_approach(labels=['An Amazon review with a negative sentiment.', 'An Amazon review with a positive sentiment.'])"
|
|
]
|
|
},
|
|
{
|
|
"attachments": {},
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"As shown above, zero-shot classification with embeddings can lead to great results, especially when the labels are more descriptive than just simple words."
|
|
]
|
|
}
|
|
],
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"display_name": "openai",
|
|
"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.9"
|
|
},
|
|
"orig_nbformat": 4,
|
|
"vscode": {
|
|
"interpreter": {
|
|
"hash": "365536dcbde60510dc9073d6b991cd35db2d9bac356a11f5b64279a5e6708b97"
|
|
}
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 2
|
|
}
|