nlp-lab/Project/Tools/EmojiCounting.ipynb
2018-07-27 15:18:34 +02:00

280 lines
17 KiB
Plaintext

{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"%matplotlib inline"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Count emoji occurences"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import numpy as np\n",
"import json\n",
"import glob\n",
"import matplotlib\n",
"import matplotlib.pyplot as plt\n",
"from __future__ import unicode_literals\n"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"json_root = \"./emoji_counts/\""
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"json_files = sorted(glob.glob(json_root + \"/*.json\"))"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['./emoji_counts/twitter_emoji_count_2017-12.json',\n",
" './emoji_counts/twitter_emoji_count_2017_11.json']"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"json_files"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"json_lists = []"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"for path in json_files:\n",
" with open(path) as f:\n",
" data = json.load(f)\n",
" json_lists.append(data)"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"merged_dict = {}\n"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"for j in json_lists:\n",
" for emoji in j.keys():\n",
" if emoji in merged_dict:\n",
" merged_dict[emoji] = merged_dict[emoji] + j[emoji]\n",
" else:\n",
" merged_dict[emoji] = j[emoji]"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"n_top = 50"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"keysort = np.argsort(list(merged_dict.values()))[-n_top:]"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"# for apple:\n",
"from matplotlib.font_manager import FontProperties\n",
"\n",
"prop = FontProperties(fname='/System/Library/Fonts/Apple Color Emoji.ttc')\n",
"plt.rcParams['font.family'] = prop.get_family()"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAmwAAAEzCAYAAACMpV+aAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3Xm4XFWZ7/HvCwHEAcMQkZtgJ0KuGm0b5DTEqZ0aiCMqitAtRBuNA9g4dQtOYbBttVtpUOSKguKI6FVBRDEiXrTvgxKcELhqHElECDO2gg2894+1yuyUdc6pk5yTs8L5fp6nnlO1atVee+1ae9ev9lAnMhNJkiS1a4vpngFJkiSNzcAmSZLUOAObJElS4wxskiRJjTOwSZIkNc7AJkmS1DgDmyRJUuMMbJIkSY0zsEmSJDXOwCZJktS4WdM9A5Ntp512yvnz50/3bEiSJI3rsssuuz4z54xXb6jAFhG/BG4D7gLuzMyRiNgB+DQwH/glcFBm3hQRAZwEPA34PfCizPxunc5S4M11sm/LzDNr+V7AR4BtgfOBozIzR2tjrHmdP38+K1euHKZbkiRJ0yoifjVMvYkcEn1SZu6RmSP18dHAhZm5ELiwPgZ4KrCw3pYBp9YZ2gFYDuwD7A0sj4jt62tOBV7aed2ScdqQJEmaMTbmHLYDgD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JjmNpSrAbttP2Ky+8K6LxYvo3yYbEH5MPgKsP8kbSOmZZ2eoWNxxvV5gmOn6TE2wT7Po1xx/TXKF5FXA/caUG9XymdPr95r6LsqvIWb/0tUksYREVtRDqU8nRLgrgROynp+kyRNNQObJElS4/wdNkmSpMYZ2CRJkhpnYJMkSWqcgU2SJKlxBjZJkqTGGdgkSZIa9/8B2268VM3NT9sAAAAASUVORK5CYII=\n",
"text/plain": [
"<Figure size 720x360 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"#matplotlib.rc('font', family='Arial')\n",
"plt.figure(figsize=(10,5))\n",
"plt.bar(np.array(list(merged_dict.keys()))[keysort], np.array(list(merged_dict.values()))[keysort], color='g')\n",
"plt.savefig(\"histogram.png\", bbox_inches='tight')\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([106, 14, 46, 41, 74, 91, 87, 104, 69, 11, 52, 81, 15,\n",
" 38, 16, 27, 65, 66, 28, 1, 57, 31, 55, 53, 33, 21,\n",
" 2, 59, 29, 6, 32, 34, 13, 49, 37, 54, 40, 10, 4,\n",
" 23, 50, 25, 8, 17, 5, 24, 7, 9, 3, 0])"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"keysort"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array(['🤔', '🤣', '💕', '😚', '🤦', '😓', '😥', '🙄', '😻', '😣', '😛', '😝', '😃',\n",
" '😐', '😈', '😡', '😞', '😪', '😑', '😕', '😬', '😱', '😇', '😄', '😆', '😴',\n",
" '🙈', '😜', '😤', '😫', '😳', '😋', '😀', '😌', '😏', '😔', '😒', '😎', '😢',\n",
" '😅', '😁', '😉', '🙌', '🙏', '😘', '😊', '😩', '😍', '😭', '😂'], dtype='<U1')"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"np.array(list(merged_dict.keys()))[keysort]"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'🤔🤣💕😚🤦😓😥🙄😻😣😛😝😃😐😈😡😞😪😑😕😬😱😇😄😆😴🙈😜😤😫😳😋😀😌😏😔😒😎😢😅😁😉🙌🙏😘😊😩😍😭😂'"
]
},
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"''.join(np.array(list(merged_dict.keys()))[keysort])"
]
}
],
"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.6.5"
}
},
"nbformat": 4,
"nbformat_minor": 2
}