File size: 23,325 Bytes
93b46fc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import torch\n",
    "import transformers\n",
    "from transformers import BartTokenizer, BartForConditionalGeneration\n",
    "tr = BartTokenizer.from_pretrained('facebook/bart-large-cnn')\n",
    "mdl = BartForConditionalGeneration.from_pretrained('facebook/bart-large-cnn')\n",
    "torch_device = 'cpu'\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "def bart_summarize(text, num_beams=20, length_penalty=2, max_length=2048, min_length=56, no_repeat_ngram_size=2):\n",
    "\n",
    "      text = text.replace('\\n','')\n",
    "      text_input_ids = tr.batch_encode_plus([text], return_tensors='pt', max_length=1024)['input_ids'].to(torch_device)\n",
    "      summary_ids = mdl.generate(text_input_ids, num_beams=int(num_beams), length_penalty=float(length_penalty), max_length=int(max_length), min_length=int(min_length), no_repeat_ngram_size=int(no_repeat_ngram_size))\n",
    "      summary_txt = tr.decode(summary_ids.squeeze(), skip_special_tokens=True)\n",
    "      return summary_txt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "from sentence_transformers import SentenceTransformer\n",
    "import scipy.spatial\n",
    "import pickle as pkl\n",
    "from sentence_transformers import SentenceTransformer, util\n",
    "import torch\n",
    "#import os\n",
    "\n",
    "\n",
    "df = pd.read_csv('combined_paris.csv')\n",
    "\n",
    "\n",
    "df_combined = df.sort_values(['Hotel']).groupby('Hotel', sort=False).review.apply(''.join).reset_index(name='all_review')\n",
    "\n",
    "import re\n",
    "\n",
    "df_combined['all_review'] = df_combined['all_review'].apply(lambda x: re.sub('[^a-zA-z0-9\\s]','',x))\n",
    "def lower_case(input_str):\n",
    "        input_str = input_str.lower()\n",
    "        return input_str"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_combined['all_review']= df_combined['all_review'].apply(lambda x: lower_case(x))\n",
    "\n",
    "df = df_combined\n",
    "\n",
    "df_sentences = df_combined.set_index(\"all_review\")\n",
    "\n",
    "df_sentences = df_sentences[\"Hotel\"].to_dict()\n",
    "df_sentences_list = list(df_sentences.keys())\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "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>0</th>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "      <th>3</th>\n",
       "      <th>4</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Hotel</th>\n",
       "      <td>25hours Hotel Terminus Nord</td>\n",
       "      <td>Acacias Etoile Hotel</td>\n",
       "      <td>COQ Hotel Paris</td>\n",
       "      <td>Campanile Paris 14 - Maine Montparnasse</td>\n",
       "      <td>Cler Hotel</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>all_review</th>\n",
       "      <td>weve spent lots of time in paris and this was ...</td>\n",
       "      <td>the hotel is great for value the breakfast sel...</td>\n",
       "      <td>stayed for a short city break  the hotel is a ...</td>\n",
       "      <td>room was very clean  transportation is very ne...</td>\n",
       "      <td>we had the best stay at cler hotel  the locati...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                            0  \\\n",
       "Hotel                             25hours Hotel Terminus Nord   \n",
       "all_review  weve spent lots of time in paris and this was ...   \n",
       "\n",
       "                                                            1  \\\n",
       "Hotel                                    Acacias Etoile Hotel   \n",
       "all_review  the hotel is great for value the breakfast sel...   \n",
       "\n",
       "                                                            2  \\\n",
       "Hotel                                         COQ Hotel Paris   \n",
       "all_review  stayed for a short city break  the hotel is a ...   \n",
       "\n",
       "                                                            3  \\\n",
       "Hotel                 Campanile Paris 14 - Maine Montparnasse   \n",
       "all_review  room was very clean  transportation is very ne...   \n",
       "\n",
       "                                                            4  \n",
       "Hotel                                              Cler Hotel  \n",
       "all_review  we had the best stay at cler hotel  the locati...  "
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_combined.head().T"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Truncation was not explicitly activated but `max_length` is provided a specific value, please use `truncation=True` to explicitly truncate examples to max length. Defaulting to 'longest_first' truncation strategy. If you encode pairs of sequences (GLUE-style) with the tokenizer you can select this strategy more precisely by providing a specific strategy to `truncation`.\n"
     ]
    }
   ],
   "source": [
    "long_summary = []\n",
    "\n",
    "for i in range(len(df_combined)):\n",
    "    t = bart_summarize(df_combined['all_review'][i])\n",
    "    long_summary.append(t)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_combined['summary'] = long_summary"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_combined.to_csv('df_combined_paris.csv',index=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "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>Hotel</th>\n",
       "      <th>all_review</th>\n",
       "      <th>summary</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>25hours Hotel Terminus Nord</td>\n",
       "      <td>weve spent lots of time in paris and this was ...</td>\n",
       "      <td>we were blown away by this excellent hotel we ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Acacias Etoile Hotel</td>\n",
       "      <td>the hotel is great for value the breakfast sel...</td>\n",
       "      <td>The hotel is great for value the breakfast sel...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>COQ Hotel Paris</td>\n",
       "      <td>stayed for a short city break  the hotel is a ...</td>\n",
       "      <td>stayed for a short city break  the hotel is a ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Campanile Paris 14 - Maine Montparnasse</td>\n",
       "      <td>room was very clean  transportation is very ne...</td>\n",
       "      <td>hotel turned out to be perfect for our short ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Cler Hotel</td>\n",
       "      <td>we had the best stay at cler hotel  the locati...</td>\n",
       "      <td>we had the best stay at cler hotel  the locati...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                     Hotel  \\\n",
       "0              25hours Hotel Terminus Nord   \n",
       "1                     Acacias Etoile Hotel   \n",
       "2                          COQ Hotel Paris   \n",
       "3  Campanile Paris 14 - Maine Montparnasse   \n",
       "4                               Cler Hotel   \n",
       "\n",
       "                                          all_review  \\\n",
       "0  weve spent lots of time in paris and this was ...   \n",
       "1  the hotel is great for value the breakfast sel...   \n",
       "2  stayed for a short city break  the hotel is a ...   \n",
       "3  room was very clean  transportation is very ne...   \n",
       "4  we had the best stay at cler hotel  the locati...   \n",
       "\n",
       "                                             summary  \n",
       "0  we were blown away by this excellent hotel we ...  \n",
       "1  The hotel is great for value the breakfast sel...  \n",
       "2  stayed for a short city break  the hotel is a ...  \n",
       "3   hotel turned out to be perfect for our short ...  \n",
       "4  we had the best stay at cler hotel  the locati...  "
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_combined.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Dockerfile                            df_combined.csv\n",
      "Hotel New York Combined.csv           en_core_web_sm-3.2.0-py3-none-any.whl\n",
      "README.md                             query_generator.ipynb\n",
      "Untitled.ipynb                        requirements.txt\n",
      "app.py                                summary.ipynb\n",
      "app.yaml\n"
     ]
    }
   ],
   "source": [
    "!ls"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/aimzlicious/miniforge3/envs/tf_m1/lib/python3.8/site-packages/huggingface_hub/snapshot_download.py:6: FutureWarning: snapshot_download.py has been made private and will no longer be available from version 0.11. Please use `from huggingface_hub import snapshot_download` to import the only public function in this module. Other members of the file may be changed without a deprecation notice.\n",
      "  warnings.warn(\n"
     ]
    }
   ],
   "source": [
    "import pandas as pd\n",
    "from sentence_transformers import SentenceTransformer\n",
    "import scipy.spatial\n",
    "import pickle as pkl\n",
    "from sentence_transformers import SentenceTransformer, util\n",
    "import torch\n",
    "df_combined_paris_summary = pd.read_csv('df_combined_paris.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "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>Hotel</th>\n",
       "      <th>all_review</th>\n",
       "      <th>summary</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>25hours Hotel Terminus Nord</td>\n",
       "      <td>weve spent lots of time in paris and this was ...</td>\n",
       "      <td>we were blown away by this excellent hotel we ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Acacias Etoile Hotel</td>\n",
       "      <td>the hotel is great for value the breakfast sel...</td>\n",
       "      <td>The hotel is great for value the breakfast sel...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>COQ Hotel Paris</td>\n",
       "      <td>stayed for a short city break  the hotel is a ...</td>\n",
       "      <td>stayed for a short city break  the hotel is a ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Campanile Paris 14 - Maine Montparnasse</td>\n",
       "      <td>room was very clean  transportation is very ne...</td>\n",
       "      <td>hotel turned out to be perfect for our short ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Cler Hotel</td>\n",
       "      <td>we had the best stay at cler hotel  the locati...</td>\n",
       "      <td>we had the best stay at cler hotel  the locati...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                     Hotel  \\\n",
       "0              25hours Hotel Terminus Nord   \n",
       "1                     Acacias Etoile Hotel   \n",
       "2                          COQ Hotel Paris   \n",
       "3  Campanile Paris 14 - Maine Montparnasse   \n",
       "4                               Cler Hotel   \n",
       "\n",
       "                                          all_review  \\\n",
       "0  weve spent lots of time in paris and this was ...   \n",
       "1  the hotel is great for value the breakfast sel...   \n",
       "2  stayed for a short city break  the hotel is a ...   \n",
       "3  room was very clean  transportation is very ne...   \n",
       "4  we had the best stay at cler hotel  the locati...   \n",
       "\n",
       "                                             summary  \n",
       "0  we were blown away by this excellent hotel we ...  \n",
       "1  The hotel is great for value the breakfast sel...  \n",
       "2  stayed for a short city break  the hotel is a ...  \n",
       "3   hotel turned out to be perfect for our short ...  \n",
       "4  we had the best stay at cler hotel  the locati...  "
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_combined_paris.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_paris = pd.read_csv('paris_clean_newer.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "hotel=pd.DataFrame(df_paris['Hotel'].drop_duplicates())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "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>Hotel</th>\n",
       "      <th>all_review</th>\n",
       "      <th>summary</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>25hours Hotel Terminus Nord</td>\n",
       "      <td>weve spent lots of time in paris and this was ...</td>\n",
       "      <td>we were blown away by this excellent hotel we ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Acacias Etoile Hotel</td>\n",
       "      <td>the hotel is great for value the breakfast sel...</td>\n",
       "      <td>The hotel is great for value the breakfast sel...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>COQ Hotel Paris</td>\n",
       "      <td>stayed for a short city break  the hotel is a ...</td>\n",
       "      <td>stayed for a short city break  the hotel is a ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Campanile Paris 14 - Maine Montparnasse</td>\n",
       "      <td>room was very clean  transportation is very ne...</td>\n",
       "      <td>hotel turned out to be perfect for our short ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Cler Hotel</td>\n",
       "      <td>we had the best stay at cler hotel  the locati...</td>\n",
       "      <td>we had the best stay at cler hotel  the locati...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>89</th>\n",
       "      <td>Sofitel Paris Le Faubourg</td>\n",
       "      <td>4 years ago i was the last time at sofitel le ...</td>\n",
       "      <td>4 years ago i was the last time at sofitel le ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>90</th>\n",
       "      <td>St Christopher's Gare du Nord Paris</td>\n",
       "      <td>when arriving to the area it felt a little dan...</td>\n",
       "      <td>Barry is the best bartender in paris cheers gr...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91</th>\n",
       "      <td>St Christopher's Inn Canal Paris</td>\n",
       "      <td>ive stayed at st christopher inn canal in pari...</td>\n",
       "      <td>ive stayed at st christopher inn canal in pari...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>92</th>\n",
       "      <td>Touring Hotel</td>\n",
       "      <td>hotel is in a great location  minutes walk fro...</td>\n",
       "      <td>Hotel is in a great location  minutes walk fro...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>93</th>\n",
       "      <td>Warwick Paris</td>\n",
       "      <td>if i know of anybody heading to paris i will r...</td>\n",
       "      <td>warwick hotel in paris is a good hotel to stay...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>94 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                      Hotel  \\\n",
       "0               25hours Hotel Terminus Nord   \n",
       "1                      Acacias Etoile Hotel   \n",
       "2                           COQ Hotel Paris   \n",
       "3   Campanile Paris 14 - Maine Montparnasse   \n",
       "4                                Cler Hotel   \n",
       "..                                      ...   \n",
       "89                Sofitel Paris Le Faubourg   \n",
       "90      St Christopher's Gare du Nord Paris   \n",
       "91         St Christopher's Inn Canal Paris   \n",
       "92                            Touring Hotel   \n",
       "93                            Warwick Paris   \n",
       "\n",
       "                                           all_review  \\\n",
       "0   weve spent lots of time in paris and this was ...   \n",
       "1   the hotel is great for value the breakfast sel...   \n",
       "2   stayed for a short city break  the hotel is a ...   \n",
       "3   room was very clean  transportation is very ne...   \n",
       "4   we had the best stay at cler hotel  the locati...   \n",
       "..                                                ...   \n",
       "89  4 years ago i was the last time at sofitel le ...   \n",
       "90  when arriving to the area it felt a little dan...   \n",
       "91  ive stayed at st christopher inn canal in pari...   \n",
       "92  hotel is in a great location  minutes walk fro...   \n",
       "93  if i know of anybody heading to paris i will r...   \n",
       "\n",
       "                                              summary  \n",
       "0   we were blown away by this excellent hotel we ...  \n",
       "1   The hotel is great for value the breakfast sel...  \n",
       "2   stayed for a short city break  the hotel is a ...  \n",
       "3    hotel turned out to be perfect for our short ...  \n",
       "4   we had the best stay at cler hotel  the locati...  \n",
       "..                                                ...  \n",
       "89  4 years ago i was the last time at sofitel le ...  \n",
       "90  Barry is the best bartender in paris cheers gr...  \n",
       "91  ive stayed at st christopher inn canal in pari...  \n",
       "92  Hotel is in a great location  minutes walk fro...  \n",
       "93  warwick hotel in paris is a good hotel to stay...  \n",
       "\n",
       "[94 rows x 3 columns]"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_combined_paris.merge(hotel,how='left')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "interpreter": {
   "hash": "4bd624a0593993fe43ac4046b27b898fb2ef75c21c08f81e89e64ea0f51df676"
  },
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "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.8.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}