help me preprocess this python string to be more understandable: test if vector DB was…
- User
help me preprocess this python string to be more understandable:
test if vector DB was loaded correctly
vectordb.similarity_search('Steins;Gate')
[Document(metadata={'Score': '9.07', 'Genres': 'Drama, Sci-Fi, Suspense', 'Synopsis': 'Eccentric scientist Rintarou Okabe has a never-ending thirst for scientific exploration. Together with his ditzy but well-meaning friend Mayuri Shiina and his roommate Itaru Hashida, Rintarou founds the Future Gadget Laboratory in the hopes of creating technological innovations that baffle the human psyche. Despite claims of grandeur, the only notable "gadget" the trio have created is a microwave that has the mystifying power to turn bananas into green goo.\n\nHowever, when Rintarou decides to attend neuroscientist Kurisu Makise's conference on time travel, he experiences a series of strange events that lead him to believe that there is more to the "Phone Microwave" gadget than meets the eye. Apparently able to send text messages into the past using the microwave, Rintarou dabbles further with the "time machine," attracting the ire and attention of the mysterious organization SERN.\n\nDue to the novel discovery, Rintarou and his friends find themselves in an ever-present danger. As he works to mitigate the damage his invention has caused to the timeline, he is not only fighting a battle to save his loved ones, but also one against his degrading sanity.', 'Type': 'TV', 'Episodes': '24.0', 'Aired': 'Apr 6, 2011 to Sep 14, 2011', 'Status': 'Finished Airing', 'Studios': 'White Fox', 'Source': 'Visual novel'}, page_content='Steins;Gate'), Document(metadata={'Score': '8.53', 'Genres': 'Drama, Sci-Fi, Suspense', 'Synopsis': "The eccentric, self-proclaimed mad scientist Rintarou Okabe has become a shell of his former self. Depressed and traumatized after failing to rescue his friend Makise Kurisu, he has decided to forsake his mad scientist alter ego and live as an ordinary college student. Surrounded by friends who know little of his time travel experiences, Okabe spends his days trying to forget the horrors of his adventures alone. \n\nWhile working as a receptionist at a college technology forum, Okabe meets the short, spunky Maho Hiyajo, who \nlater turns out to be the interpreter at the forum's presentation, conducted by Professor Alexis Leskinen. In front of a stunned crowd, Alexis and Maho unveil Amadeus—a revolutionary AI capable of storing a person's memories and creating a perfect simulation of that person complete with their personality and quirks. Meeting with Maho and Alexis after the presentation, Okabe learns that the two were Kurisu's colleagues in university, and that they have simulated her in Amadeus. Hired by Alexis to research the simulation's behavior, Okabe is given the chance to interact with the shadow of a long-lost dear friend. Dangerously tangled in the past, Okabe must face the harsh reality and carefully maneuver around the disastrous consequences that come with disturbing the natural flow of time.", 'Type': 'TV', 'Episodes': '23.0', 'Aired': 'Apr 12, 2018 to Sep 27, 2018', 'Status': 'Finished Airing', 'Studios': 'White Fox', 'Source': 'Visual novel'}, page_content='Steins;Gate 0'), Document(metadata={'Score': '6.84', 'Genres': 'Action, Drama, Romance, Supernatural', 'Synopsis': 'Vampires walk among society, existing as part of its underbelly. They do not require blood to survive, but extreme emotions can immensely increase their bloodlust, turning them into uncontrollable monsters. Tsukasa Taira, a 22-year-old university student, learns of the existence of vampires when her longtime friend reveals himself to be one of them after a tense confrontation with Yuuki Anzai—a human and vampire hybrid.\n\nHer friend is arrested, and Tsukasa soon finds herself drawn to Anzai, who reluctantly reciprocates her feelings. However, this unconventional romance may prove too difficult to maintain, as Anzai struggles to contain the part of him that wishes to devour Tsukasa.', 'Type': 'TV', 'Episodes': '12.0', 'Aired': 'Apr 7, 2018 to Jun 23, 2018', 'Status': 'Finished Airing', 'Studios': 'Platinum Vision', 'Source': 'Manga'}, page_content='Devils Line'), Document(metadata={'Score': '5.13', 'Genres': 'Romance, Slice of Life', 'Synopsis': "Harada Kusuko is a high school girl with a secret crush on the class playboy, Mishima Takeshi. After breaking up with his most recent girlfriend, Mishima asks Kusuko to be his date for the class trip to Kyoto. She's over the moon, but in fact, Mishima is hung up on Shouko, his middle school teacher. Despite the age gap (and general inappropriateness of the relationship), Mishima still sees Shouko, whose marriage is disintegrating. His friend and loyal wingman, Kotaro, openly disapproves of this connection. As the emotional tensions mount, Mishima becomes involved in fights with other boys, and eventually, he's expelled from school. Feeling like he's been a complete jerk, Mishima breaks up with Kusuko and drops out of her life. Will true love find a way?\n\n(Source: Orphan Fansubs)", 'Type': 'OVA', 'Episodes': '1.0', 'Aired': 'Jun 25, 1993', 'Status': 'Finished Airing', 'Studios': 'Madhouse', 'Source': 'Manga'}, page_content='Pops')]
- Assistant
Certainly! Let's break down the information from the
similarity_searchoutput in a more comprehensible format. We have four different documents related to anime series with the specified details:Document 1: Steins;Gate
- Title: Steins;Gate
- Score: 9.07
- Genres: Drama, Sci-Fi, Suspense
- User
perfect output, now do that in the python script as a function to print this
- Assistant
- User
TypeError Traceback (most recent call last) Cell In[63], line 1 ----> 1 print_similarity_search_results(results)
Cell In[60], line 3, in print_similarity_search_results(documents) 1 def print_similarity_search_results(documents): 2 for i, doc in enumerate(documents, start=1): ----> 3 metadata = doc['metadata'] 4 page_content = doc['page_content'] 6 print(f"### Anime {i}: {page_content}")
TypeError: 'Document' object is not subscriptable
- Assistant