{ "cells": [ { "cell_type": "markdown", "id": "9949dcdb", "metadata": {}, "source": [ "# Prepare SST data for gender annotation\n", "\n", "* Import SST data from huggingface\n", "* Use word lists to automatically annotate (pre-annotate?) sentences for gender\n", "* Subsample gendered sentences: 400 masculine, 400 feminine, 400 neutral\n", "* Prepare CSVs for human annotation" ] }, { "cell_type": "markdown", "id": "5badcb9d", "metadata": {}, "source": [ "## Import SST data from huggingface" ] }, { "cell_type": "code", "execution_count": 2, "id": "022eb689", "metadata": {}, "outputs": [], "source": [ "import pandas as pd" ] }, { "cell_type": "code", "execution_count": 2, "id": "1f0b6c0f", "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "846f46d502ab4b818dd0884151663b83", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Downloading builder script: 0%| | 0.00/2.59k [00:00\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
sentencelabeltokenstreesplit
0The Rock is destined to be the 21st Century 's...0.694440The|Rock|is|destined|to|be|the|21st|Century|'s...70|70|68|67|63|62|61|60|58|58|57|56|56|64|65|5...train
1The gorgeously elaborate continuation of `` Th...0.833330The|gorgeously|elaborate|continuation|of|``|Th...71|70|69|69|67|67|66|64|63|62|62|61|61|58|57|5...train
2Singer\\/composer Bryan Adams contributes a sle...0.625000Singer\\/composer|Bryan|Adams|contributes|a|sle...72|71|71|70|68|68|67|67|66|63|62|62|60|60|58|5...train
3You 'd think by now America would have had eno...0.500000You|'d|think|by|now|America|would|have|had|eno...36|35|34|33|33|32|30|29|27|26|25|24|23|23|22|2...train
4Yet the act is still charming here .0.722220Yet|the|act|is|still|charming|here|.15|13|13|10|9|9|11|12|10|11|12|14|14|15|0train
..................
2205An imaginative comedy\\/thriller .0.777780An|imaginative|comedy\\/thriller|.7|6|5|5|6|7|0test
2206( A ) rare , beautiful film .0.916670(|A|)|rare|,|beautiful|film|.13|12|12|11|10|9|9|15|10|11|14|13|14|15|0test
2207( An ) hilarious romantic comedy .0.888890(|An|)|hilarious|romantic|comedy|.12|11|11|9|8|8|10|9|10|13|12|13|0test
2208Never ( sinks ) into exploitation .0.625000Never|(|sinks|)|into|exploitation|.11|10|9|9|8|8|13|12|10|11|12|13|0test
2209( U ) nrelentingly stupid .0.069444(|U|)|nrelentingly|stupid|.10|9|9|7|7|8|8|11|10|11|0test
\n", "

11855 rows × 5 columns

\n", "" ], "text/plain": [ " sentence label \\\n", "0 The Rock is destined to be the 21st Century 's... 0.694440 \n", "1 The gorgeously elaborate continuation of `` Th... 0.833330 \n", "2 Singer\\/composer Bryan Adams contributes a sle... 0.625000 \n", "3 You 'd think by now America would have had eno... 0.500000 \n", "4 Yet the act is still charming here . 0.722220 \n", "... ... ... \n", "2205 An imaginative comedy\\/thriller . 0.777780 \n", "2206 ( A ) rare , beautiful film . 0.916670 \n", "2207 ( An ) hilarious romantic comedy . 0.888890 \n", "2208 Never ( sinks ) into exploitation . 0.625000 \n", "2209 ( U ) nrelentingly stupid . 0.069444 \n", "\n", " tokens \\\n", "0 The|Rock|is|destined|to|be|the|21st|Century|'s... \n", "1 The|gorgeously|elaborate|continuation|of|``|Th... \n", "2 Singer\\/composer|Bryan|Adams|contributes|a|sle... \n", "3 You|'d|think|by|now|America|would|have|had|eno... \n", "4 Yet|the|act|is|still|charming|here|. \n", "... ... \n", "2205 An|imaginative|comedy\\/thriller|. \n", "2206 (|A|)|rare|,|beautiful|film|. \n", "2207 (|An|)|hilarious|romantic|comedy|. \n", "2208 Never|(|sinks|)|into|exploitation|. \n", "2209 (|U|)|nrelentingly|stupid|. \n", "\n", " tree split \n", "0 70|70|68|67|63|62|61|60|58|58|57|56|56|64|65|5... train \n", "1 71|70|69|69|67|67|66|64|63|62|62|61|61|58|57|5... train \n", "2 72|71|71|70|68|68|67|67|66|63|62|62|60|60|58|5... train \n", "3 36|35|34|33|33|32|30|29|27|26|25|24|23|23|22|2... train \n", "4 15|13|13|10|9|9|11|12|10|11|12|14|14|15|0 train \n", "... ... ... \n", "2205 7|6|5|5|6|7|0 test \n", "2206 13|12|12|11|10|9|9|15|10|11|14|13|14|15|0 test \n", "2207 12|11|11|9|8|8|10|9|10|13|12|13|0 test \n", "2208 11|10|9|9|8|8|13|12|10|11|12|13|0 test \n", "2209 10|9|9|7|7|8|8|11|10|11|0 test \n", "\n", "[11855 rows x 5 columns]" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pd.set_option('display.max_colwidth', 50)\n", "data" ] }, { "cell_type": "markdown", "id": "ee3a4945", "metadata": {}, "source": [ "## Loosely annotate sentences (masc, femme, neutral) using word lists" ] }, { "cell_type": "code", "execution_count": 6, "id": "0e85a47a", "metadata": {}, "outputs": [], "source": [ "gender_words = {\n", " 'femm': ['she', 'her', 'hers', 'mum', 'mom', 'mother', 'daughter', 'sister', 'niece', 'aunt', 'grandmother',\n", " 'lady', 'woman', 'girl', \"ma'am\", 'female', 'wife', 'ms', 'miss', 'mrs', 'ms.', 'mrs.'],\n", " 'masc': ['he', 'him', 'his', 'dad', 'father', 'son', 'brother', 'nephew', 'uncle', 'grandfather',\n", " 'gentleman', 'man', 'boy', 'sir', 'male', 'husband', 'mr', 'mr.'],\n", " 'neut': ['they', 'them', 'theirs', 'parent', 'child', 'sibling',\n", " 'person', 'spouse']\n", "}\n", "\n", "def label_gender(row):\n", " tokens = row['tokens'].lower().split('|')\n", " gender = 'none'\n", " for key, words in gender_words.items():\n", " for w in words:\n", " if w in tokens or w+\"s\" in tokens:\n", " if gender == 'none':\n", " gender = key\n", " else:\n", " gender = 'mixed'\n", " break\n", " return gender\n", "\n", "data['gender'] = data.apply(lambda row: label_gender(row), axis=1)" ] }, { "cell_type": "code", "execution_count": 7, "id": "46e8b885", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "none 10001\n", "masc 931\n", "neut 420\n", "femm 372\n", "mixed 131\n", "Name: gender, dtype: int64" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "data['gender'].value_counts()" ] }, { "cell_type": "code", "execution_count": 8, "id": "91233c13", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "none 8113\n", "masc 743\n", "neut 350\n", "femm 303\n", "mixed 104\n", "Name: gender, dtype: int64" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "data_polarized = data[(data['label']>.6)|(data['label']<.4)]\n", "data_polarized['gender'].value_counts()" ] }, { "cell_type": "code", "execution_count": 14, "id": "8a7a12bb", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
sentencelabelgender
0The Rock is destined to be the 21st Century 's new `` Conan '' and that he 's going to make a splash even greater than Arnold Schwarzenegger , Jean-Claud Van Damme or Steven Segal .0.69444masc
43`` Auto Focus '' works as an unusual biopic and document of male swingers in the Playboy era0.65278masc
44If Mr. Zhang 's subject matter is , to some degree at least , quintessentially American , his approach to storytelling might be called Iranian .0.52778masc
52( City ) reminds us how realistically nuanced a Robert De Niro performance can be when he is not more lucratively engaged in the shameless self-caricature of ` Analyze This ' ( 1999 ) and ` Analyze That , ' promised ( or threatened ) for later this year .0.63889masc
90Allen shows he can outgag any of those young whippersnappers making moving pictures today .0.76389masc
98It celebrates the group 's playful spark of nonconformity , glancing vividly back at what Hibiscus grandly called his ` angels of light . '0.72222masc
136Writer\\/director Alexander Payne ( Election ) and his co-writer Jim Taylor brilliantly employ their quirky and fearless ability to look American angst in the eye and end up laughing .0.75000masc
141Pacino is the best he 's been in years and Keener is marvelous .0.88889masc
146So purely enjoyable that you might not even notice it 's a fairly straightforward remake of Hollywood comedies such as Father of the Bride .0.79167masc
150Robin Williams has thankfully ditched the saccharine sentimentality of Bicentennial Man in favour of an altogether darker side .0.63889masc
153Hoffman 's performance is authentic to the core of his being .0.73611masc
168Too often , Son of the Bride becomes an exercise in trying to predict when a preordained `` big moment '' will occur and not `` if . ''0.30556masc
170A solid piece of journalistic work that draws a picture of a man for whom political expedience became a deadly foreign policy .0.54167masc
181In The Pianist , Polanski is saying what he has long wanted to say , confronting the roots of his own preoccupations and obsessions , and he allows nothing to get in the way .0.72222masc
194With Dirty Deeds , David Caesar has stepped into the mainstream of filmmaking with an assurance worthy of international acclaim and with every cinematic tool well under his control -- driven by a natural sense for what works on screen .0.81944masc
230What 's not to like about a movie with a ` children 's ' song that includes the line ` My stepdad 's not mean , he 's just adjusting ' ?0.72222masc
231This English-language version ... does full honor to Miyazaki 's teeming and often unsettling landscape , and to the conflicted complexity of his characters .0.58333masc
240In its dry and forceful way , it delivers the same message as Jiri Menzel 's Closely Watched Trains and Danis Tanovic 's No Man 's Land .0.68056masc
249Beresford nicely mixes in as much humor as pathos to take us on his sentimental journey of the heart .0.62500masc
255Visually fascinating ... an often intense character study about fathers and sons , loyalty and duty .0.70833masc
\n", "
" ], "text/plain": [ " sentence \\\n", "0 The Rock is destined to be the 21st Century 's new `` Conan '' and that he 's going to make a splash even greater than Arnold Schwarzenegger , Jean-Claud Van Damme or Steven Segal . \n", "43 `` Auto Focus '' works as an unusual biopic and document of male swingers in the Playboy era \n", "44 If Mr. Zhang 's subject matter is , to some degree at least , quintessentially American , his approach to storytelling might be called Iranian . \n", "52 ( City ) reminds us how realistically nuanced a Robert De Niro performance can be when he is not more lucratively engaged in the shameless self-caricature of ` Analyze This ' ( 1999 ) and ` Analyze That , ' promised ( or threatened ) for later this year . \n", "90 Allen shows he can outgag any of those young whippersnappers making moving pictures today . \n", "98 It celebrates the group 's playful spark of nonconformity , glancing vividly back at what Hibiscus grandly called his ` angels of light . ' \n", "136 Writer\\/director Alexander Payne ( Election ) and his co-writer Jim Taylor brilliantly employ their quirky and fearless ability to look American angst in the eye and end up laughing . \n", "141 Pacino is the best he 's been in years and Keener is marvelous . \n", "146 So purely enjoyable that you might not even notice it 's a fairly straightforward remake of Hollywood comedies such as Father of the Bride . \n", "150 Robin Williams has thankfully ditched the saccharine sentimentality of Bicentennial Man in favour of an altogether darker side . \n", "153 Hoffman 's performance is authentic to the core of his being . \n", "168 Too often , Son of the Bride becomes an exercise in trying to predict when a preordained `` big moment '' will occur and not `` if . '' \n", "170 A solid piece of journalistic work that draws a picture of a man for whom political expedience became a deadly foreign policy . \n", "181 In The Pianist , Polanski is saying what he has long wanted to say , confronting the roots of his own preoccupations and obsessions , and he allows nothing to get in the way . \n", "194 With Dirty Deeds , David Caesar has stepped into the mainstream of filmmaking with an assurance worthy of international acclaim and with every cinematic tool well under his control -- driven by a natural sense for what works on screen . \n", "230 What 's not to like about a movie with a ` children 's ' song that includes the line ` My stepdad 's not mean , he 's just adjusting ' ? \n", "231 This English-language version ... does full honor to Miyazaki 's teeming and often unsettling landscape , and to the conflicted complexity of his characters . \n", "240 In its dry and forceful way , it delivers the same message as Jiri Menzel 's Closely Watched Trains and Danis Tanovic 's No Man 's Land . \n", "249 Beresford nicely mixes in as much humor as pathos to take us on his sentimental journey of the heart . \n", "255 Visually fascinating ... an often intense character study about fathers and sons , loyalty and duty . \n", "\n", " label gender \n", "0 0.69444 masc \n", "43 0.65278 masc \n", "44 0.52778 masc \n", "52 0.63889 masc \n", "90 0.76389 masc \n", "98 0.72222 masc \n", "136 0.75000 masc \n", "141 0.88889 masc \n", "146 0.79167 masc \n", "150 0.63889 masc \n", "153 0.73611 masc \n", "168 0.30556 masc \n", "170 0.54167 masc \n", "181 0.72222 masc \n", "194 0.81944 masc \n", "230 0.72222 masc \n", "231 0.58333 masc \n", "240 0.68056 masc \n", "249 0.62500 masc \n", "255 0.70833 masc " ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pd.set_option('display.max_colwidth', None)\n", "pd.set_option('display.max_rows', None)\n", "data[['sentence', 'label', 'gender']][data['gender'] == 'masc'][:20]" ] }, { "cell_type": "markdown", "id": "b544c0c9", "metadata": {}, "source": [ "## Look at distribution of data" ] }, { "cell_type": "code", "execution_count": 98, "id": "9eaa3478", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 98, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEGCAYAAABo25JHAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAs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4g0Dq0cSxdqR9kUEg7UOSzLX7LLQfMAikTpJ/n2Rjkr9K8tkk79vNqJp/ksFItJt3fOrv7qq9oFvP14BnD63/pUmu6ta1LslhXfuVSf44yTiDgemkWeWnDwlI8jLgTcAvMbiT+DoGA6qtYTCq6K3d+EL/DXht97DDgH/OYMCwMeDzwBuAYxgMLHYogzurL+qG2fgosLKqtib5dQZ3n/9Wt64FVbWs9w2VJmEQSAPHA1/qbvX/SZIvMxhpdFejan6xqrYDNyU5tGt7NfDZqnoU+EGSb3TtxzAYguSr3brmAX8/tK7P9bBN0rQYBNLUDmDqUTXh8SNRZoo+w8s3VNUrp1j+0BTtUu+8RiANXA28PsmB3S9GvQ74R6YeVXMq3wR+PYNfZzsM+OWufSOwKMkru3U9KckLetkSaQ8ZBBJQVesZnOe/AfgKgx+ReYCpR9Wcyp8BtzK4NvApBqNLUlUPA6cA53brup7BaSdp5Bx9VOokeVpV/SjJUxl8sl9VVdeNui6pb14jkHZak2Qpg4vEFxsCaoVHBJLUOK8RSFLjDAJJapxBIEmNMwgkqXEGgSQ17v8D3HmV/8CE+BwAAAAASUVORK5CYII=\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "%matplotlib inline\n", "import seaborn as sns\n", "\n", "sns.barplot(data=data, x='gender', y='label')" ] }, { "cell_type": "code", "execution_count": 99, "id": "379620ab", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 99, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZEAAAEGCAYAAACkQqisAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAVjUlEQVR4nO3dfbRddZ3f8feHZ8WRB0lTJNAwmsEFPoBmAIf6UHEBMkrQQQZHJShtbAcZnWo72mml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Hpe1pZ9F3hFmz6KjUfvj9A7DfiMleRAes9JOgD4YJK9geuBQ5K8sNXZMcnvAN8G5iZ5QVv9beNtc1AMkeH5H8B/T3IzT/zUcSxwe5JbgBcDF1Rv6JbTgWuT/BPwl8Nu7AAsBD6e5FZgf3rXRTblM8AdwE1Jbgf+mun3qRt6R6DbAre2Uxinjbg9W6K3Aye29/oqNj4T6G+A17TyVwI/b+W3Ao+nd9PJtLiwvjmSbE+v7++uqh8AH6B3/eRH9D6AXtj+H30TeFFVPUrv9NXftQvrDw61ve0CjSRJm80jEUlSZ4aIJKkzQ0SS1JkhIknqzBCRJHVmiEhbsCePHyVtaQwR6RkkyXT8Lo2mMUNEmiJJ/kuSu5L8Y5ILk3zwKUaoPTu9EZ3vHjvaaN/YPrdt5x+Af9a3/VckubZt64oku7fya5J8MskKeoM0SkPjpxZpCiT5XeAPgJfR+4b6TfQGGFxMb3Te1W28rE8Br2ur7Q78S3oD6C0DLgXeDOxDb6C92fS+tb+kDf9yDrCgqtYl+UN6oxq8u21ru6qaP/COSk9iiEhT4xDg8jYExaNJvkJvxN5NjVD75ar6FXBHktmt7NXAhVX1OPCDJFe18n3oDYuzvG1ra+D+vm19YQB9kp6SISINzlZMPEItPHFU10xQp3/5qqp65QTLfz5BuTRQXhORpsZ1wJuS7NCeNvdG4BdMPELtRL4B/GF6T3bcHfhXrfwuYFaSV7ZtbZtkv4H0RNoMhog0BarqRnrXNW4Fvk7vAVIPM/EItRP5ErCa3rWQC+iN1EpV/RI4BjijbesWeqfKpJFyFF9piiR5TlX9LMmz6R1RLKqqm0bdLmmQvCYiTZ3FSfald0F9qQGimcAjEUlSZ14TkSR1ZohIkjozRCRJnRkikqTODBFJUmf/H0dYGqY99ghaAAAAAElFTkSuQmCC\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "sns.countplot(data=data, x='gender')" ] }, { "cell_type": "code", "execution_count": 100, "id": "bd177487", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 100, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEGCAYAAACKB4k+AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAARvklEQVR4nO3debAlZX3G8e8Dw6KoIHBDkMEMKsHCFR0RJS4Ry7gyLrgroKTGVNzRRBIrmtKYSGLELTE1igpGjYoLo3EJYTMSRWcAQUBlChcGUUZFRC00o7/8cd55uQx34A7evn1n5vupOnW7336753d6zr3P6e7T70lVIUkSwHZjFyBJWjgMBUlSZyhIkjpDQZLUGQqSpG7R2AX8Lvbcc89asmTJ2GVI0hZl9erVP6qqqZmWbdGhsGTJElatWjV2GZK0RUny3U0t8/SRJKkzFCRJnaEgSeoMBUlSZyhIkjpDQZLUGQqSpM5QkCR1hoIkqdui72i+Jff/i5PHLmHBWP1PR45dgqQtgEcKkqTOUJAkdYaCJKkzFCRJnaEgSeoMBUlSZyhIkjpDQZLUGQqSpM5QkCR1hoIkqTMUJEmdoSBJ6gwFSVJnKEiSOkNBktQZCpKkzlCQJHWGgiSpMxQkSZ2hIEnqDAVJUmcoSJI6Q0GS1BkKkqRu0FBI8vIkFyf5epIPJdk5yX5Jzk2yJsmHk+zY+u7U5te05UuGrE2SdFODhUKSfYCXAEur6p7A9sAzgOOBE6rqbsA1wDFtlWOAa1r7Ca2fJGkeDX36aBFwmySLgNsCVwGPAE5py08Cntiml7V52vLDkmTg+iRJ0wwWClV1JfAm4HtMwuBaYDXw06pa37qtBfZp0/sAV7R117f+e2y83STLk6xKsmrdunVDlS9J26QhTx/dkcm7//2AOwG7AI/+XbdbVSuqamlVLZ2amvpdNydJmmbI00ePBL5dVeuq6v+AjwOHAru100kAi4Er2/SVwL4AbfmuwI8HrE+StJEhQ+F7wCFJbtuuDRwG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2XOLa8pDGdXbhi76egNjUnuAlxeVW8DTmXybvcM4KlJ9mh9dp/fUkf3eeDFaW+nkhw0cj1bq58B307yVIBM3Kct+w5w/zZ9ODcc2V7H5PSdbkaSg5l8F8xBwCuT7Ad8GTg0yd1an12S/CHwDWBJkru21Z850zbHYigM5x+Bf0hyPjd+V/E04OtJLgDuCZxck+E83gCcneRrwJvnu9iRvZ7JH6EL22H660euZ2v2bOCY9jq7mBu+s+RdwMNa+4OAX7T2C4HftA9AbDMXmjdHkp2Y7L/nV9X3gVcwuf7wIyZvCD+U5ELaqaOqup7J6aL/bBearx6l8E1wmAtJUueRgiSpMxQkSZ2hIEnqDAVJUmcoSJI6Q0GaJxuPLyQtRIaCtEAl2VbvxNaIDAVpBkn+Jsk3k3wxyYeSvPIWRhh9Wyaj4V6+4Wig3TH8jrad/wZ+b9r275/k7LatzyfZu7WfleQtSVYxGdxPmle+E5E2kuQBwFOA+zC50/o8JgPKrWAySutlbVymfwUe0VbbG/gjJoOdrQROAZ4EHMBkULS9gEuA9yTZgcloucuqal2SpzO5o/35bVs7VtXSwZ+oNANDQbqpQ4FT23AE1yf5FJORW29uhNFPVtVvgUuS7NXaHgp8qKp+A3w/yRmt/QAmQ5yc1ra1PXDVtG19eIDnJM2KoSDNznZseoRRuPGImtlEn+nLL66qB21i+S820S4NzmsK0k2dAzwhyc7tm7IeD/ySTY8wuilfAJ6eZPt2zeCPW/s3gakkD2rb2iHJPQZ5JtJmMhSkjVTVV5lcF7gQ+CyTL+65lk2PMLopnwAuY3It4WQmo2RSVb8GjgCOb9u6gMmpKWl0jpIqzSDJ7arq50luy+Qd//KqOm/suqSheU1BmtmKJAcyucB8koGgbYVHCpKkzmsKkqTOUJAkdYaCJKkzFCRJnaEgSer+H7cvxSsW7kGkAAAAAElFTkSuQmCC\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "sns.countplot(data=data[data['gender']!='none'], x='gender')" ] }, { "cell_type": "markdown", "id": "c675abea", "metadata": {}, "source": [ "## Subsample for 400 from each category (masc, femm, neut)" ] }, { "cell_type": "code", "execution_count": 17, "id": "fc4a6180", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
indexsentencelabeltokenstreesplitgender
08204As pedestrian as they come .0.18056As|pedestrian|as|they|come|.10|9|9|8|7|7|8|11|10|11|0trainneut
12150Oft-described as the antidote to American Pie-...0.33333Oft-described|as|the|antidote|to|American|Pie-...55|54|53|53|52|51|50|49|49|48|47|46|43|41|41|4...testneut
23960I have a confession to make : I did n't partic...0.25000I|have|a|confession|to|make|:|I|did|n't|partic...44|43|42|41|40|40|45|39|36|36|37|34|34|32|31|3...trainmasc
31308Either a fascinating study of the relationship...0.50000Either|a|fascinating|study|of|the|relationship...42|38|37|37|36|34|34|33|33|40|30|30|31|28|27|2...trainfemm
42272Manages to please its intended audience -- chi...0.72222Manages|to|please|its|intended|audience|--|chi...35|33|31|29|28|28|27|26|26|25|23|22|22|21|20|1...trainneut
........................
11675807( Janey ) forgets about her other obligations ...0.23611(|Janey|)|forgets|about|her|other|obligations|...74|73|73|69|68|67|66|66|70|65|64|62|62|61|57|5...trainfemm
11687125It 's a frightful vanity film that , no doubt ...0.11111It|'s|a|frightful|vanity|film|that|,|no|doubt|...43|41|39|38|37|37|36|35|33|33|32|30|30|29|27|2...trainneut
1169143It 's a hoot and a half , and a great way for ...0.79167It|'s|a|hoot|and|a|half|,|and|a|great|way|for|...67|64|58|58|59|57|57|61|62|55|54|54|53|52|51|5...testmasc
11704452Eventually , they will have a showdown , but ,...0.18056Eventually|,|they|will|have|a|showdown|,|but|,...61|60|52|51|50|49|49|53|54|55|47|47|46|44|44|4...trainneut
11712812Instead , she sees it as a chance to revitaliz...0.68056Instead|,|she|sees|it|as|a|chance|to|revitaliz...41|40|39|36|36|35|34|33|32|31|30|28|28|27|26|2...trainfemm
\n", "

1172 rows × 7 columns

\n", "
" ], "text/plain": [ " index sentence label \\\n", "0 8204 As pedestrian as they come . 0.18056 \n", "1 2150 Oft-described as the antidote to American Pie-... 0.33333 \n", "2 3960 I have a confession to make : I did n't partic... 0.25000 \n", "3 1308 Either a fascinating study of the relationship... 0.50000 \n", "4 2272 Manages to please its intended audience -- chi... 0.72222 \n", "... ... ... ... \n", "1167 5807 ( Janey ) forgets about her other obligations ... 0.23611 \n", "1168 7125 It 's a frightful vanity film that , no doubt ... 0.11111 \n", "1169 143 It 's a hoot and a half , and a great way for ... 0.79167 \n", "1170 4452 Eventually , they will have a showdown , but ,... 0.18056 \n", "1171 2812 Instead , she sees it as a chance to revitaliz... 0.68056 \n", "\n", " tokens \\\n", "0 As|pedestrian|as|they|come|. \n", "1 Oft-described|as|the|antidote|to|American|Pie-... \n", "2 I|have|a|confession|to|make|:|I|did|n't|partic... \n", "3 Either|a|fascinating|study|of|the|relationship... \n", "4 Manages|to|please|its|intended|audience|--|chi... \n", "... ... \n", "1167 (|Janey|)|forgets|about|her|other|obligations|... \n", "1168 It|'s|a|frightful|vanity|film|that|,|no|doubt|... \n", "1169 It|'s|a|hoot|and|a|half|,|and|a|great|way|for|... \n", "1170 Eventually|,|they|will|have|a|showdown|,|but|,... \n", "1171 Instead|,|she|sees|it|as|a|chance|to|revitaliz... \n", "\n", " tree split gender \n", "0 10|9|9|8|7|7|8|11|10|11|0 train neut \n", "1 55|54|53|53|52|51|50|49|49|48|47|46|43|41|41|4... test neut \n", "2 44|43|42|41|40|40|45|39|36|36|37|34|34|32|31|3... train masc \n", "3 42|38|37|37|36|34|34|33|33|40|30|30|31|28|27|2... train femm \n", "4 35|33|31|29|28|28|27|26|26|25|23|22|22|21|20|1... train neut \n", "... ... ... ... \n", "1167 74|73|73|69|68|67|66|66|70|65|64|62|62|61|57|5... train femm \n", "1168 43|41|39|38|37|37|36|35|33|33|32|30|30|29|27|2... train neut \n", "1169 67|64|58|58|59|57|57|61|62|55|54|54|53|52|51|5... test masc \n", "1170 61|60|52|51|50|49|49|53|54|55|47|47|46|44|44|4... train neut \n", "1171 41|40|39|36|36|35|34|33|32|31|30|28|28|27|26|2... train femm \n", "\n", "[1172 rows x 7 columns]" ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "subbed_data = []\n", "for genderword in ['masc', 'femm', 'neut']:\n", " local_data = data[data['gender'] == genderword]\n", " if local_data.shape[0] < 400:\n", " subbed_data.append(local_data)\n", " else:\n", " subbed_data.append(local_data.sample(n=400, replace=False))\n", " \n", "# shuffle data using '.sample(frac=1)'\n", "subsample_data = pd.concat(subbed_data).sample(frac=1).reset_index()\n", "\n", "\n", "pd.reset_option('^display.', silent=True)\n", "\n", "subsample_data" ] }, { "cell_type": "markdown", "id": "68dd053c", "metadata": {}, "source": [ "## Sample 99 sentences for each annotator as test run" ] }, { "cell_type": "code", "execution_count": 22, "id": "c6a11844", "metadata": {}, "outputs": [], "source": [ "idx = 0\n", "c = 99 # count\n", "for annotator in ['katy', 'fatma', 'anna', 'nathan', 'aashka']:\n", " subset = subsample_data.loc[idx:idx+c, ['index', 'sentence', 'label', 'gender']]\n", " subset.to_csv(f\"sentiment-bias-annotations_{annotator}_{idx}-{idx+c}.csv\", float_format='{:,.2f}'.format, index_label='annotation_index')\n", " idx += int(c/3)" ] }, { "cell_type": "markdown", "id": "a9b8639b", "metadata": {}, "source": [ "## Prepare rest of annotations" ] }, { "cell_type": "code", "execution_count": 13, "id": "416bcaa3", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "total_datapoints 787\n", "total_annotations 2361\n", "annotations_per_person 590.25\n", "completed_annotations 396\n", "remaining_annotations_per_person 491.25\n" ] } ], "source": [ "rawdata = pd.read_csv('sentiment_data_for_annotation.csv')\n", "\n", "info = {\n", " 'total_datapoints': rawdata.shape[0],\n", " 'total_annotations': rawdata.shape[0] * 3,\n", " 'annotations_per_person': rawdata.shape[0] * 3/4,\n", " 'completed_annotations': 99*4,\n", " 'remaining_annotations_per_person': (rawdata.shape[0] * 3 - 99*4)/4\n", "}\n", "\n", "for key, val in info.items():\n", " print(key, val)" ] }, { "cell_type": "code", "execution_count": 18, "id": "32c173b8", "metadata": {}, "outputs": [], "source": [ "c = 591\n", "start = 0\n", "total = rawdata.shape[0]\n", "\n", "for annotator in ['katy', 'fatma', 'anna', 'nathan']:\n", " end = start + c\n", " subset = rawdata.loc[start:end, ['index', 'sentence', 'label', 'gender']]\n", " \n", " if end > total:\n", " looped_idx = end - total\n", " second_subset = rawdata.loc[:looped_idx, ['index', 'sentence', 'label', 'gender']]\n", " subset = pd.concat([subset, second_subset])\n", " end = looped_idx\n", " \n", " subset.to_csv(f\"sst-annotations-v3_{annotator}_{start}-{end}.csv\", \n", " float_format='{:,.2f}'.format, \n", " index_label='annotation_index')\n", " start += int(c/3)" ] }, { "cell_type": "code", "execution_count": null, "id": "42736e58", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "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.7.11" } }, "nbformat": 4, "nbformat_minor": 5 }