Examen parcial 2

parent 75129cdd
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Examen 2\n",
"\n",
"Responda a las siguentes preguntas. Tiene 24 horas para entregar la solución de todo el examen en formato de notebook, en su propia rama. Pasadas las 24 horas se descontará 1 punto por hora extra hasta un máximo de 5 horas.\n",
"\n",
"Los criterios para la evaluación de cada pregunta incluyen:\n",
"\n",
"* 80% de la puntuación si cumple cabalmente con la consigna y funciona;\n",
"* 20% de la puntuación si la solución cumple el paradigma orientado a objetos, la lógica es puntual, con buen estilo e incluye docstring."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## I. Matriz Documento-Término\n",
"\n",
"Una colección de $n$ documentos indexados por $m$ términos puede ser representada por una matriz $M_{[n x m]}$ conocida como matriz documento-término donde el valor de cada elemento $a_{ij}$ define la importancia del término $j$ en el documento $i$.\n",
"\n",
"La figura 1 muestra una matriz documento-término muy simple, donde cada columna representa un término en la colección, cada renglón un documento y cada celda o elemento de la matriz la ocurrencia del término en el documento. En ella podemos ver que el término 1 aparece en el documento 1 y 3, pero no en los otros dos documentos.\n",
"\n",
"\n",
" Término1 Término 2 Término 3\n",
" Documento1 1 0 0\n",
" Documento2 0 0 1\n",
" Documento3 1 1 1\n",
" Documento4 0 1 0\n",
"\n",
" Figura 1 – Matriz documento-termino simple.\n",
"\n",
"\n",
"### (4 puntos)\n",
"\n",
"* Defina la clase MatrizDT( ) cuyo constructor recibe una lista de documentos ([texto1, texto2, ...]) y tiene los siguientes métodos:\n",
"\n",
" * tf( ) que calcula una matriz documento-término donde cada celda $a_{ij}$ tiene el valor de la frecuencia de término : $ 1+ \\log Count(t_j, d_i) $ si $Count(t_j, d_i) > 0$; ó $0$ cuando el término $t_j$ no aparece en el documento $i$.\n",
"\n",
" * idf( ) que calcula una matriz documento-término donde cada celda $a_{ij}$ tiene el valor de la frecuencia inversa del término : $ \\log (\\frac{n}{df_t}) $ en donde $n$ es el número total de documentos y df_t es el número de textos en los cuales aparece el término $t$.\n",
"\n",
" * tf-idf( ) que calcula una matriz documento-término donde cada celda $a_{ij}$ tiene el producto de la frecuencia de término y de la frecuencia inversa del término. Es decir, el producto, por elemento, de las matrices anteriores.\n",
"\n",
"\n",
"\n",
"#### Observaciones\n",
"\n",
"* Utilice numpy y pandas para manipular los datos mediante estructuras de arregos y arreglos de arreglos;\n",
"\n",
"\n",
"* Utilice pandas para mostrar las matrices en el notebook;\n",
"\n",
"* No utilice modulos que generen directamente la matriz documento-término ni reutilice código que no haya sido programado por usted y que no sea capaz de explicar.\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 27,
"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>hello</th>\n",
" <th>omg</th>\n",
" <th>pony</th>\n",
" <th>she</th>\n",
" <th>there</th>\n",
" <th>went</th>\n",
" <th>why</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>1.00000</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>1.30103</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>0.00000</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>1.0</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" hello omg pony she there went why\n",
"0 1.00000 0.0 0.0 0.0 1.0 0.0 1.0\n",
"1 1.30103 1.0 1.0 0.0 0.0 0.0 0.0\n",
"2 0.00000 1.0 0.0 1.0 1.0 1.0 0.0"
]
},
"execution_count": 27,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import math\n",
"import pandas as pd \n",
"import numpy as np\n",
"from sklearn.feature_extraction.text import CountVectorizer \n",
"\n",
"class MatrizDT:\n",
" '''\n",
" Clase que se encarga de calcular datos en relación con relación a un texto. Para saber el número de veces que una palabra\n",
" se repite en el, entre otros cálculos necesarios para el conocimiento de estas palabras.\n",
" \n",
" Args:\n",
" Array:['texto 1','texto 2',' texto 3']\n",
" \n",
" Example:\n",
" >>>textos=['why hello there', 'omg hello hello pony', 'she went there? omg']\n",
" >>>c.MatrizDT(textos)\n",
" >>>print(c)\n",
" '''\n",
" def __init__(self,d):\n",
" '''\n",
" Este es un constructor que se encarga de inicializar un objeto de la clase MatrizDT. Dicha función se encarga de\n",
" precargar todas las funciones mencionadas en la clase y asignarlas a variables de la clase. Esto se hizo de esta manera\n",
" debido a que al momento de calcular la función tfidf(), seria necesario calcular las dos variables anteriores de nuevo\n",
" si las funciones tuvieran el cálculo de cada variable. Entonces al llamar a la función tf() se hace un cálculo, si \n",
" se llama a la función idf() se hace un segundo cálculo, pero al llamar a la tercera función tfidf() esta tendría que \n",
" hacer el calculo de la primera función, el cálculo de la segunda y despues hacer el cálculo de la tercera, creando \n",
" uso de memoria adicional en la tercera función.\n",
" Al precargar todo desde el constructor, se cargan los tres cálculos desde el inicio, y al llamar las diferentes\n",
" funciones no es necesario precargar los datos adicionales del objeto.\n",
" \n",
" Args:\n",
" docs: un Array que contenga uno o más strings\n",
" \n",
" Ejemplo:\n",
" >>>docs = ['why hello there', 'omg hello hello pony', 'she went there? omg']\n",
" >>>c=MatrizDT(docs)\n",
" #Para ver algun cálculo es necesario pedirlo a traves de una formula\n",
" \n",
" '''\n",
" self.documentos=d\n",
" vec = CountVectorizer()\n",
" x = vec.fit_transform(self.documentos)\n",
" \n",
" #primera función\n",
" matriz=np.array(x.toarray(),dtype=float)\n",
" for i in range(len(matriz)):\n",
" for j in range(len(matriz[0])):\n",
" if(matriz[i,j]!=0):\n",
" matriz[i][j]=1+math.log(matriz[i][j],10)\n",
" self.vtf= pd.DataFrame(matriz, columns=vec.get_feature_names())\n",
" \n",
" #segunda función\n",
" n=len(self.documentos)\n",
" res=np.zeros((len(matriz),len(matriz[0])))\n",
" for i in range(len(matriz[0])):\n",
" df_t=0\n",
" for j in range(len(matriz)):\n",
" if(matriz[j][i] !=0):\n",
" df_t +=1\n",
" val=math.log((n/df_t),10)\n",
" for k in range(len(matriz)):\n",
" res[k][i]=val\n",
" self.vidf = pd.DataFrame(res, columns=vec.get_feature_names())\n",
" \n",
" #tercera función\n",
" res2=np.zeros((len(matriz),len(matriz[0])))\n",
" for i in range(len(matriz)):\n",
" for j in range(len(matriz[0])):\n",
" res2[i][j]=matriz[i][j]*res[i][j]\n",
" self.vtfidf=pd.DataFrame(res2, columns=vec.get_feature_names())\n",
" \n",
" \n",
" def tf(self):\n",
" '''\n",
" Calcula cada frecuencia de termino por la siguiente función: 1 + log count(tj,di) siempre y cuando count(tj,di) sea \n",
" mayor a cero, en caso contrario solo deja el cero.\n",
" \n",
" Args: NA\n",
" \n",
" Ejemplo:\n",
" >>>c.tf()\n",
" \thello\tomg\tpony\tshe\tthere\twent\twhy\n",
" 0\t1.00000\t0.0\t0.0\t0.0\t1.0\t0.0\t1.0\n",
" 1\t1.30103\t1.0\t1.0\t0.0\t0.0\t0.0\t0.0\n",
" 2\t0.00000\t1.0\t0.0\t1.0\t1.0\t1.0\t0.0\n",
" '''\n",
" return self.vtf\n",
" \n",
" def idf(self):\n",
" '''\n",
" Calcula la matriz donde cada celda tiene el valor de la frecuencia inversa del término: log(n/dft) donde n es el \n",
" número total de documentos y dft es el número de textos en los cuales aparece el término t.\n",
" \n",
" Args: NA\n",
" \n",
" Ejemplo:\n",
" >>>c.idf()\n",
" \thello\tomg\tpony\tshe\tthere\twent\twhy\n",
" 0\t0.176091\t0.176091\t0.477121\t0.477121\t0.176091\t0.477121\t0.477121\n",
" 1\t0.176091\t0.176091\t0.477121\t0.477121\t0.176091\t0.477121\t0.477121\n",
" 2\t0.176091\t0.176091\t0.477121\t0.477121\t0.176091\t0.477121\t0.477121\n",
" '''\n",
" return self.vidf\n",
" \n",
" def tfidf(self):\n",
" '''\n",
" Calcula el producto de la frecuencia de término y de la frecuencia inversa del término. Osea el producto por elemento \n",
" de las dos funciones anteriores.\n",
" \n",
" Args: NA\n",
" \n",
" Ejemplo:\n",
" >>>c.tfidf()\n",
" \thello\tomg\tpony\tshe\tthere\twent\twhy\n",
" 0\t0.176091\t0.000000\t0.000000\t0.000000\t0.176091\t0.000000\t0.477121\n",
" 1\t0.229100\t0.176091\t0.477121\t0.000000\t0.000000\t0.000000\t0.000000\n",
" 2\t0.000000\t0.176091\t0.000000\t0.477121\t0.176091\t0.477121\t0.000000\n",
" '''\n",
" return self.vtfidf\n",
" \n",
" \n",
"docs = ['why hello there', 'omg hello hello pony', 'she went there? omg']\n",
"c=MatrizDT(docs)\n",
"c.tf()"
]
},
{
"cell_type": "code",
"execution_count": 26,
"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>hello</th>\n",
" <th>omg</th>\n",
" <th>pony</th>\n",
" <th>she</th>\n",
" <th>there</th>\n",
" <th>went</th>\n",
" <th>why</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>0.176091</td>\n",
" <td>0.176091</td>\n",
" <td>0.477121</td>\n",
" <td>0.477121</td>\n",
" <td>0.176091</td>\n",
" <td>0.477121</td>\n",
" <td>0.477121</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>0.176091</td>\n",
" <td>0.176091</td>\n",
" <td>0.477121</td>\n",
" <td>0.477121</td>\n",
" <td>0.176091</td>\n",
" <td>0.477121</td>\n",
" <td>0.477121</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>0.176091</td>\n",
" <td>0.176091</td>\n",
" <td>0.477121</td>\n",
" <td>0.477121</td>\n",
" <td>0.176091</td>\n",
" <td>0.477121</td>\n",
" <td>0.477121</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" hello omg pony she there went why\n",
"0 0.176091 0.176091 0.477121 0.477121 0.176091 0.477121 0.477121\n",
"1 0.176091 0.176091 0.477121 0.477121 0.176091 0.477121 0.477121\n",
"2 0.176091 0.176091 0.477121 0.477121 0.176091 0.477121 0.477121"
]
},
"execution_count": 26,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"docs = ['why hello there', 'omg hello hello pony', 'she went there? omg']\n",
"c=MatrizDT(docs)\n",
"c.idf()"
]
},
{
"cell_type": "code",
"execution_count": 25,
"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>hello</th>\n",
" <th>omg</th>\n",
" <th>pony</th>\n",
" <th>she</th>\n",
" <th>there</th>\n",
" <th>went</th>\n",
" <th>why</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>0.176091</td>\n",
" <td>0.000000</td>\n",
" <td>0.000000</td>\n",
" <td>0.000000</td>\n",
" <td>0.176091</td>\n",
" <td>0.000000</td>\n",
" <td>0.477121</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>0.229100</td>\n",
" <td>0.176091</td>\n",
" <td>0.477121</td>\n",
" <td>0.000000</td>\n",
" <td>0.000000</td>\n",
" <td>0.000000</td>\n",
" <td>0.000000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>0.000000</td>\n",
" <td>0.176091</td>\n",
" <td>0.000000</td>\n",
" <td>0.477121</td>\n",
" <td>0.176091</td>\n",
" <td>0.477121</td>\n",
" <td>0.000000</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" hello omg pony she there went why\n",
"0 0.176091 0.000000 0.000000 0.000000 0.176091 0.000000 0.477121\n",
"1 0.229100 0.176091 0.477121 0.000000 0.000000 0.000000 0.000000\n",
"2 0.000000 0.176091 0.000000 0.477121 0.176091 0.477121 0.000000"
]
},
"execution_count": 25,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"docs = ['why hello there', 'omg hello hello pony', 'she went there? omg']\n",
"c=MatrizDT(docs)\n",
"c.tfidf()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## II. Nubes de palabras\n",
"\n",
"Una nube de palabras o nube de etiquetas es una representación visual de las palabras que conforman un documento o una colección de documentos, en donde el tamaño es mayor para las palabras que son más \"importantes\" según un criterio dado. Son muy útiles para visualizar las palabras clave del contenido o para visualizar las ideas principales de un tema. La figura 2 muestra un ejemplo de nube de palabras extraida de \"Don Quijote\" es el sguiente:\n",
"\n",
"\n",
"<img crossorigin=\"anonymous\" src=\"https://upload.wikimedia.org/wikipedia/commons/thumb/2/2a/Nube_de_etiquetas_-_Don_Quijote_de_la_Mancha.png/320px-Nube_de_etiquetas_-_Don_Quijote_de_la_Mancha.png\" class=\"png mw-mmv-dialog-is-open\" width=\"245\" height=\"145\">\n",
"\n",
" Figura 2 – Nube de etiquetas para el primer capítulo de Don Quijote de la Mancha.\n",
"\n",
"\n",
"\n",
"### (4 puntos)\n",
"\n",
"* Defina la clase NubePalabras() cuyo constructor recibe un diccionario cuyas llaves son palabras y cuyos valores son de tipo numérico y representan la \"importancia de la palabras\" e incluya el método plot_cloud() para generar la visualización utilizando Matplotlib tanto para controlar los aspectos visuales de la nube de palabras como para generar la figura.\n",
"\n",
"* Defina el método store_cloud('/algun/nombre/archivo.jpg') para guardar la figura en un archivo .jpg.\n",
"\n",
"* Modifique el constructor para aceptar un argumento opcional llamado \"stopwords\" que es una lista de palabras que no deben considerarse para la visuación. Si \"stopwords\" no es proporcionado al constructor, utilice por defaul una lista con las preposiciones y los verbos más comunes en español.\n",
"\n",
"\n",
"#### Observaciones\n",
"\n",
"* Las palabras deben de mostrarse en horizontal;\n",
"\n",
"* el tamaño de la letra debe refleja la importancia;\n",
"\n",
"* La disposición de las palabras puede se aleatoria pero las palabras más importantes deberían ocupar lugares centrales de la figura resultante;\n",
"\n",
"* El color de las palabras puede se aleatorio pero se aprecia una paleta de colores que se vean bien juntos;\n",
"\n",
"* El tamaño de la figura resultante debe ser apropiado para un monitor promedio, ni muy grande ni muy pequeño;\n",
"\n",
"* No utilice modulos de nubes de palabras ni reutilice código que no haya sido programado por usted y que no sea capaz de explicar.\n"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAADhCAYAAADGdn6kAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGx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mTEIvJfSym/1ZJPCiEKafmFgFNaeii8j0eAJ4UQB7Ec2F4PmAjkFkJYQ13Y2pVqs5afCzgbQHuPAkel5UxisPzkrUpo3+MGwAEp5Wkp5W3gWyz3PVTvsS2e3tdQuN8IIToDzYHntC8oCE2b78cyANimPYNFgM1CiHtc2BUwe4Mt9BuBUtqqhUxYJqyWBNkmhBACyyHnu6WUH9hkLQGsM+OdsPjurekdtdn1h4CLNj+TA4KUcqiUsk/70q8AAAFiSURBVIiUsgSW+/iTlPI5YC3QSsdm63tppZUP2ChPSnkCOCKEKK0l1Qd2EcL3GIvL5iEhRDbtM2K1OSTvcRo8va+rgDghRB7tl0yclhYwhBCNsbgin5RSXrPJWgK01VY1lQRKAX8RRD2RUu6QUhaQUpbQnsGjWBZ0nCAU7rG/Jio8mNBoimVVyz5gWLDt0Wx6FMtP2+3AVu1fUyz+1TXAXuBHIK9WXgAfae9hBxAbZPvrcGfVzX1YHoJEYAGQWUvPol0navn3BcHOykCCdp+/w7LyIKTvMTAS+Af4G5iFZeVHSN1jYA6WOYTbWASnqzf3FYtfPFH71yUINidi8WFbn8GPbcoP02zeAzSxSQ+InjizN03+Qe5Mxgb9HqudsQqFQhHhBNt1o1AoFAo/o4ReoVAoIhwl9AqFQhHhKKFXKBSKCEcJvUKhUEQ4SugVCoUiwlFCr1AoFBGOEnqFQqGIcP4P9kblNp2YjakAAAAASUVORK5CYII=\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from os import path \n",
"from scipy.misc import imread \n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"#import random \n",
"from wordcloud import WordCloud, STOPWORDS \n",
"\n",
"class NubePalabras():\n",
" '''\n",
" Clase que se encarga de tomar el texto requerido para crear la nube de palabras, ta bien se le puede agregar las palabras\n",
" que se quieran omitir para evitarlas en la nube.\n",
" \n",
" Args:\n",
" diccionario: Palabras en un arreglo de arreglos cuyo arreglo principal consta de la palabra y el número de importancia\n",
" de esta\n",
" stopwords: lista de palabras a evitar en el escrito\n",
" \n",
" Ejemplo:\n",
" >>>text =[('quijote', 5),('primera', 4),('don', 3),('novela', 3),('parte', 3),('obra', 3),('título', 2),\n",
" >>>('ingenioso', 2),('mancha', 2),('1605', 2)]\n",
" >>>stopwords=stopwords={'a','ante','cabe','con','contra','de','desde'}\n",
" \n",
" >>>c=NubePalabras(text,stopwords)\n",
" '''\n",
" text=\"\"\n",
" wordcloud=\"\"\n",
" \n",
" def __init__(self,diccionario,stopwords={'a','ante','cabe','con','contra','de','desde','en','entre','el','hacia','para',\n",
" 'por','segun','si','sobre','tras'}):\n",
" '''\n",
" Clase constructor que toma el diccionario y el stopwords del objeto para sus futuros usos. El constructor tambien crea\n",
" la variable wordcloud y la almacena en la clase. Ya que esta variable es necesaria para la creación de contenido de las \n",
" demas funciones.\n",
" \n",
" Args:\n",
" diccionario: Palabras en un arreglo de arreglos cuyo arreglo principal consta de la palabra y el número de \n",
" importancia de esta\n",
" stopwords: lista de palabras a evitar en el escrito\n",
" \n",
" Ejemplo:\n",
" >>>text =[('quijote', 5),('primera', 4),('don', 3),('novela', 3),('parte', 3),('obra', 3),('título', 2),\n",
" >>>('ingenioso', 2),('mancha', 2),('1605', 2)]\n",
" >>>stopwords=stopwords={'a','ante','cabe','con','contra','de','desde'}\n",
" >>>c=NubePalabras(text,stopwords)\n",
" '''\n",
" self.stopwords=stopwords\n",
" #print(diccionario)\n",
" for i in diccionario:\n",
" #print(i[0])\n",
" for j in range(len(diccionario[0])):\n",
" if(type(i[j]) == int):\n",
" #print(i[j])\n",
" for k in range(i[j]):\n",
" self.text +=i[0]+' '\n",
" #print(self.text)\n",
" self.wordcloud = WordCloud( \n",
" background_color=\"white\",\n",
" max_words=50, \n",
" width=1500, \n",
" height=850 , \n",
" prefer_horizontal = 1 ,\n",
" #relative_scaling = .5, \n",
" stopwords=self.stopwords\n",
" ).generate(self.text)\n",
" \n",
" def plot_cloud(self):\n",
" '''\n",
" Función que muestra el resultado de la nube de palabras dentro del jupyter\n",
" \n",
" Args:\n",
" Ninguno, ya que al crear el objeto este deberá tener \n",
" \n",
" Example:\n",
" >>>text =[('quijote', 5),('primera', 4),('don', 3),('novela', 3),('parte', 3),('obra', 3),('título', 2),\n",
" >>>('ingenioso', 2),('mancha', 2),('1605', 2)]\n",
" >>>stopwords=stopwords={'a','ante','cabe','con','contra','de','desde'}\n",
" >>>c=NubePalabras(text,stopwords)\n",
" >>>c.plot_cloud()\n",
" #Se visualiza la nube de palabras\n",
" '''\n",
" wordcloud=self.wordcloud\n",
" plt.imshow(wordcloud) \n",
" plt.show()\n",
" #self.wordcloud=wordcloud\n",
"\n",
" def store_cloud(self):\n",
" '''\n",
" Función que almacena la nube de palabras generada por la clase en un archivo .jpg\n",
" \n",
" Args:\n",
" Ninguno, ya que al crear el objeto este tiene los valores que necesita para implementar la función\n",
" \n",
" Example:\n",
" >>>text =[('quijote', 5),('primera', 4),('don', 3),('novela', 3),('parte', 3),('obra', 3),('título', 2),\n",
" >>>('ingenioso', 2),('mancha', 2),('1605', 2)]\n",
" >>>stopwords=stopwords={'a','ante','cabe','con','contra','de','desde'}\n",
" >>>c=NubePalabras(text,stopwords)\n",
" >>>c.store_cloud()\n",
" #Se guarda la imagen dentro de la carpeta de donde se almacena el script\n",
" '''\n",
" wordcloud=self.wordcloud\n",
" wordcloud.to_file(\"nubepalabra2.jpg\")\n",
" \n",
"text =[('quijote', 5),\n",
" ('primera', 4),\n",
" ('don', 3),\n",
" ('novela', 3),\n",
" ('parte', 3),\n",
" ('obra', 3),\n",
" ('título', 2),\n",
" ('ingenioso', 2),\n",
" ('mancha', 2),\n",
" ('1605', 2)]\n",
"\n",
"\n",
"c=NubePalabras(text)\n",
"c.plot_cloud()\n",
"c.store_cloud()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## III. La ley de Zipf\n",
"\n",
"La ley de Zipf establece que la frecuencia de una palabra (para casi todos los idiomas) es inversamente proporcional a su posición $r$ en un ranking estadístico. De hecho para el idioma inglés se estableció que:\n",
"\n",
"<img src=\"http://mathworld.wolfram.com/images/equations/ZipfsLaw/NumberedEquation1.gif\" class=\"numberedequation\" width=\"116\" height=\"37\" border=\"0\" alt=\" P(r) approx 1/(rln(1.78R)), \">\n",
"\n",
"\n",
"donde $R$ es el número de palabras distintas.\n",
"\n",
"\n",
"### (2 puntos)\n",
"\n",
"Utilice los datos proporcionados en el repositorio para generar una distribución de probabilidad de Zipf utilizando $ln(rank)$ como la variable aleatoria ($xk$) y el $ln$(frecuency) como la distribución asociada a la variable ($pk$).\n",
"\n",
"* Datos\n",
"\n",
"./data/named_entity_recognition_sp_MX_locations.JSON\n",
"\n",
"\n",
"* graficar la función de densidad de probabilidades\n",
"* mostrar con evidencia experimental, con ayuda de scipy.stats, si el coeficiente $1.78R$ aplica también para español, y en caso de que no sea así, diga cuál es el valor del coeficiente correspondiente para español?\n",
"\n",
"\n",
"#### Observaciones\n",
"\n",
"* Báse su respuesta en el ejemplo de la distribución custom (rv_histogram) visto en clase;\n",
"* Ignore las etiquetas ``<START:location>`` y ``<END>`` para la generación de la distribución.\n",
"\n",
"\n",
"#### Referencias:\n",
"\n",
"* https://es.wikipedia.org/wiki/Ley_de_Zipf\n",
"* http://mathworld.wolfram.com/ZipfsLaw.html"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAFFCAYAAAAdAsFPAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAIABJREFUeJzt3Xm4HFWd//H3JwmQABK2iCJLQFAmCjKaAZzBUUAUZhAEwRFcEFB0lMEZHRV/o2zjjIILOuKGLEbUYXPEqCD7JsoStsSAzERQFlHZISBi4P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\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"import re\n",
"from operator import itemgetter \n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"\n",
"frequency = {}\n",
"open_file = open('data/data_named_entity_recognition_sp_MX_locations.JSON', 'r')\n",
"file_to_string = open_file.read()\n",
"words = re.findall(r'(b[A-Za-z][a-z]{2,9}b)', file_to_string)\n",
"\n",
"for word in words:\n",
" count = frequency.get(word,0)\n",
" frequency[word] = count + 1\n",
"values=[] \n",
"for key, value in reversed(sorted(frequency.items(), key = itemgetter(1))):\n",
" values= np.append(values,[[key,value]])\n",
"\n",
"for i in range(len(values)):\n",
" #print(values[i])\n",
" if(i%2!=0):\n",
" x=np.append(values,[int(values[i])])\n",
" \n",
"# the histogram of the data\n",
"patches = plt.hist(x, density=True, facecolor='g', alpha=0.75)\n",
"\n",
"plt.xlabel('Palabra')\n",
"plt.xticks(rotation=90)\n",
"plt.ylabel('Frecuencia')\n",
"plt.title('La ley de Zipf')\n",
"\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"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.6.7"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment