diff --git a/analyse_twitter_LIU.ipynb b/analyse_twitter_LIU.ipynb
index ebc10a1..25f8dcd 100644
--- a/analyse_twitter_LIU.ipynb
+++ b/analyse_twitter_LIU.ipynb
@@ -13,7 +13,7 @@
},
{
"cell_type": "code",
- "execution_count": 204,
+ "execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@@ -26,17 +26,17 @@
"\n",
"# Authentification API\n",
"auth = tweepy.OAuthHandler(\n",
- " 'g5ktEfyoenGVaxGFbbz5Xt6CH', \n",
- " 'D5RFlzzO5FMDvFFkUf5piWFF1mNKpgzEZpZEjC40uP7ZA4QhrY')\n",
+ " '***', \n",
+ " '***')\n",
"auth.set_access_token(\n",
- " '1313171160973139973-eVa2VAFWUoha0lLgUzVwCQwQycWJ0c', \n",
- " 'c4DdmZV6DWV2NwjpBTy5cZlN9tdPvwACbUrwWQyj3RKfX')\n",
+ " '***', \n",
+ " '***')\n",
"api = tweepy.API(auth,wait_on_rate_limit=True)"
]
},
{
"cell_type": "code",
- "execution_count": 321,
+ "execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@@ -53,44 +53,9 @@
},
{
"cell_type": "code",
- "execution_count": 471,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Pendant la semaine du 11/04/2021 au 18/04/2021 , les tweets en français et ayant pour hashtags #IA ou #IntelligenceArtificielle sont les suivants : \n",
- " time location user_id \\\n",
- "0 Sun Apr 18 14:27:29 +0000 2021 France /Japon cerise_masquee \n",
- "1 Sun Apr 18 14:00:32 +0000 2021 Paris ORSYS \n",
- "2 Sun Apr 18 13:48:21 +0000 2021 France mdrechsler \n",
- "3 Sun Apr 18 13:34:32 +0000 2021 RISKINTEL4 \n",
- "4 Sun Apr 18 13:30:17 +0000 2021 NACREspirale \n",
- ".. ... ... ... \n",
- "384 Sat Apr 10 11:21:06 +0000 2021 Avignon, France ThibFay \n",
- "385 Sat Apr 10 11:03:50 +0000 2021 Paris YvesPDB \n",
- "386 Sat Apr 10 10:22:04 +0000 2021 Paris, France DailyDigital \n",
- "387 Sat Apr 10 10:02:25 +0000 2021 PierreRamette \n",
- "388 Sat Apr 10 10:00:01 +0000 2021 Paris, France LaForge_AI \n",
- "\n",
- " num_followers mentions \n",
- "0 201 [{'screen_name': 'LaForge_AI', 'name': 'La For... \n",
- "1 5440 [] \n",
- "2 20850 [{'screen_name': 'mdrechsler', 'name': 'Michèl... \n",
- "3 103 [{'screen_name': 'LaForge_AI', 'name': 'La For... \n",
- "4 2753 [{'screen_name': 'LaForge_AI', 'name': 'La For... \n",
- ".. ... ... \n",
- "384 164 [{'screen_name': 'LaForge_AI', 'name': 'La For... \n",
- "385 31445 [{'screen_name': 'Inst_Lecanuet', 'name': 'Ins... \n",
- "386 13819 [] \n",
- "387 244 [{'screen_name': 'LaForge_AI', 'name': 'La For... \n",
- "388 9932 [] \n",
- "\n",
- "[389 rows x 5 columns]\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"# Garder des informations qui nous intéresseraient en renommant les colonnes\n",
"simple_results = results_df[['created_at',\n",
@@ -115,46 +80,9 @@
},
{
"cell_type": "code",
- "execution_count": 472,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "La liste des mentions entre les utilisateurs : \n",
- " mentions user_id num_followers\n",
- "0 LaForge_AI cerise_masquee 201\n",
- "1 mdrechsler mdrechsler 20850\n",
- "2 LaForge_AI RISKINTEL4 103\n",
- "3 LaForge_AI NACREspirale 2753\n",
- "4 VincentCespedes mpbarrouillet 893\n",
- ".. ... ... ...\n",
- "314 TeensInAI ActuIAFr 11902\n",
- "315 LaForge_AI ClaudioCimelli 1470\n",
- "316 LaForge_AI ThibFay 164\n",
- "317 Inst_Lecanuet YvesPDB 31445\n",
- "318 LaForge_AI PierreRamette 244\n",
- "\n",
- "[319 rows x 3 columns]\n",
- "La liste des utilisateurs Twitter ayant publié du contenu relatif à l'IA durant la semaine passée : \n",
- " user_id num_followers\n",
- "0 236News 4417.0\n",
- "1 49mamie51 244.0\n",
- "2 4inData NaN\n",
- "3 AFD_France 85619.0\n",
- "4 AIVids NaN\n",
- ".. ... ...\n",
- "292 thot NaN\n",
- "293 toniojj 1617.0\n",
- "294 univbordeaux NaN\n",
- "295 xavierquerat 8685.0\n",
- "296 zdnetfr NaN\n",
- "\n",
- "[297 rows x 2 columns]\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"# Convertir la colonne \"mentions\" en liste simple\n",
"mentioned_users = []\n",
@@ -184,7 +112,7 @@
},
{
"cell_type": "code",
- "execution_count": 483,
+ "execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@@ -199,7 +127,7 @@
},
{
"cell_type": "code",
- "execution_count": 489,
+ "execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@@ -212,28 +140,9 @@
},
{
"cell_type": "code",
- "execution_count": 476,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Les dix comptes Twitter ayant été le plus mentionnés durant la semaine passée sont : \n",
- " node degree\n",
- "233 eduscol_EMI 26\n",
- "130 ModisFrance 25\n",
- "268 mdrechsler 22\n",
- "71 Edu_Num 20\n",
- "7 ActuIAFr 14\n",
- "90 GroupeLaPoste 10\n",
- "9 AgenceRecherche 10\n",
- "3 AFD_France 9\n",
- "143 OpenvalueFR 9\n",
- "223 ctricot 8\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"# Calculer la centralité de degré en utilisant le package igraph\n",
"out_degrees = pd.DataFrame({'node': nodes['user_id'],\n",
@@ -247,4944 +156,9 @@
},
{
"cell_type": "code",
- "execution_count": 497,
+ "execution_count": null,
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Carte représentant le réseau d'influence des comptes Twitter du domaine de l'IA : \n",
- " (la taille des noeuds est proportionnelle à leur degré sortant) \n",
- "\n",
- "Carte représentant le réseau d'influence des comptes Twitter du domaine de l'IA : \n",
- "(la taille des noeuds est proportionnelle à leur nombre d'abonnés) \n",
- "\n"
- ]
- },
- {
- "data": {
- "image/svg+xml": [
- "\n",
- "\n"
- ],
- "text/plain": [
- ""
- ]
- },
- "execution_count": 497,
- "metadata": {
- "image/svg+xml": {
- "isolated": true
- }
- },
- "output_type": "execute_result"
- }
- ],
+ "outputs": [],
"source": [
"# Apppliquer la méthode \"Fruchterman-Reingold force-directed\" pour construire le réseau\n",
"layout = kol_map.layout('fr')\n",
@@ -5212,13 +186,6 @@
" \"(la taille des noeuds est proportionnelle à leur nombre d'abonnés) \\n\")\n",
"ig.plot(kol_map0, \"twitter_network_mapping_follower.pdf\", **visual_style0)"
]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": []
}
],
"metadata": {