{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import os\n",
    "from easynmt import EasyNMT\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "URL_BASE = \"https://arxiv.org/pdf/\"\n",
    "PDF_PATH = 'PDF'\n",
    "TXT_PATH= 'TXT'\n",
    "CSV_PATH = 'CSV'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Get Data from TXT"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "data = pd.read_json('ARxiv/arxiv-metadata-oai-snapshot.json',lines=True, chunksize=2001,dtype={'id':'str'})\n",
    "df = None\n",
    "for i in data:\n",
    "    df = i \n",
    "    print(type(i))\n",
    "    break\n",
    "df = df[['id','title','abstract']]\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "for file in df['id']:\n",
    "    file_path = TXT_PATH+'/'+str(file)+'.pdf.txt'\n",
    "    if  os.path.isfile(file_path):\n",
    "        with open(file_path,'r',encoding='utf8') as f:\n",
    "            s =str( f.read()) \n",
    "            df.loc[df['id'] == str(file),'full_text'] = s          "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = df.dropna()\n",
    "df.reset_index()\n",
    "df.to_csv(CSV_PATH+'/scientific_paper_en.csv',index=False,encoding='utf-8')\n",
    "df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# first run \n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.read_csv(CSV_PATH +'/scientific_paper_en.csv',dtype={'id':'str'})\n",
    "df.to_csv(CSV_PATH+'/scientific_paper_full_text_translated.csv',index=False,encoding='utf-8')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# leer datos"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.read_csv(CSV_PATH +'/scientific_paper_full_text_translated.csv',dtype={'id':'str'})\n",
    "print(len(df.index))\n",
    "df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# translate"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "model = EasyNMT('opus-mt')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## translate full text"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "max = len(df.index)\n",
    "for i in range(0,1754):\n",
    "    text = df.iloc[i]['full_text']\n",
    "    translated_text = model.translate(text, target_lang='es')\n",
    "    df.loc[i,'translated'] = translated_text   \n",
    "    print(\"listo documento \",i)\n",
    "    if(i%10==0):\n",
    "        df.to_csv(CSV_PATH+'/scientific_paper_full_text_translated.csv',index=False,encoding='utf-8')\n",
    "df.to_csv(CSV_PATH+'/scientific_paper_full_text_translated.csv',index=False,encoding='utf-8')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## translate abstract"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "max = len(df.index)\n",
    "for i in range(0,1754):\n",
    "    text = df.iloc[i]['abstract']\n",
    "    translated_text = model.translate(text, target_lang='es')\n",
    "    df.loc[i,'translated_abstract'] = translated_text   \n",
    "    print(\"listo documento \",i)\n",
    "    if(i%100==0):\n",
    "        df.to_csv(CSV_PATH+'/scientific_paper_full_text_translated.csv',index=False,encoding='utf-8')\n",
    "df.to_csv(CSV_PATH+'/scientific_paper_full_text_translated.csv',index=False,encoding='utf-8')\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# remove abstract"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "max = len(df.index)-1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "end = 'Introducción'\n",
    "for i in range(0,max):\n",
    "    text = df.iloc[i]['translated']    \n",
    "    p = text.find(end)\n",
    "    if(p != -1):        \n",
    "        df.loc[i,'translated_no_abstract'] = text[p:]   \n",
    "    else:\n",
    "        df.loc[i,'translated_no_abstract']= text\n",
    "    print(\"listo documento \",i,p)\n",
    "    if(i%1000==0):\n",
    "        df.to_csv(CSV_PATH+'/scientific_paper_full_text_translated.csv',index=False,encoding='utf-8')\n",
    "df.to_csv(CSV_PATH+'/scientific_paper_full_text_translated.csv',index=False,encoding='utf-8')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "end = 'Abstract'\n",
    "for i in range(0,max):\n",
    "    text = df.iloc[i]['full_text']    \n",
    "    p = text.find(end)\n",
    "    if(p != -1):        \n",
    "        df.loc[i,'text_no_abstract'] = text[p:]   \n",
    "    else:\n",
    "        df.loc[i,'text_no_abstract']= text    \n",
    "    if(i%1000==0):\n",
    "        df.to_csv(CSV_PATH+'/scientific_paper_full_text_translated.csv',index=False,encoding='utf-8')\n",
    "df.to_csv(CSV_PATH+'/scientific_paper_full_text_translated.csv',index=False,encoding='utf-8')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# split data to csv"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.read_csv(CSV_PATH +'/scientific_paper_full_text_translated.csv',dtype={'id':'str'})\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "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>id</th>\n",
       "      <th>title</th>\n",
       "      <th>full_text</th>\n",
       "      <th>abstract</th>\n",
       "      <th>text_no_abstract</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0704.0002</td>\n",
       "      <td>Sparsity-certifying Graph Decompositions</td>\n",
       "      <td>Descomposiciones del gráfico de certificación ...</td>\n",
       "      <td>Describimos un nuevo algoritmo, el juego de ...</td>\n",
       "      <td>Introducción y preliminares\\nEl foco de este d...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0704.0003</td>\n",
       "      <td>The evolution of the Earth-Moon system based o...</td>\n",
       "      <td>La evolución del sistema Tierra-Luna basado en...</td>\n",
       "      <td>La evolución del sistema Tierra-Luna es desc...</td>\n",
       "      <td>Introducción \\nLa teoría aceptada popularmente...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0704.0004</td>\n",
       "      <td>A determinant of Stirling cycle numbers counts...</td>\n",
       "      <td>Un determinante de los números de ciclo de Sti...</td>\n",
       "      <td>Demostramos que un determinante de los númer...</td>\n",
       "      <td>Introducción El propósito principal de este ar...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0704.0005</td>\n",
       "      <td>From dyadic $\\Lambda_{\\alpha}$ to $\\Lambda_{\\a...</td>\n",
       "      <td>DE DÍA A DÍA\\nWAEL ABU-SHAMMALA Y ALBERTO TORC...</td>\n",
       "      <td>En este artículo mostramos cómo calcular la ...</td>\n",
       "      <td>DE DÍA A DÍA\\nWAEL ABU-SHAMMALA Y ALBERTO TORC...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0704.0007</td>\n",
       "      <td>Polymer Quantum Mechanics and its Continuum Limit</td>\n",
       "      <td>La mecánica cuántica de polímeros y su límite ...</td>\n",
       "      <td>Una representación cuántica no estándar de l...</td>\n",
       "      <td>La mecánica cuántica de polímeros y su límite ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1749</th>\n",
       "      <td>0704.1996</td>\n",
       "      <td>A Wave-function for Stringy Universes</td>\n",
       "      <td>LPTENS–07/16\\nAbril de 2007\\nUna función de on...</td>\n",
       "      <td>Definimos una función de onda para los fondo...</td>\n",
       "      <td>Introducción\\nNuestro objetivo en este documen...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1750</th>\n",
       "      <td>0704.1997</td>\n",
       "      <td>Query on Negative Temperature, Internal Intera...</td>\n",
       "      <td>Microsoft Word - negEntr.doc\\nConsulta sobre t...</td>\n",
       "      <td>Después de que la temperatura negativa se vu...</td>\n",
       "      <td>Microsoft Word - negEntr.doc\\nConsulta sobre t...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1751</th>\n",
       "      <td>0704.1998</td>\n",
       "      <td>Absence of the Fifth Force Problem in a Model ...</td>\n",
       "      <td>Ausencia del problema de la quinta fuerza en u...</td>\n",
       "      <td>Un modelo de escala invariante que contiene ...</td>\n",
       "      <td>Introducción\\n\\tBase de Dos Medidas Teoría de ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1752</th>\n",
       "      <td>0704.1999</td>\n",
       "      <td>Dark matter caustics and the enhancement of se...</td>\n",
       "      <td>Proyecto de versión 16 de noviembre de 2018\\nT...</td>\n",
       "      <td>Los haloes fríos de materia oscura están pob...</td>\n",
       "      <td>Proyecto de versión 16 de noviembre de 2018\\nT...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1753</th>\n",
       "      <td>0704.2000</td>\n",
       "      <td>Search for a Higgs boson produced in associati...</td>\n",
       "      <td>FERMILAB-PUB-07/076-E\\nBúsqueda de un bosón Hi...</td>\n",
       "      <td>Describimos una búsqueda para el modelo está...</td>\n",
       "      <td>FERMILAB-PUB-07/076-E\\nBúsqueda de un bosón Hi...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1754 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "             id                                              title  \\\n",
       "0     0704.0002           Sparsity-certifying Graph Decompositions   \n",
       "1     0704.0003  The evolution of the Earth-Moon system based o...   \n",
       "2     0704.0004  A determinant of Stirling cycle numbers counts...   \n",
       "3     0704.0005  From dyadic $\\Lambda_{\\alpha}$ to $\\Lambda_{\\a...   \n",
       "4     0704.0007  Polymer Quantum Mechanics and its Continuum Limit   \n",
       "...         ...                                                ...   \n",
       "1749  0704.1996              A Wave-function for Stringy Universes   \n",
       "1750  0704.1997  Query on Negative Temperature, Internal Intera...   \n",
       "1751  0704.1998  Absence of the Fifth Force Problem in a Model ...   \n",
       "1752  0704.1999  Dark matter caustics and the enhancement of se...   \n",
       "1753  0704.2000  Search for a Higgs boson produced in associati...   \n",
       "\n",
       "                                              full_text  \\\n",
       "0     Descomposiciones del gráfico de certificación ...   \n",
       "1     La evolución del sistema Tierra-Luna basado en...   \n",
       "2     Un determinante de los números de ciclo de Sti...   \n",
       "3     DE DÍA A DÍA\\nWAEL ABU-SHAMMALA Y ALBERTO TORC...   \n",
       "4     La mecánica cuántica de polímeros y su límite ...   \n",
       "...                                                 ...   \n",
       "1749  LPTENS–07/16\\nAbril de 2007\\nUna función de on...   \n",
       "1750  Microsoft Word - negEntr.doc\\nConsulta sobre t...   \n",
       "1751  Ausencia del problema de la quinta fuerza en u...   \n",
       "1752  Proyecto de versión 16 de noviembre de 2018\\nT...   \n",
       "1753  FERMILAB-PUB-07/076-E\\nBúsqueda de un bosón Hi...   \n",
       "\n",
       "                                               abstract  \\\n",
       "0       Describimos un nuevo algoritmo, el juego de ...   \n",
       "1       La evolución del sistema Tierra-Luna es desc...   \n",
       "2       Demostramos que un determinante de los númer...   \n",
       "3       En este artículo mostramos cómo calcular la ...   \n",
       "4       Una representación cuántica no estándar de l...   \n",
       "...                                                 ...   \n",
       "1749    Definimos una función de onda para los fondo...   \n",
       "1750    Después de que la temperatura negativa se vu...   \n",
       "1751    Un modelo de escala invariante que contiene ...   \n",
       "1752    Los haloes fríos de materia oscura están pob...   \n",
       "1753    Describimos una búsqueda para el modelo está...   \n",
       "\n",
       "                                       text_no_abstract  \n",
       "0     Introducción y preliminares\\nEl foco de este d...  \n",
       "1     Introducción \\nLa teoría aceptada popularmente...  \n",
       "2     Introducción El propósito principal de este ar...  \n",
       "3     DE DÍA A DÍA\\nWAEL ABU-SHAMMALA Y ALBERTO TORC...  \n",
       "4     La mecánica cuántica de polímeros y su límite ...  \n",
       "...                                                 ...  \n",
       "1749  Introducción\\nNuestro objetivo en este documen...  \n",
       "1750  Microsoft Word - negEntr.doc\\nConsulta sobre t...  \n",
       "1751  Introducción\\n\\tBase de Dos Medidas Teoría de ...  \n",
       "1752  Proyecto de versión 16 de noviembre de 2018\\nT...  \n",
       "1753  FERMILAB-PUB-07/076-E\\nBúsqueda de un bosón Hi...  \n",
       "\n",
       "[1754 rows x 5 columns]"
      ]
     },
     "execution_count": 77,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "es = df[['id','title','translated','translated_abstract','translated_no_abstract']]\n",
    "es.columns = [\"id\",\"title\", \"full_text\",\"abstract\",\"text_no_abstract\"]\n",
    "es.to_csv(CSV_PATH+'/scientific_paper_es.csv',index=False,encoding='utf-8')\n",
    "es"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "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>id</th>\n",
       "      <th>title</th>\n",
       "      <th>full_text</th>\n",
       "      <th>abstract</th>\n",
       "      <th>text_no_abstract</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0704.0002</td>\n",
       "      <td>Sparsity-certifying Graph Decompositions</td>\n",
       "      <td>Sparsity-certifying Graph Decompositions\\nIlea...</td>\n",
       "      <td>We describe a new algorithm, the $(k,\\ell)$-...</td>\n",
       "      <td>Introduction and preliminaries\\nThe focus of t...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0704.0003</td>\n",
       "      <td>The evolution of the Earth-Moon system based o...</td>\n",
       "      <td>The evolution of the Earth-Moon system based o...</td>\n",
       "      <td>The evolution of Earth-Moon system is descri...</td>\n",
       "      <td>Introduction \\nThe popularly accepted theory f...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0704.0004</td>\n",
       "      <td>A determinant of Stirling cycle numbers counts...</td>\n",
       "      <td>A Determinant of Stirling Cycle Numbers Counts...</td>\n",
       "      <td>We show that a determinant of Stirling cycle...</td>\n",
       "      <td>Introduction The chief purpose of this paper i...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0704.0005</td>\n",
       "      <td>From dyadic $\\Lambda_{\\alpha}$ to $\\Lambda_{\\a...</td>\n",
       "      <td>FROM DYADIC Λα TO Λα\\nWAEL ABU-SHAMMALA AND AL...</td>\n",
       "      <td>In this paper we show how to compute the $\\L...</td>\n",
       "      <td>FROM DYADIC Λα TO Λα\\nWAEL ABU-SHAMMALA AND AL...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0704.0007</td>\n",
       "      <td>Polymer Quantum Mechanics and its Continuum Limit</td>\n",
       "      <td>Polymer Quantum Mechanics and its Continuum Li...</td>\n",
       "      <td>A rather non-standard quantum representation...</td>\n",
       "      <td>Polymer Quantum Mechanics and its Continuum Li...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1749</th>\n",
       "      <td>0704.1996</td>\n",
       "      <td>A Wave-function for Stringy Universes</td>\n",
       "      <td>LPTENS–07/16\\nApril 2007\\nA Wave-function for ...</td>\n",
       "      <td>We define a wave-function for string theory ...</td>\n",
       "      <td>Introduction\\nOur goal in this paper is to emb...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1750</th>\n",
       "      <td>0704.1997</td>\n",
       "      <td>Query on Negative Temperature, Internal Intera...</td>\n",
       "      <td>Microsoft Word - negEntr.doc\\nQuery on Negativ...</td>\n",
       "      <td>After negative temperature is restated, we f...</td>\n",
       "      <td>Microsoft Word - negEntr.doc\\nQuery on Negativ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1751</th>\n",
       "      <td>0704.1998</td>\n",
       "      <td>Absence of the Fifth Force Problem in a Model ...</td>\n",
       "      <td>Absence of the Fifth Force Problem in a Model ...</td>\n",
       "      <td>A scale invariant model containing dilaton $...</td>\n",
       "      <td>Introduction\\n\\tBasis of Two Measures Field Th...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1752</th>\n",
       "      <td>0704.1999</td>\n",
       "      <td>Dark matter caustics and the enhancement of se...</td>\n",
       "      <td>Draft version November 16, 2018\\nPreprint type...</td>\n",
       "      <td>Cold dark matter haloes are populated by cau...</td>\n",
       "      <td>Draft version November 16, 2018\\nPreprint type...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1753</th>\n",
       "      <td>0704.2000</td>\n",
       "      <td>Search for a Higgs boson produced in associati...</td>\n",
       "      <td>FERMILAB-PUB-07/076-E\\nSearch for a Higgs boso...</td>\n",
       "      <td>We describe a search for the standard model ...</td>\n",
       "      <td>FERMILAB-PUB-07/076-E\\nSearch for a Higgs boso...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1754 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "             id                                              title  \\\n",
       "0     0704.0002           Sparsity-certifying Graph Decompositions   \n",
       "1     0704.0003  The evolution of the Earth-Moon system based o...   \n",
       "2     0704.0004  A determinant of Stirling cycle numbers counts...   \n",
       "3     0704.0005  From dyadic $\\Lambda_{\\alpha}$ to $\\Lambda_{\\a...   \n",
       "4     0704.0007  Polymer Quantum Mechanics and its Continuum Limit   \n",
       "...         ...                                                ...   \n",
       "1749  0704.1996              A Wave-function for Stringy Universes   \n",
       "1750  0704.1997  Query on Negative Temperature, Internal Intera...   \n",
       "1751  0704.1998  Absence of the Fifth Force Problem in a Model ...   \n",
       "1752  0704.1999  Dark matter caustics and the enhancement of se...   \n",
       "1753  0704.2000  Search for a Higgs boson produced in associati...   \n",
       "\n",
       "                                              full_text  \\\n",
       "0     Sparsity-certifying Graph Decompositions\\nIlea...   \n",
       "1     The evolution of the Earth-Moon system based o...   \n",
       "2     A Determinant of Stirling Cycle Numbers Counts...   \n",
       "3     FROM DYADIC Λα TO Λα\\nWAEL ABU-SHAMMALA AND AL...   \n",
       "4     Polymer Quantum Mechanics and its Continuum Li...   \n",
       "...                                                 ...   \n",
       "1749  LPTENS–07/16\\nApril 2007\\nA Wave-function for ...   \n",
       "1750  Microsoft Word - negEntr.doc\\nQuery on Negativ...   \n",
       "1751  Absence of the Fifth Force Problem in a Model ...   \n",
       "1752  Draft version November 16, 2018\\nPreprint type...   \n",
       "1753  FERMILAB-PUB-07/076-E\\nSearch for a Higgs boso...   \n",
       "\n",
       "                                               abstract  \\\n",
       "0       We describe a new algorithm, the $(k,\\ell)$-...   \n",
       "1       The evolution of Earth-Moon system is descri...   \n",
       "2       We show that a determinant of Stirling cycle...   \n",
       "3       In this paper we show how to compute the $\\L...   \n",
       "4       A rather non-standard quantum representation...   \n",
       "...                                                 ...   \n",
       "1749    We define a wave-function for string theory ...   \n",
       "1750    After negative temperature is restated, we f...   \n",
       "1751    A scale invariant model containing dilaton $...   \n",
       "1752    Cold dark matter haloes are populated by cau...   \n",
       "1753    We describe a search for the standard model ...   \n",
       "\n",
       "                                       text_no_abstract  \n",
       "0     Introduction and preliminaries\\nThe focus of t...  \n",
       "1     Introduction \\nThe popularly accepted theory f...  \n",
       "2     Introduction The chief purpose of this paper i...  \n",
       "3     FROM DYADIC Λα TO Λα\\nWAEL ABU-SHAMMALA AND AL...  \n",
       "4     Polymer Quantum Mechanics and its Continuum Li...  \n",
       "...                                                 ...  \n",
       "1749  Introduction\\nOur goal in this paper is to emb...  \n",
       "1750  Microsoft Word - negEntr.doc\\nQuery on Negativ...  \n",
       "1751  Introduction\\n\\tBasis of Two Measures Field Th...  \n",
       "1752  Draft version November 16, 2018\\nPreprint type...  \n",
       "1753  FERMILAB-PUB-07/076-E\\nSearch for a Higgs boso...  \n",
       "\n",
       "[1754 rows x 5 columns]"
      ]
     },
     "execution_count": 79,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "en = df[['id','title','full_text','abstract','text_no_abstract']]\n",
    "en.columns = [\"id\",\"title\", \"full_text\",\"abstract\",\"text_no_abstract\"]\n",
    "en.to_csv(CSV_PATH+'/scientific_paper_en.csv',index=False,encoding='utf-8')\n",
    "en"
   ]
  }
 ],
 "metadata": {
  "interpreter": {
   "hash": "05def4d9d0834781cbeb6b95fd92421f8bd6a45e945308f90d88567f4afc1911"
  },
  "kernelspec": {
   "display_name": "Python 3.8.12 ('tensorflow')",
   "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.7"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}