{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "22a036c2", "metadata": {}, "outputs": [], "source": [ "import os\n", "\n", "openai.api_key = os.environ[\"OPENAI_API_KEY\"]" ] }, { "cell_type": "code", "execution_count": 2, "id": "8ea39412", "metadata": {}, "outputs": [], "source": [ "from langchain.llms import OpenAI\n", "from langchain.embeddings import OpenAIEmbeddings\n", "from langchain.chains import LLMChain, HypotheticalDocumentEmbedder\n", "from langchain.prompts import PromptTemplate\n", "\n", "from langchain.document_loaders import TextLoader\n", "import langchain\n", "from langchain.embeddings import HuggingFaceBgeEmbeddings" ] }, { "cell_type": "code", "execution_count": 3, "id": "afaf3b0a", "metadata": {}, "outputs": [], "source": [ "llm = model_name = \"BAAI/bge-small-en-v1.5\"\n", "encode_kwargs = {'normalize_embeddings': True} # set True to compute cosine similarity\n", "\n", "bge_embeddings = HuggingFaceBgeEmbeddings(\n", " model_name=model_name,\n", " model_kwargs={'device': 'cuda'},\n", " encode_kwargs=encode_kwargs\n", ")" ] }, { "cell_type": "code", "execution_count": 4, "id": "13e654f6", "metadata": {}, "outputs": [], "source": [ "llm = OpenAI()" ] }, { "cell_type": "code", "execution_count": 5, "id": "2dde0d4b", "metadata": {}, "outputs": [], "source": [ "embeddings = HypotheticalDocumentEmbedder.from_llm(llm,\n", " bge_embeddings,\n", " prompt_key=\"web_search\"\n", " )" ] }, { "cell_type": "code", "execution_count": 6, "id": "c51019f2", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "PromptTemplate(input_variables=['QUESTION'], template='Please write a passage to answer the question \\nQuestion: {QUESTION}\\nPassage:')" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "embeddings.llm_chain.prompt" ] }, { "cell_type": "code", "execution_count": 7, "id": "8901d176", "metadata": {}, "outputs": [], "source": [ "langchain.debug = True" ] }, { "cell_type": "code", "execution_count": 8, "id": "94e41319", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[32;1m\u001b[1;3m[llm/start]\u001b[0m \u001b[1m[1:llm:OpenAI] Entering LLM run with input:\n", "\u001b[0m{\n", " \"prompts\": [\n", " \"Please write a passage to answer the question \\nQuestion: What are some distinguishing features or amenities that guests frequently highlight about their experience at Willard InterContinental Washington?\\nPassage:\"\n", " ]\n", "}\n", "\u001b[36;1m\u001b[1;3m[llm/end]\u001b[0m \u001b[1m[1:llm:OpenAI] [3.52s] Exiting LLM run with output:\n", "\u001b[0m{\n", " \"generations\": [\n", " [\n", " {\n", " \"text\": \" \\nWillard InterContinental Washington is renowned for its luxurious amenities and distinguished features. Guests often highlight the quality of the hotel's accommodations, from the plush beds and pillows to the premium bath amenities. The hotel's five-star restaurant, Café du Parc, is also a highlight for many guests, who appreciate its sophisticated atmosphere and its wide selection of French-inspired dishes. The hotel's signature bar, The Round Robin, is also a popular choice for guests, with its classic cocktails and relaxed atmosphere. Other amenities that guests often highlight include the hotel's proximity to major attractions, its 24-hour fitness center, and its convenient valet parking services. Overall, Willard InterContinental Washington stands out for its superior hospitality and luxurious amenities, making it a popular choice for travelers.\",\n", " \"generation_info\": {\n", " \"finish_reason\": \"stop\",\n", " \"logprobs\": null\n", " },\n", " \"type\": \"Generation\"\n", " }\n", " ]\n", " ],\n", " \"llm_output\": {\n", " \"token_usage\": {\n", " \"total_tokens\": 198,\n", " \"completion_tokens\": 160,\n", " \"prompt_tokens\": 38\n", " },\n", " \"model_name\": \"text-davinci-003\"\n", " },\n", " \"run\": null\n", "}\n" ] } ], "source": [ "result = embeddings.embed_query(\"What are some distinguishing features or amenities that guests frequently highlight about their experience at Willard InterContinental Washington?\")" ] }, { "cell_type": "code", "execution_count": 9, "id": "b0eb822f", "metadata": {}, "outputs": [], "source": [ "from langchain.text_splitter import CharacterTextSplitter\n", "from langchain.vectorstores import Chroma\n", "\n", "loaders = [\n", " TextLoader('offering_0.001.txt'),\n", " TextLoader('output_proper_review_chunk_1.txt'),\n", " TextLoader('output_proper_review_chunk_2.txt'),\n", " TextLoader('output_proper_review_chunk_3.txt'),\n", "\n", "]\n", "docs = []\n", "for l in loaders:\n", " docs.extend(l.load())\n", "\n", "text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)\n", "\n", "texts = text_splitter.split_documents(docs) #split_text" ] }, { "cell_type": "code", "execution_count": 10, "id": "b8bb19e7", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[Document(page_content='[{\"hotel_class\": 4.0, \"region_id\": 60763, \"url\": \"http://www.tripadvisor.com/Hotel_Review-g60763-d113317-Reviews-Casablanca_Hotel_Times_Square-New_York_City_New_York.html\", \"phone\": \"\", \"details\": null, \"address\": {\"region\": \"NY\", \"street-address\": \"147 West 43rd Street\", \"postal-code\": \"10036\", \"locality\": \"New York City\"}, \"type\": \"hotel\", \"id\": 113317, \"name\": \"Casablanca Hotel Times Square\"}, {\"hotel_class\": 5.0, \"region_id\": 32655, \"url\": \"http://www.tripadvisor.com/Hotel_Review-g32655-d76049-Reviews-Four_Seasons_Hotel_Los_Angeles_at_Beverly_Hills-Los_Angeles_California.html\", \"phone\": \"\", \"details\": null, \"address\": {\"region\": \"CA\", \"street-address\": \"300 S Doheny Dr\", \"postal-code\": \"90048\", \"locality\": \"Los Angeles\"}, \"type\": \"hotel\", \"id\": 76049, \"name\": \"Four Seasons Hotel Los Angeles at Beverly Hills\"}, {\"hotel_class\": 3.5, \"region_id\": 60763, \"url\": \"http://www.tripadvisor.com/Hotel_Review-g60763-d99352-Reviews-Hilton_Garden_Inn_Times_Square-New_York_City_New_York.html\", \"phone\": \"\", \"details\": null, \"address\": {\"region\": \"NY\", \"street-address\": \"790 Eighth Avenue\", \"postal-code\": \"10019\", \"locality\": \"New York City\"}, \"type\": \"hotel\", \"id\": 99352, \"name\": \"Hilton Garden Inn Times Square\"}, {\"hotel_class\": 4.0, \"region_id\": 60763, \"url\": \"http://www.tripadvisor.com/Hotel_Review-g60763-d93589-Reviews-The_Michelangelo_Hotel-New_York_City_New_York.html\", \"phone\": \"\", \"details\": null, \"address\": {\"region\": \"NY\", \"street-address\": \"152 West 51st Street\", \"postal-code\": \"10019\", \"locality\": \"New York City\"}, \"type\": \"hotel\", \"id\": 93589, \"name\": \"The Michelangelo Hotel\"}]', metadata={'source': 'offering_0.001.txt'}),\n", " Document(page_content='[{\"ratings\": {\"service\": 5.0, \"cleanliness\": 5.0, \"overall\": 5.0, \"value\": 5.0, \"location\": 5.0, \"sleep_quality\": 5.0, \"rooms\": 5.0}, \"title\": \"\\\\u201cTruly is \\\\\"Jewel of the Upper Wets Side\\\\\"\\\\u201d\", \"text\": \"Stayed in a king suite for 11 nights and yes it cots us a bit but we were happy with the standard of room, the location and the friendliness of the staff. Our room was on the 20th floor overlooking Broadway and the madhouse of the Fairway Market. Room was quite with no noise evident from the hallway or adjoining rooms. It was great to be able to open windows when we craved fresh rather than heated air. The beds, including the fold out sofa bed, were comfortable and the rooms were cleaned well. Wi-fi access worked like a dream with only one connectivity issue on our first night and this was promptly responded to with a call from the service provider to ensure that all was well. The location close to the 72nd Street subway station is great and the complimentary umbrellas on the drizzly days were greatly appreciated. It is fabulous to have the kitchen with cooking facilities and the access to a whole range of fresh foods directly across the road at Fairway.\\\\nThis is the second time that members of the party have stayed at the Beacon and it will certainly be our hotel of choice for future visits.\", \"author\": {\"username\": \"Papa_Panda\", \"num_cities\": 22, \"num_helpful_votes\": 12, \"num_reviews\": 29, \"num_type_reviews\": 24, \"id\": \"8C0B42FF3C0FA366A21CFD785302A032\", \"location\": \"Gold Coast\"}, \"date_stayed\": \"December 2012\", \"offering_id\": 93338, \"num_helpful_votes\": 0, \"date\": \"December 17, 2012\", \"id\": 147643103, \"via_mobile\": false}, {\"ratings\": {\"service\": 5.0, \"cleanliness\": 5.0, \"overall\": 5.0, \"value\": 5.0, \"location\": 5.0, \"sleep_quality\": 5.0, \"rooms\": 5.0}, \"title\": \"\\\\u201cMy home away from home!\\\\u201d\", \"text\": \"On every visit to NYC, the Hotel Beacon is the place we love to stay. So conveniently located to Central Park, Lincoln Center and great local restaurants. The rooms are lovely - beds so comfortable, a great little kitchen and new wizz bang coffee maker. The staff are so accommodating and just love walking across the street to the Fairway supermarket with every imaginable goodies to eat (if you choose not to go out for every meal!)\", \"author\": {\"username\": \"Maureen V\", \"num_reviews\": 2, \"num_cities\": 2, \"id\": \"E3C85CA9DBBBC77E0DB534ABE93E4713\", \"location\": \"Sydney, New South Wales, Australia\"}, \"date_stayed\": \"December 2012\", \"offering_id\": 93338, \"num_helpful_votes\": 0, \"date\": \"December 17, 2012\", \"id\": 147639004, \"via_mobile\": false}, {\"ratings\": {\"service\": 4.0, \"cleanliness\": 5.0, \"overall\": 4.0, \"value\": 4.0, \"location\": 5.0, \"sleep_quality\": 4.0, \"rooms\": 4.0}, \"title\": \"\\\\u201cGreat Stay\\\\u201d\", \"text\": \"This is a great property in Midtown. We two different rooms different rooms during our stay. The first room was in the North tower, which was quite inconvenient. You have to go through the conference area to get to the north elevators. \\\\nThe second room was the Andaz Suite. It was nicely appointed room, but the best part about it was the bathroom. From the foot soaking bowl to the bath products, everything about the bathroom was awesome!\\\\nLemon poppy-seed pancakes are must haves at the restaurant. One of the best pancakes ever.\", \"author\": {\"username\": \"vuguru\", \"num_cities\": 12, \"num_helpful_votes\": 17, \"num_reviews\": 14, \"num_type_reviews\": 14, \"id\": \"FB1032DECE1162CB3556D05F278AAFFD\", \"location\": \"Houston\"}, \"date_stayed\": \"December 2012\", \"offering_id\": 1762573, \"num_helpful_votes\": 0, \"date\": \"December 18, 2012\", \"id\": 147697954, \"via_mobile\": false}, {\"ratings\": {\"service\": 5.0, \"cleanliness\": 5.0, \"overall\": 4.0, \"value\": 5.0, \"location\": 5.0, \"sleep_quality\": 5.0, \"rooms\": 5.0}, \"title\": \"\\\\u201cModern Convenience\\\\u201d\", \"text\": \"The Andaz is a nice hotel in a central location of Manhattan. The Hyatt has come up with a modern hotel that is both comfortable and convenient. When you arrive you are greeted by friendly \\\\\"Hosts\\\\\" and they walk you to the check-in desk while offering you a beverage. \\\\nWe had a one bedroom suite that accommodated four people reasonably well. Plenty of closet space, well lit with floor to ceiling windows, and actually quiet!\\\\nThe bathroom was large with a very nice walk-in shower and a built-in bench with unique low spout to wash your feet.\\\\nThe kitchenette was a nice touch with a stocked fridge offering complimentary non-alcoholic beverages and snacks, dishes and utensils, a sink, dishwasher, and a microwave. \\\\nThey have daily Happy Hour(s) where you can get a complimentary decent glass of wine in the modest Lobby Lounge and bring it to your room. The Lobby Lounge has some seating and one table with 8 or so chairs where you can buy food from the adjacent restaurant. One suggestion is to offer selections of cheese and crackers platters to go with that wine. We ordered one that had to be custom made, but it worked well. \\\\nWe didn\\'t eat in the hotel restaurants. The restaurant off the lobby was very pricey for breakfast (+$20 per entree). When you can get a decent breakfast within a block or two of the hotel for under $10, what can I say?\\\\nAs a hotel designer and someone who is very picky about hotels, I will definitely stay there again and I highly recommend it.\", \"author\": {\"username\": \"Hotel-Designer\", \"num_cities\": 5, \"num_helpful_votes\": 26, \"num_reviews\": 5, \"num_type_reviews\": 5, \"id\": \"EC3E275EE7590694889C8C7EE0D13961\", \"location\": \"Laguna Beach, CA\"}, \"date_stayed\": \"August 2012\", \"offering_id\": 1762573, \"num_helpful_votes\": 0, \"date\": \"December 17, 2012\", \"id\": 147625723, \"via_mobile\": false}, {\"ratings\": {\"service\": 4.0, \"cleanliness\": 5.0, \"overall\": 4.0, \"value\": 3.0, \"location\": 5.0, \"sleep_quality\": 5.0, \"rooms\": 5.0}, \"title\": \"\\\\u201cIts the best of the Andaz Brand in the US....\\\\u201d\", \"text\": \"I have stayed at each of the US Andaz properties, and this one is the best of them all. MUCH better than the West Hollywood property where Brand standards are slowly fading. This is the shining star here in the States.\\\\nMy room (suite) on the 12th floor was fantastic as usual. Perfectly maintained, very comfortable, great bathrooms (best in NYC???). The bathroom is huge, with large shower \\'room\\' and multiple shower heads. Double lavatories flank one wall. Huge....\\\\nTHe bed is always perfect. Televisions in both rooms were perfect for my limited time spend in the suite. Nice desk for work area and in room dining. \\\\nEvery room has a fridge with complimentary soft drinks, snacks, water, sparkling water, milk and juices. Nice touch. Suite has full size refrigerator with icemaker, and also features a microwave, sink and dishwasher drawer....all nicely concealed behind beautiful cabinetry. Really great for a longer stay...\\\\nI do have 2 complaints. First, the elevators. The waits were sometimes ridiculous. 3 elevators serve the main tower with a rather limited number of rooms. THis is a newer hotel, but there is no service elevator. I was continually surprised after waiting for an elevator at how many stops we made for housekeeping to enter with carts, room service carts and trays, etc. How could Hyatt skip a service elevator on this new property? It really stinks at times.....its bad.\\\\nLastly, i have traveled with world and certainly know NYC pricing. Breakfast at the Andaz ranks above almost anything i have ever paid. Apparently, i had a $190.00 breakfast for two the first morning, and $175.00 the second. Eggs for each, coffee, berries. Wow. Of course, i really don\\'t know...as there is no bill. They just deliver it, and leave. Prices are listed in the in-suite menu, but no itemized billing is given. I am \\'gifted\\' with a $75.00 credit for my breakfast as a Diamond member, and i assumed that had not been applied when my bill reflected a \\'non itemized\\' charge for $110 plus for the first night, and slightly less for the second. I was wrong, it had been applied (no way for me to see this). WOW. It certainly isn\\'t worth it.\\\\nI know i sound like one of those guys who complains about pricing, but clearly doesn\\'t know what things cost. Wrong. This one really surprised me, and i have traveled the world for more than 20 years staying in some of the finest hotels in the world. Andaz is great, but it doesn\\'t rank with many that i have had the pleasure of staying with.\\\\nI just had breakfast this morning for 2 at the Four Seasons NYC. It was half the cost....almost. :)\\\\nStay away from room service in my opinion....\", \"author\": {\"username\": \"JamesE339\", \"num_cities\": 34, \"num_helpful_votes\": 65, \"num_reviews\": 104, \"num_type_reviews\": 49, \"id\": \"BA524A238B1171206691A6CC3F28F266\", \"location\": \"Saint Louis, Missouri\"}, \"date_stayed\": \"December 2012\", \"offering_id\": 1762573, \"num_helpful_votes\": 0, \"date\": \"December 17, 2012\", \"id\": 147612823, \"via_mobile\": false}, {\"ratings\": {\"service\": 5.0, \"cleanliness\": 5.0, \"overall\": 5.0, \"value\": 4.0, \"location\": 5.0, \"sleep_quality\": 4.0, \"rooms\": 5.0}, \"title\": \"\\\\u201cOne of NYC\\'s Best Hotels, Hands Down\\\\u201d\", \"text\": \"Excellent staff (they remembered our names from the moment our family walked in). Our original suite was overbooked, so we ended up in a much nicer suite (no complaints here). Extremely convenient location to Fifth Avenue shopping, restaurants, and subway system. Use the concierge, they worked magic throughout our entire stay. Regardless of whether we needed tickets, or merely a ride, the staff would go out of their way to make sure we were happy. Honestly will have trouble staying at any other hotel in the NYC area. Room service was superb. One of our family members forgot their toothbrush. We called downstairs and within 3 minutes, we had four. \\\\nFor those who stay at this hotel, there\\'s always a chance at a celebrity sighting. Our hotel neighbor happened to be Jamie Foxx, who was staying during his Django Unchained promotional tour.\", \"author\": {\"username\": \"Breakonacloud-com\", \"num_reviews\": 1, \"id\": \"B766E25C73F354AC433EF628F3ACD23B\", \"location\": \"Nashville, Tennessee\"}, \"date_stayed\": \"December 2012\", \"offering_id\": 1776857, \"num_helpful_votes\": 0, \"date\": \"December 19, 2012\", \"id\": 147762928, \"via_mobile\": false}, {\"ratings\": {\"service\": 5.0, \"cleanliness\": 5.0, \"overall\": 5.0, \"value\": 4.0, \"rooms\": 5.0, \"location\": 4.0}, \"title\": \"\\\\u201cApartment living for less than most 5 stars\\\\u201d\", \"text\": \"I stayed at the Setai for 3 nights last week, as my company reserved a block for us. Although the hotel is not near Lincoln Center, which is where we shuttled to every day, I found the hotel to be a true gem. I have stayed at countless hotels in NYC and this is by far the best value. Loved the spacious rooms, modern furnishings and all the free offerings (mini bar, cookies, Internet, pressing). Regina/Chris in sales stayed all night to help coordinate my guests, and Brian/Matt/Louis from the front desk could not have been nicer. The door men were amazing- they assisted our last-minute transport needs with grace, special thank you to Joe, Mike and the security team. My boss is very hard to impress and he has already mentioned he would like to book again next year.\", \"author\": {\"username\": \"French1976\", \"num_cities\": 2, \"num_reviews\": 3, \"num_type_reviews\": 3, \"id\": \"0BCA612BCCBA8C065FD9A9C09D27CA53\", \"location\": \"\"}, \"date_stayed\": \"December 2012\", \"offering_id\": 1776857, \"num_helpful_votes\": 0, \"date\": \"December 18, 2012\", \"id\": 147681943, \"via_mobile\": false}, {\"ratings\": {\"service\": 5.0, \"cleanliness\": 5.0, \"overall\": 5.0, \"value\": 4.0, \"location\": 5.0, \"sleep_quality\": 5.0, \"rooms\": 5.0}, \"title\": \"\\\\u201cLovely stay at The Chatwal\\\\u201d\", \"text\": \"My husband and I stayed at The Chatwal for 9 nights in April 2012. We booked our rooms via booking.com. We arrived at the hotel very late at night but our check-in was very easy and just like many other reviewers we got upgraded to a suite.\\\\nWe fell in love with the decor. It is just like the photos in the hotel website. The lobby smelled lovely with their signature scent. It was even lovelier when mixed with the fresh coffee smell in the morning. \\\\nBeds were extremely comfortable. Books in the room were a nice touch. We had two bathrooms after our upgrade which we appreciated a lot. The bathrooms were really very chic and the TOTO toilets were something! \\\\nThe housekeeping service was really good with turn-down service.\\\\nWe had drinks at the Lambs Club bar nearly every night with our friends and were very happy with everything. We had dinner at the Lambs Club restaurant downstairs and were very pleased. We did not have breakfast at the hotel as there are a lot of alternatives close by.\\\\nMy husband had a couple of pre-arranged deliveries and the concierge were very helpful with them. We thank Mr Mullins for all his help. We never saw our butler during our 9 night stay, therefore I cannot comment on the butler service, but we did not really need it anyway. \\\\nOverall a great 5-star boutique hotel experience in a very central NYC location.\", \"author\": {\"username\": \"ilkim\", \"num_cities\": 6, \"num_helpful_votes\": 6, \"num_reviews\": 8, \"num_type_reviews\": 7, \"id\": \"BB4AB5B542FDB3E543FE3AEE01F159B3\", \"location\": \"Istanbul, Turkey\"}, \"date_stayed\": \"April 2012\", \"offering_id\": 1641016, \"num_helpful_votes\": 0, \"date\": \"December 20, 2012\", \"id\": 147769675, \"via_mobile\": false}]', metadata={'source': 'output_proper_review_chunk_1.txt'}),\n", " Document(page_content='[{\"ratings\": {\"service\": 5.0, \"cleanliness\": 5.0, \"overall\": 5.0, \"value\": 4.0, \"location\": 5.0, \"sleep_quality\": 5.0, \"rooms\": 5.0}, \"title\": \"\\\\u201cExclusive boutique h\\\\u00f4tel\\\\u201d\", \"text\": \"Wonderful boutique hotel located next to Times Square. Subway is two blocks away to all of Manhattan. Numerous classic eateries within walking distance. Bathrooms are ideal with Japanese heated cleansing toilettes.\", \"author\": {\"username\": \"otisokansascity\", \"num_cities\": 15, \"num_helpful_votes\": 16, \"num_reviews\": 53, \"num_type_reviews\": 5, \"id\": \"400210E0882D6A1212C0CC91CC54CE5A\", \"location\": \"Kansas City\"}, \"date_stayed\": \"December 2012\", \"offering_id\": 1641016, \"num_helpful_votes\": 0, \"date\": \"December 19, 2012\", \"id\": 147722090, \"via_mobile\": false}, {\"ratings\": {\"service\": 4.0, \"cleanliness\": 5.0, \"overall\": 4.0, \"value\": 4.0, \"location\": 5.0, \"sleep_quality\": 5.0, \"rooms\": 4.0}, \"title\": \"\\\\u201cA Nice Stay for NYC!\\\\u201d\", \"text\": \"This hotel is a nice stay for NYC because the rooms are very clean, hotel is very comfortable, and it\\'s in a great location. A few blocks from Herald Square, 34th street shopping, Madison Square Gardens, Penn Station...everything! The staff was very nice and always accommodating. The hotel also has a great view of the Empire State Building in rooms facing 6th Ave. Very cool pic to have if you get lucky!\\\\nI was extremely satisfied with the my two night\\'s stay and would stay again.\", \"author\": {\"username\": \"nikkigfoster\", \"num_cities\": 13, \"num_helpful_votes\": 6, \"num_reviews\": 27, \"num_type_reviews\": 15, \"id\": \"EC6CB11E9DC8761710DDA3CF48DD995F\", \"location\": \"Atlanta, Georgia\"}, \"date_stayed\": \"December 2012\", \"offering_id\": 1456560, \"num_helpful_votes\": 0, \"date\": \"December 19, 2012\", \"id\": 147759101, \"via_mobile\": false}, {\"ratings\": {\"service\": 5.0, \"cleanliness\": 5.0, \"overall\": 5.0, \"value\": 5.0, \"location\": 4.0, \"sleep_quality\": 5.0, \"rooms\": 5.0}, \"title\": \"\\\\u201cDon\\'t miss this great place!\\\\u201d\", \"text\": \"I\\'ve stayed at 4 and 5 star hotels all over Manhattan. Over the past year, however, I have returned each time to the Eventi. Wonderful staff, beautiful hotel, incredibly comfortable rooms and for my needs terrific location.\", \"author\": {\"username\": \"DrTiller\", \"num_reviews\": 1, \"id\": \"10BE07B397D5814F9ECCC875B1BA96C9\", \"location\": \"Miami Beach, Florida\"}, \"date_stayed\": \"December 2012\", \"offering_id\": 1456560, \"num_helpful_votes\": 0, \"date\": \"December 19, 2012\", \"id\": 147735177, \"via_mobile\": false}, {\"ratings\": {\"service\": 5.0, \"cleanliness\": 5.0, \"overall\": 5.0, \"value\": 4.0, \"location\": 5.0, \"sleep_quality\": 4.0, \"rooms\": 5.0}, \"title\": \"\\\\u201cPerfectly placed delightful hotel\\\\u201d\", \"text\": \"Stayed at this hotel for four nights in December 2012. It is perfectly located two blocks from Times Square and one block from Fifth Avenue. We found it a perfect base to explore all Manhattan has to offer. Walking to Central Park took approximately 20 minutes, Times Square was less than 5 minutes away and with close Subway stations access to all of Manhattan is a piece of cake.\\\\nWith regard the hotel itself, we were very happy with out choice. Location aside, the hotel was very clean and well appointed. We had a room on the 11th floor, and after sending the hotel an email prior to our arrival they provided a room with a view of the Chrysler Building, as requested.\\\\nThe room itself was a decent size, tidy bathroom with powerful shower and Molton Brown products. The hotel has two lifts servicing all floor, and we never had to wait for a lift. Both the concierge and the front desk staff were very helpful and courteous, as were the bell boys. A wonderful little touch was the urn in the reception area. In the morning it was full of coffee, with cups available for you to take out with you. And from the afternoon onwards, hot cider was available. \\\\nVery happy with our choice and won\\'t hesitate to return the next time we visit New York.\", \"author\": {\"username\": \"tjbeynon\", \"num_cities\": 9, \"num_helpful_votes\": 6, \"num_reviews\": 11, \"num_type_reviews\": 9, \"id\": \"E530271FD1F16DF31858BD6C7BABD559\", \"location\": \"Bristol, United Kingdom\"}, \"date_stayed\": \"December 2012\", \"offering_id\": 93396, \"num_helpful_votes\": 0, \"date\": \"December 18, 2012\", \"id\": 147689989, \"via_mobile\": false}, {\"ratings\": {\"service\": 4.0, \"cleanliness\": 5.0, \"overall\": 4.0, \"value\": 4.0, \"location\": 5.0, \"sleep_quality\": 5.0, \"rooms\": 4.0}, \"title\": \"\\\\u201cTop Hotel for Break in NYC\\\\u201d\", \"text\": \"Hotel was very very good. High quality finish throughout, very comfortable bed, lovely breakfast. Great location. Hotel is a few minutes walk from Rockefeller center and 5th avenue. The subway is right on your door. Only slight critique would be the night life tends to close around 11pm in the immediate area. Very minor issue as we were not in New York to get drunk. Breakfast was basic but perfectly acceptable, lovely fresh continental breakfast, decent coffee, fruit juices, yoghurts. You can eat as much as you like and grab a coffee before you head into New York. The door staff were great, they found us a taxi at rush hour in the rain which in NYC isn\\'t the easiest thing to do.\\\\nThe only problem we had was that our safe was not working when we arrived, (battery was duff) but this was fixed within 20 mins.\\\\nOverall, no complaints, would definitely return again.\", \"author\": {\"username\": \"TurboBailey\", \"num_reviews\": 1, \"id\": \"D7C43AEC4609560C8BE39C6B95EA3137\", \"location\": \"UK\"}, \"date_stayed\": \"December 2012\", \"offering_id\": 80112, \"num_helpful_votes\": 0, \"date\": \"December 19, 2012\", \"id\": 147758332, \"via_mobile\": false}, {\"ratings\": {\"service\": 4.0, \"cleanliness\": 4.0, \"overall\": 4.0, \"value\": 4.0, \"location\": 5.0, \"sleep_quality\": 4.0, \"rooms\": 4.0}, \"title\": \"\\\\u201cGreat location!\\\\u201d\", \"text\": \"We chose the San Carlos based on reviews in T.A and were not disappointed. Location was great, rooms large in good condition, well appointed and staff friendly and helpful. San Carlos was a great location for all the mid and uptown events and attractions we had planned. Close enough for an easy walk to Times Square but far enough away from the crowd and noise. Near to subway for added convenience. The guest rooms are quite large, though the bath is smaller, but we would recommend to friends and stay again on our next NYC visit.\", \"author\": {\"username\": \"tryingfor100\", \"num_cities\": 12, \"num_helpful_votes\": 8, \"num_reviews\": 28, \"num_type_reviews\": 12, \"id\": \"2A66F1FFC377F8CFB078A122A4DDC3E5\", \"location\": \"Phoenix, Arizona\"}, \"date_stayed\": \"December 2012\", \"offering_id\": 80112, \"num_helpful_votes\": 0, \"date\": \"December 17, 2012\", \"id\": 147640456, \"via_mobile\": false}, {\"ratings\": {\"service\": 5.0, \"cleanliness\": 5.0, \"overall\": 5.0, \"value\": 5.0, \"location\": 5.0, \"sleep_quality\": 5.0, \"rooms\": 5.0}, \"title\": \"\\\\u201cBest hotel in New York\\\\u201d\", \"text\": \"The service, location, cleanliness were outstanding. Even though the hot water was supposed to be off from 11:00 p.m. to 6:00 a.m. (do not know if it was or not) it did not affect me. It is a great hotel to walk from/to as one gets the full flavor of 5th Avenue.\", \"author\": {\"username\": \"Tom G\", \"num_reviews\": 8, \"num_cities\": 3, \"id\": \"680AA74DAD6C294713EEF38D09B0625D\", \"location\": \"Castle Rock, Colorado\"}, \"date_stayed\": \"November 2012\", \"offering_id\": 93559, \"num_helpful_votes\": 0, \"date\": \"December 18, 2012\", \"id\": 147677090, \"via_mobile\": false}, {\"ratings\": {\"service\": 5.0, \"cleanliness\": 5.0, \"overall\": 5.0, \"value\": 5.0, \"location\": 5.0, \"sleep_quality\": 5.0, \"rooms\": 5.0}, \"title\": \"\\\\u201cMy favorite classy hotel in New York City\\\\u201d\", \"text\": \"This is one of the best and my favorite swanky hotel in New York City. When in NYC this is where I stay. An intimate atmosphere, attentive courteous staff, wonderful location across the street from Central Park. Wonderful bar and restaurants. This is what the Ritz Carlton\\'s try to be. \\\\nIf you\\'ve never stayed at the Sherry Netherland I suggest you try it. If you have stayed there, then you must know what I am talking about.\", \"author\": {\"username\": \"Peter G\", \"num_cities\": 18, \"num_helpful_votes\": 11, \"num_reviews\": 38, \"num_type_reviews\": 10, \"id\": \"1599EC7EFF037E47A251CB5F20ACCAA9\", \"location\": \"Lake Arrowhead, California, United States\"}, \"date_stayed\": \"March 2012\", \"offering_id\": 93559, \"num_helpful_votes\": 1, \"date\": \"November 25, 2012\", \"id\": 146143543, \"via_mobile\": false}]', metadata={'source': 'output_proper_review_chunk_2.txt'}),\n", " Document(page_content='[{\"ratings\": {\"service\": 5.0, \"cleanliness\": 5.0, \"overall\": 5.0, \"value\": 5.0, \"location\": 5.0, \"sleep_quality\": 5.0, \"rooms\": 5.0}, \"title\": \"\\\\u201cSimply perfect\\\\u201d\", \"text\": \"When we pulled up at the curb in front of the hotel we were greeted immediately by the bellman. He whisked our luggage into the hotel, the car was taken care of and we were instantly relaxing, enjyoing NYC.\", \"author\": {\"username\": \"NycHappytraveler\", \"num_cities\": 5, \"num_helpful_votes\": 7, \"num_reviews\": 12, \"num_type_reviews\": 6, \"id\": \"6C28078DE49DEF73AA0CB5313C5C69EA\", \"location\": \"nyc\"}, \"date_stayed\": \"November 2012\", \"offering_id\": 93559, \"num_helpful_votes\": 1, \"date\": \"November 13, 2012\", \"id\": 145321090, \"via_mobile\": false}, {\"ratings\": {\"service\": 5.0, \"cleanliness\": 5.0, \"overall\": 5.0, \"value\": 5.0, \"location\": 5.0, \"sleep_quality\": 5.0, \"rooms\": 5.0}, \"title\": \"\\\\u201cExcellent location\\\\u201d\", \"text\": \"Loved the hotel. Great location - only 2 blocks from 72nd St subway. We had a 1 bedroom suite on the 24th floor and had a wonderful view of the Hudson River and the upper West Side. Lovely subtle green decor and room large for NYC standards. It was great having the living area with the lounge that converted into a double bed for our 2 children (12 and 14). Kitchenette was handy to eat breakfast in. We did cook a few evening meals but were limited with cutlery! The Fairway market across the road from the hotel was fabulous. It had an amazing variety of produce as well as ready cooked meals. Having the laundry on the 7th floor was extremely handy. US$1.75 per load and you could get change from the front reception. The staff and front doormen were all very friendly and helpful. Next to the lift is an info desk where you could get a map of NYC. We used this map for the subway, streets and main attractions as these were all on it. Good bottle shop next door to hotel as well.\", \"author\": {\"username\": \"Erica1103\", \"num_cities\": 2, \"num_helpful_votes\": 1, \"num_reviews\": 7, \"location\": \"Christmas Island, Australia\", \"id\": \"035080D10D186778123E6A58C11E0608\"}, \"date_stayed\": \"December 2012\", \"offering_id\": 93338, \"num_helpful_votes\": 0, \"date\": \"December 17, 2012\", \"id\": 147634248, \"via_mobile\": false}, {\"ratings\": {\"service\": 5.0, \"cleanliness\": 5.0, \"overall\": 5.0, \"value\": 4.0, \"location\": 5.0, \"sleep_quality\": 5.0, \"rooms\": 5.0}, \"title\": \"\\\\u201cAll-round fantastic NYC hotel\\\\u201d\", \"text\": \"Our first stay on the upper west side and can\\'t say enough good things about the Hotel Beacon. We stayed here based on reviews of family friendly hotels. I\\'m not sure exactly how they are more family friendly than any other hotel except for the suites and kitchenettes for budget-conscious families. There weren\\'t any special programs for kids, but we did see other families there. For NYC, a nice sized Queen suite gave us everything we needed. Didn\\'t use the kitchen for our overnight stay but definitely would in the future. Rooms were comfortable (ok... a little tight at the foot of the bed but not like some complaints described), the amenities were really appreciated, e.g., free wifi, Keurig coffee service in room, desk area, energy efficient rooms (you put your room card in a device that controls the electricity to save energy while you\\'re out). Lovely bathrooms (although they need a hand towel holder), but really comfortable. We are a family of 3 so the kiddo slept on the pull-out sofa. Room was in good condition-- it appears that shade of green must be the theme, but its nice. The bellman held our luggage after checkout to allow us to stay in the city and not have to worry about our bags. Parking garage is right around the corner -- very close. Viand diner downstairs was OK for dinner -- not great but sufficient. Friendly front desk folks were really helpful -- have breakfast at Bagel Talk not too far away. Very convenient to American Museum of Natural History -- easy to catch a cab or subway. We will definitely stay here again and very happy to recommend.\", \"author\": {\"username\": \"rmfindc\", \"num_reviews\": 8, \"num_cities\": 2, \"id\": \"412A714D6BF1607A01CC828645DD70AE\", \"location\": \"Gaithersburg, Maryland\"}, \"date_stayed\": \"December 2012\", \"offering_id\": 93338, \"num_helpful_votes\": 0, \"date\": \"December 17, 2012\", \"id\": 147625002, \"via_mobile\": false}, {\"ratings\": {\"service\": 5.0, \"cleanliness\": 5.0, \"overall\": 5.0, \"value\": 4.0, \"location\": 5.0, \"sleep_quality\": 5.0, \"rooms\": 5.0}, \"title\": \"\\\\u201cGreat hotel in nice area\\\\u201d\", \"text\": \"Great room, very big with huge bed! Great location, just one block\\'s walk from 72nd subway then 5 minute ride to Times Square and anywhere you want to go from there!\\\\nWe had a room on the 24th floor so great views of San Remo building and Central Park but building sways ALOT in windy weather, very weird at first!\\\\nVery close to Central Park, check out Cafe Viand for sit down breakfast and Fairway and Levain Bakery for take away breakfast.\\\\nGreat all in all!\", \"author\": {\"username\": \"MiloandMaya\", \"num_cities\": 2, \"num_helpful_votes\": 3, \"num_reviews\": 12, \"location\": \"Durham\", \"id\": \"72B051F423790BE5F0EF6A9FD23EB77E\"}, \"date_stayed\": \"December 2012\", \"offering_id\": 93338, \"num_helpful_votes\": 0, \"date\": \"December 17, 2012\", \"id\": 147623184, \"via_mobile\": false}, {\"ratings\": {\"service\": 5.0, \"cleanliness\": 5.0, \"overall\": 5.0, \"value\": 5.0, \"location\": 5.0, \"sleep_quality\": 5.0, \"rooms\": 5.0}, \"title\": \"\\\\u201cGreat value\\\\u201d\", \"text\": \"We stayed at this property in October for a week. Had a king suite, which really was a suite, with sitting room/kitchenette, bedroom and bath. The room was at the rear of the building, which might have been a problem on lower floors (the air shaft was below us); however, we were on the 10th floor and had a decent view to the east, overlooking rooftops. Television in both rooms. The staff was very friendly and helpful. The market across the street was handy for breakfast items and snacks. Only a couple short blocks to the 72nd Street subway.station, where you can pick up the 1,2 and 3 trains. We had previously stayed at a hotel further north, but, nice as it was (with accompanying prices), it cannot compare with the Beacon for value. Definitely recommended.\", \"author\": {\"username\": \"WYbirdwatcher\", \"num_cities\": 40, \"num_helpful_votes\": 51, \"num_reviews\": 80, \"num_type_reviews\": 37, \"id\": \"4DD6C4346D4768ADE814D7A01E956BB7\", \"location\": \"Cheyenne\"}, \"date_stayed\": \"October 2012\", \"offering_id\": 93338, \"num_helpful_votes\": 0, \"date\": \"December 17, 2012\", \"id\": 147622021, \"via_mobile\": false}, {\"ratings\": {\"service\": 3.0, \"cleanliness\": 5.0, \"overall\": 4.0, \"value\": 4.0, \"location\": 5.0, \"sleep_quality\": 5.0, \"rooms\": 5.0}, \"title\": \"\\\\u201cExcellent! Will be back:-)\\\\u201d\", \"text\": \"This was our first stay at the Andaz. Lovely little hotel with great views of the library. VERY spacious with a HUGE bathroom! The complimentary drinks and snacks were a plus. Very quiet. My only complaint was there was no one to help us with bags or getting a cab. We had quite a bit of luggage and no one was around to open the door at the entrance (which consists of 2 black doors that are also not marked. We wandered around a bit before realizing this WAS the main entrance)!! We needed to get a cab to the train station and were told that none were available and that we should try and walk to Madison Ave to get one! No easy feat with lots of luggage and it was quite the walk. Clearly they should have the means to summon a cab. Hopefully this will be addressed before our next visit!\", \"author\": {\"username\": \"Reba G\", \"num_reviews\": 2, \"id\": \"B20F8339DA7EEBDE0D00D17B3889A49B\", \"location\": \"Philadelphia, Pennsylvania\", \"num_helpful_votes\": 2}, \"date_stayed\": \"December 2012\", \"offering_id\": 1762573, \"num_helpful_votes\": 0, \"date\": \"December 16, 2012\", \"id\": 147577025, \"via_mobile\": false}, {\"ratings\": {\"service\": 5.0, \"cleanliness\": 4.0, \"overall\": 4.0, \"value\": 4.0, \"location\": 5.0, \"sleep_quality\": 4.0, \"rooms\": 4.0}, \"title\": \"\\\\u201cGreat Midtown Hotel\\\\u201d\", \"text\": \"I was lucky enough to use my Hyatt two free nights to stay at this hotel in early December. Went with my adult daughter and we stayed in a corner room with two twin beds on the ninth floor. It\\'s tough to find good hotels with two beds in a room in NYC so this was a bonus. The room was very quiet. I could not hear anyone from other rooms, the hallway or any street noise. The room has a sleek modern design and was spacious for NYC standards. I loved the bathroom. Being able to get a cold bottle of water at all times was great and snacks in the rooms was a nice touch.\\\\nI also loved the overall vibe of the hotel; small, hip, clean, and friendly. Great artwork. Not warm and cozy though. The seating in the \\\\\"lobby\\\\\" is not particularly comfortable or inviting. The staff was young and not as experienced as one would find at a five-star hotel but this is not a five-star hotel. They did the best they could to help with restaurant reservations, shopping information and other general information. Easy walk from here to Grand Central Station to hop the subway and cabs easy to find. Loved being across from The New York Pubic Library and Bryant Park. Lovely pop-up stores and ice skating in Bryant Park for the holidays. Beats the craziness of Rockefeller Center in my book. \\\\nThere are a few problems that I believe can be corrected easily. One is the lack of proper lighting in the room, the architect and designers clearly were not thinking of women when they designed the rooms. It is very dark and would be really difficult if you were trying to get ready for a special event. Also there is no drawer space and the closet is minuscule. Not sure how to correct that issue. The other problem is that the beds, at least the twins we slept in, were not very comfortable. Very firm which is fine if you like it that way. All in all though, my memories are of a great stay.\", \"author\": {\"username\": \"beachlsr\", \"num_cities\": 5, \"num_helpful_votes\": 1, \"num_reviews\": 9, \"num_type_reviews\": 4, \"id\": \"851AD5B3B4127850A9292129C156D704\", \"location\": \"Hilton Head\"}, \"date_stayed\": \"December 2012\", \"offering_id\": 1762573, \"num_helpful_votes\": 0, \"date\": \"December 16, 2012\", \"id\": 147561287, \"via_mobile\": false}, {\"ratings\": {\"service\": 4.0, \"cleanliness\": 5.0, \"overall\": 4.0, \"value\": 5.0, \"location\": 5.0, \"sleep_quality\": 5.0, \"rooms\": 5.0}, \"title\": \"\\\\u201cStunningly Wonderful!\\\\u201d\", \"text\": \"Other hotels in NYC that are space challenged would do well to take note of what Hyatt has done with its two Andaz properties here. Not only is the 5th Avenue property in a great location, but the rooms are wonderfully designed and well appointed and the staff does a great job in terms of customer service. My wife and I arrived at 10am on a Saturday morning and the hotel had been sold out the night before. However, the young lady checked us in quickly and asked for a phone number to call us when our room was ready. We went out to have breakfast and before we were finished she call to let me know that the room was ready. We also loved the complimentary snacks and beverages in the mini frig, as well as in the lounge. The only drawback is that the Internet is painstakingly slow, which is the reaso for the 4 stars. Except for that, the hotel is a 5 all around. Would definitely recommend highly.\", \"author\": {\"username\": \"romadaro\", \"num_cities\": 70, \"num_helpful_votes\": 156, \"num_reviews\": 103, \"num_type_reviews\": 85, \"id\": \"C81AB7D49D98FA410EA191E15F427BEC\", \"location\": \"Washington, DC\"}, \"date_stayed\": \"December 2012\", \"offering_id\": 1762573, \"num_helpful_votes\": 5, \"date\": \"December 16, 2012\", \"id\": 147531970, \"via_mobile\": false}]', metadata={'source': 'output_proper_review_chunk_3.txt'})]" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "texts" ] }, { "cell_type": "code", "execution_count": 11, "id": "0d90183f", "metadata": {}, "outputs": [], "source": [ "llm = OpenAI(n=4, best_of=4)" ] }, { "cell_type": "code", "execution_count": 12, "id": "9ba734d1", "metadata": {}, "outputs": [], "source": [ "prompt_template = \"\"\"Please answer the user's question as providing an analysis of the hotel reviews across different aspects such as service, cleanliness, location, value, sleep quality, rooms, and overall experience. Extract information about specific amenities, notable features, and recurring themes across the reviews to offer a comprehensive understanding of the guests' experiences.\n", "Question: {question}\n", "Answer:\"\"\"\n", "\n", "prompt = PromptTemplate(input_variables=[\"question\"], template=prompt_template)\n", "\n", "llm_chain = LLMChain(llm=llm, prompt=prompt)" ] }, { "cell_type": "code", "execution_count": 13, "id": "9f2a9624", "metadata": {}, "outputs": [], "source": [ "embeddings = HypotheticalDocumentEmbedder(\n", " llm_chain=llm_chain,\n", " base_embeddings=bge_embeddings\n", ")" ] }, { "cell_type": "code", "execution_count": 14, "id": "967f2919", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[32;1m\u001b[1;3m[llm/start]\u001b[0m \u001b[1m[1:llm:OpenAI] Entering LLM run with input:\n", "\u001b[0m{\n", " \"prompts\": [\n", " \"Please answer the user's question as providing an analysis of the hotel reviews across different aspects such as service, cleanliness, location, value, sleep quality, rooms, and overall experience. Extract information about specific amenities, notable features, and recurring themes across the reviews to offer a comprehensive understanding of the guests' experiences.\\nQuestion: What are some distinguishing features or amenities that guests frequently highlight about their experience at Casablanca Hotel Times Square in New York City?\\nAnswer:\"\n", " ]\n", "}\n", "\u001b[36;1m\u001b[1;3m[llm/end]\u001b[0m \u001b[1m[1:llm:OpenAI] [3.01s] Exiting LLM run with output:\n", "\u001b[0m{\n", " \"generations\": [\n", " [\n", " {\n", " \"text\": \" Guests at Casablanca Hotel Times Square in New York City have consistently praised the hotel's convenient location, friendly staff, and clean rooms. Many travelers have highlighted the hotel's proximity to Times Square, Broadway theatres, and public transportation, as well as its vibrant atmosphere. The hotel also offers amenities such as free internet access, a fitness center, and a complimentary continental breakfast. Guests have also noted the spacious and comfortable rooms, as well as the helpful and friendly staff. Additionally, guests have frequently commented on the hotel's cleanliness and its value for money. Overall, guests have had positive experiences at Casablanca Hotel Times Square and have praised its great location, amenities, and staff.\",\n", " \"generation_info\": {\n", " \"finish_reason\": \"stop\",\n", " \"logprobs\": null\n", " },\n", " \"type\": \"Generation\"\n", " },\n", " {\n", " \"text\": \" Guests frequently highlight the excellent service, modern amenities, well-maintained rooms, and convenient location near Times Square as some of the distinguishing features and amenities they experienced while staying at Casablanca Hotel Times Square in New York City. Many guests also comment positively about the friendly staff, comfortable beds, and cleanliness of the hotel. Additionally, guests often note the value of the hotel for its proximity to attractions like Times Square, Broadway, and Central Park. Other amenities and features that guests often mention include the complimentary breakfast, the rooftop bar, the free Wi-Fi, and the fitness center.\",\n", " \"generation_info\": {\n", " \"finish_reason\": \"stop\",\n", " \"logprobs\": null\n", " },\n", " \"type\": \"Generation\"\n", " },\n", " {\n", " \"text\": \" According to reviews, guests at Casablanca Hotel Times Square in New York City frequently highlight the hotel's excellent service, clean and comfortable rooms, prime location, and great value. Guests also appreciate the hotel's modern amenities, including its fitness center, spa, and 24-hour front desk. Many guests also mention the helpful and friendly staff, the convenient access to Times Square and nearby attractions, as well as the hotel's contemporary decor and warm atmosphere.\",\n", " \"generation_info\": {\n", " \"finish_reason\": \"stop\",\n", " \"logprobs\": null\n", " },\n", " \"type\": \"Generation\"\n", " },\n", " {\n", " \"text\": \" Guests frequently highlight the convenient location of the Casablanca Hotel Times Square in New York City as a key advantage. Many guests also comment positively on the helpful and friendly service they receive from the staff, as well as the cleanliness of the rooms and public spaces. Many guests also note the great value for money that they receive from the hotel. Additionally, guests often comment on the comfortable beds and the spacious rooms, as well as the overall experience of staying at the hotel. Notable amenities include free Wi-Fi, a 24-hour fitness center, an on-site restaurant, and complimentary breakfast.\",\n", " \"generation_info\": {\n", " \"finish_reason\": \"stop\",\n", " \"logprobs\": null\n", " },\n", " \"type\": \"Generation\"\n", " }\n", " ]\n", " ],\n", " \"llm_output\": {\n", " \"token_usage\": {\n", " \"total_tokens\": 566,\n", " \"completion_tokens\": 471,\n", " \"prompt_tokens\": 95\n", " },\n", " \"model_name\": \"text-davinci-003\"\n", " },\n", " \"run\": null\n", "}\n" ] } ], "source": [ "docsearch = Chroma.from_documents(texts, embeddings)\n", "\n", "query = \"What are some distinguishing features or amenities that guests frequently highlight about their experience at Casablanca Hotel Times Square in New York City?\"\n", "docs = docsearch.similarity_search(query)" ] }, { "cell_type": "code", "execution_count": null, "id": "338b606f", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "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.11.5" } }, "nbformat": 4, "nbformat_minor": 5 }