Created
June 28, 2020 22:15
-
-
Save pablodz/2c05d97b630ad8412c2eb7e31eb888f6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "cells": [ | |
| { | |
| "cell_type": "code", | |
| "execution_count": 0, | |
| "metadata": { | |
| "collapsed": false | |
| }, | |
| "outputs": [ | |
| ], | |
| "source": [ | |
| "def spell_checker_spanish():\n", | |
| " try:\n", | |
| " df.drop('Código', axis=1, inplace=True) # No viene al caso\n", | |
| " df.drop('Nombre', axis=1, inplace=True) # Anonimos\n", | |
| " df.drop('Número', axis=1, inplace=True) # No viene al caso\n", | |
| " except:\n", | |
| " pass\n", | |
| "\n", | |
| " df['polarity']=0\n", | |
| " df['neg']=0\n", | |
| " df['neu']=0\n", | |
| " df['pos']=0\n", | |
| " df['translated']=0\n", | |
| "\n", | |
| " for i in range(len(df)):#len(df)\n", | |
| " try:\n", | |
| " temp=df['Relato'][i]\n", | |
| " fixed=corregir_oracion(diccionario,temp)\n", | |
| " #fixed=preprocess(str(fixed))\n", | |
| " df.loc[i,'RelatoFixed']=fixed\n", | |
| " print(i,end=' - ')\n", | |
| "\n", | |
| " except Exception as e:\n", | |
| " print('Error {}:{}'.format(i,e))" | |
| ] | |
| } | |
| ], | |
| "metadata": { | |
| "kernelspec": { | |
| "display_name": "Python 3 (system-wide)", | |
| "language": "python", | |
| "metadata": { | |
| "cocalc": { | |
| "description": "Python 3 programming language", | |
| "priority": 100, | |
| "url": "https://www.python.org/" | |
| } | |
| }, | |
| "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.9" | |
| } | |
| }, | |
| "nbformat": 4, | |
| "nbformat_minor": 4 | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment