{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "{'bucketized_user_age': 45.0,\n", " 'movie_genres': array([7]),\n", " 'movie_id': b'357',\n", " 'movie_title': b\"One Flew Over the Cuckoo's Nest (1975)\",\n", " 'raw_user_age': 46.0,\n", " 'timestamp': 879024327,\n", " 'user_gender': True,\n", " 'user_id': b'138',\n", " 'user_occupation_label': 4,\n", " 'user_occupation_text': b'doctor',\n", " 'user_rating': 4.0,\n", " 'user_zip_code': b'53211'}\n" ] } ], "source": [ "import pprint\n", "\n", "import tensorflow_datasets as tfds\n", "\n", "ratings = tfds.load(\"movielens/100k-ratings\", split=\"train\")\n", "\n", "for x in ratings.take(1).as_numpy_iterator():\n", " pprint.pprint(x)" ] }, { "cell_type": "code", "execution_count": 2, "outputs": [], "source": [ "import numpy as np\n", "import tensorflow as tf\n", "\n", "movie_title_lookup = tf.keras.layers.experimental.preprocessing.StringLookup()" ], "metadata": { "collapsed": false, "pycharm": { "name": "#%%\n" } } }, { "cell_type": "code", "execution_count": 3, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Vocabulary: ['', '[UNK]', 'Star Wars (1977)']\n" ] } ], "source": [ "movie_title_lookup.adapt(ratings.map(lambda x: x[\"movie_title\"])) # 1666\n", "\n", "print(f\"Vocabulary: {movie_title_lookup.get_vocabulary()[:3]}\")" ], "metadata": { "collapsed": false, "pycharm": { "name": "#%%\n" } } }, { "cell_type": "code", "execution_count": 4, "outputs": [], "source": [ "movie_titles_vocabulary = tf.keras.layers.experimental.preprocessing.StringLookup(mask_token=None)\n", "movies = tfds.load('movielens/100k-movies', split=\"train\")\n", "movies = movies.map(lambda x: x[\"movie_title\"])\n", "movie_titles_vocabulary.adapt(movies)" ], "metadata": { "collapsed": false, "pycharm": { "name": "#%%\n" } } }, { "cell_type": "code", "execution_count": 5, "outputs": [ { "data": { "text/plain": "['',\n '[UNK]',\n 'Star Wars (1977)',\n 'Contact (1997)',\n 'Fargo (1996)',\n 'Return of the Jedi (1983)',\n 'Liar Liar (1997)',\n 'English Patient, The (1996)',\n 'Scream (1996)',\n 'Toy Story (1995)',\n 'Air Force One (1997)',\n 'Independence Day (ID4) (1996)',\n 'Raiders of the Lost Ark (1981)',\n 'Godfather, The (1972)',\n 'Pulp Fiction (1994)',\n 'Twelve Monkeys (1995)',\n 'Silence of the Lambs, The (1991)',\n 'Jerry Maguire (1996)',\n 'Chasing Amy (1997)',\n 'Rock, The (1996)',\n 'Empire Strikes Back, The (1980)',\n 'Star Trek: First Contact (1996)',\n 'Titanic (1997)',\n 'Back to the Future (1985)',\n 'Mission: Impossible (1996)',\n 'Fugitive, The (1993)',\n 'Indiana Jones and the Last Crusade (1989)',\n 'Willy Wonka and the Chocolate Factory (1971)',\n 'Princess Bride, The (1987)',\n 'Forrest Gump (1994)',\n 'Saint, The (1997)',\n 'Monty Python and the Holy Grail (1974)',\n 'Full Monty, The (1997)',\n 'Men in Black (1997)',\n 'Terminator, The (1984)',\n 'E.T. the Extra-Terrestrial (1982)',\n 'Dead Man Walking (1995)',\n \"Schindler's List (1993)\",\n 'Leaving Las Vegas (1995)',\n 'L.A. Confidential (1997)',\n 'Braveheart (1995)',\n 'Terminator 2: Judgment Day (1991)',\n 'Conspiracy Theory (1997)',\n 'Twister (1996)',\n \"Mr. Holland's Opus (1995)\",\n 'Birdcage, The (1996)',\n 'Alien (1979)',\n 'When Harry Met Sally... (1989)',\n 'Aliens (1986)',\n 'Shawshank Redemption, The (1994)',\n 'Jaws (1975)',\n 'Groundhog Day (1993)',\n 'Apollo 13 (1995)',\n 'Amadeus (1984)',\n 'Blade Runner (1982)',\n 'Truth About Cats & Dogs, The (1996)',\n 'Sense and Sensibility (1995)',\n 'Usual Suspects, The (1995)',\n 'Ransom (1996)',\n \"One Flew Over the Cuckoo's Nest (1975)\",\n 'Jurassic Park (1993)',\n 'Evita (1996)',\n '2001: A Space Odyssey (1968)',\n 'Raising Arizona (1987)',\n 'Dances with Wolves (1990)',\n 'Broken Arrow (1996)',\n 'Game, The (1997)',\n 'Four Weddings and a Funeral (1994)',\n 'Dead Poets Society (1989)',\n 'Blues Brothers, The (1980)',\n 'Trainspotting (1996)',\n 'Fish Called Wanda, A (1988)',\n 'Wizard of Oz, The (1939)',\n 'Star Trek: The Wrath of Khan (1982)',\n 'Phenomenon (1996)',\n 'Die Hard (1988)',\n 'Casablanca (1942)',\n 'Sting, The (1973)',\n \"Devil's Own, The (1997)\",\n \"Dante's Peak (1997)\",\n 'Psycho (1960)',\n 'Graduate, The (1967)',\n 'Seven (Se7en) (1995)',\n 'Time to Kill, A (1996)',\n \"It's a Wonderful Life (1946)\",\n 'Speed (1994)',\n 'In & Out (1997)',\n 'Stand by Me (1986)',\n 'Hunt for Red October, The (1990)',\n 'GoodFellas (1990)',\n 'Heat (1995)',\n 'Sound of Music, The (1965)',\n 'Courage Under Fire (1996)',\n 'Clockwork Orange, A (1971)',\n 'Apocalypse Now (1979)',\n 'Top Gun (1986)',\n 'Lion King, The (1994)',\n 'Volcano (1997)',\n 'To Kill a Mockingbird (1962)',\n 'Babe (1995)',\n 'Aladdin (1992)',\n 'Murder at 1600 (1997)',\n 'Mars Attacks! (1996)',\n 'Butch Cassidy and the Sundance Kid (1969)',\n 'People vs. Larry Flynt, The (1996)',\n 'Sleepless in Seattle (1993)',\n 'Field of Dreams (1989)',\n 'Starship Troopers (1997)',\n 'Rear Window (1954)',\n 'Godfather: Part II, The (1974)',\n 'Get Shorty (1995)',\n 'True Lies (1994)',\n 'Brazil (1985)',\n 'Shining, The (1980)',\n 'M*A*S*H (1970)',\n 'Eraser (1996)',\n 'Beauty and the Beast (1991)',\n 'Boot, Das (1981)',\n 'Batman (1989)',\n 'Young Frankenstein (1974)',\n 'Star Trek IV: The Voyage Home (1986)',\n 'Good Will Hunting (1997)',\n 'Citizen Kane (1941)',\n 'Fifth Element, The (1997)',\n 'Gandhi (1982)',\n 'Face/Off (1997)',\n 'Dr. Strangelove or: How I Learned to Stop Worrying and Love the Bomb (1963)',\n 'Tin Cup (1996)',\n 'Mrs. Doubtfire (1993)',\n 'This Is Spinal Tap (1984)',\n 'Sabrina (1995)',\n 'Boogie Nights (1997)',\n \"Devil's Advocate, The (1997)\",\n 'Lone Star (1996)',\n 'Long Kiss Goodnight, The (1996)',\n \"Ulee's Gold (1997)\",\n 'Mighty Aphrodite (1995)',\n 'Postino, Il (1994)',\n 'Unforgiven (1992)',\n 'Taxi Driver (1976)',\n 'Tomorrow Never Dies (1997)',\n 'Fly Away Home (1996)',\n 'Dave (1993)',\n 'Annie Hall (1977)',\n 'Vertigo (1958)',\n 'North by Northwest (1959)',\n 'Clear and Present Danger (1994)',\n 'Primal Fear (1996)',\n 'Mary Poppins (1964)',\n 'Emma (1996)',\n 'That Thing You Do! (1996)',\n 'Much Ado About Nothing (1993)',\n 'Quiz Show (1994)',\n 'G.I. Jane (1997)',\n 'Cop Land (1997)',\n 'Rumble in the Bronx (1995)',\n \"Monty Python's Life of Brian (1979)\",\n 'Fantasia (1940)',\n 'Lawrence of Arabia (1962)',\n 'Snow White and the Seven Dwarfs (1937)',\n \"My Best Friend's Wedding (1997)\",\n 'Star Trek III: The Search for Spock (1984)',\n 'Heathers (1989)',\n 'Gone with the Wind (1939)',\n 'Glory (1989)',\n 'Cape Fear (1991)',\n 'Big Night (1996)',\n 'Grease (1978)',\n 'Ghost (1990)',\n 'Full Metal Jacket (1987)',\n 'Clueless (1995)',\n 'Sleepers (1996)',\n 'Mother (1996)',\n 'In the Line of Fire (1993)',\n 'Piano, The (1993)',\n 'Everyone Says I Love You (1996)',\n 'Die Hard 2 (1990)',\n 'Bridge on the River Kwai, The (1957)',\n 'Pretty Woman (1990)',\n 'Cool Hand Luke (1967)',\n 'American President, The (1995)',\n 'Nutty Professor, The (1996)',\n 'While You Were Sleeping (1995)',\n 'Secrets & Lies (1996)',\n 'Kingpin (1996)',\n 'George of the Jungle (1997)',\n 'Birds, The (1963)',\n 'Star Trek VI: The Undiscovered Country (1991)',\n 'Grosse Pointe Blank (1997)',\n 'First Wives Club, The (1996)',\n 'Apt Pupil (1998)',\n 'Lost World: Jurassic Park, The (1997)',\n 'Dragonheart (1996)',\n 'Swingers (1996)',\n 'Right Stuff, The (1983)',\n 'Executive Decision (1996)',\n 'Beavis and Butt-head Do America (1996)',\n 'Seven Years in Tibet (1997)',\n 'Crimson Tide (1995)',\n 'Highlander (1986)',\n 'Fried Green Tomatoes (1991)',\n 'African Queen, The (1951)',\n 'Firm, The (1993)',\n 'Die Hard: With a Vengeance (1995)',\n 'Abyss, The (1989)',\n 'Sneakers (1992)',\n 'Remains of the Day, The (1993)',\n 'Professional, The (1994)',\n 'Happy Gilmore (1996)',\n 'Reservoir Dogs (1992)',\n 'Like Water For Chocolate (Como agua para chocolate) (1992)',\n 'Grumpier Old Men (1995)',\n 'Clerks (1994)',\n 'Donnie Brasco (1997)',\n 'Chinatown (1974)',\n 'River Wild, The (1994)',\n 'Rainmaker, The (1997)',\n \"Jackie Chan's First Strike (1996)\",\n 'Spawn (1997)',\n 'Nightmare Before Christmas, The (1993)',\n 'Kiss the Girls (1997)',\n 'Batman Returns (1992)',\n 'Searching for Bobby Fischer (1993)',\n 'Maltese Falcon, The (1941)',\n 'Wag the Dog (1997)',\n \"Singin' in the Rain (1952)\",\n 'Philadelphia (1993)',\n 'Interview with the Vampire (1994)',\n 'Home Alone (1990)',\n 'Good, The Bad and The Ugly, The (1966)',\n 'Con Air (1997)',\n 'Sling Blade (1996)',\n 'Peacemaker, The (1997)',\n 'Patton (1970)',\n 'Gattaca (1997)',\n 'Room with a View, A (1986)',\n 'Multiplicity (1996)',\n 'Crow, The (1994)',\n 'Ed Wood (1994)',\n 'Jungle2Jungle (1997)',\n 'Manchurian Candidate, The (1962)',\n 'GoldenEye (1995)',\n 'Mystery Science Theater 3000: The Movie (1996)',\n 'Austin Powers: International Man of Mystery (1997)',\n 'Shine (1996)',\n 'Mask, The (1994)',\n 'Cinderella (1950)',\n 'Bound (1996)',\n 'Some Like It Hot (1959)',\n 'Natural Born Killers (1994)',\n 'Maverick (1994)',\n 'Last of the Mohicans, The (1992)',\n 'Ghost and the Darkness, The (1996)',\n 'Father of the Bride Part II (1995)',\n 'Crash (1996)',\n 'Stargate (1994)',\n 'Platoon (1986)',\n 'Nikita (La Femme Nikita) (1990)',\n 'Hunchback of Notre Dame, The (1996)',\n 'Event Horizon (1997)',\n 'Absolute Power (1997)',\n 'James and the Giant Peach (1996)',\n 'Jackie Brown (1997)',\n 'My Fair Lady (1964)',\n 'Lost Highway (1997)',\n 'Cold Comfort Farm (1995)',\n '12 Angry Men (1957)',\n 'Under Siege (1992)',\n 'Henry V (1989)',\n 'Great Escape, The (1963)',\n 'Ben-Hur (1959)',\n 'Amistad (1997)',\n 'Alien: Resurrection (1997)',\n 'Dumbo (1941)',\n 'Bonnie and Clyde (1967)',\n 'My Left Foot (1989)',\n 'Magnificent Seven, The (1954)',\n 'Killing Fields, The (1984)',\n 'Harold and Maude (1971)',\n 'Cinema Paradiso (1988)',\n 'Carrie (1976)',\n 'Net, The (1995)',\n 'Deer Hunter, The (1978)',\n \"Bram Stoker's Dracula (1992)\",\n 'Real Genius (1985)',\n 'Michael (1996)',\n 'Crying Game, The (1992)',\n 'Wrong Trousers, The (1993)',\n 'Star Trek: The Motion Picture (1979)',\n 'Kolya (1996)',\n 'Hoop Dreams (1994)',\n 'Star Trek: Generations (1994)',\n 'Raging Bull (1980)',\n 'Being There (1979)',\n 'Army of Darkness (1993)',\n \"What's Eating Gilbert Grape (1993)\",\n 'Frighteners, The (1996)',\n 'Beautiful Girls (1996)',\n 'Arsenic and Old Lace (1944)',\n 'Rosewood (1997)',\n 'Pink Floyd - The Wall (1982)',\n 'Batman Forever (1995)',\n 'Edge, The (1997)',\n 'Welcome to the Dollhouse (1995)',\n 'One Fine Day (1996)',\n 'Close Shave, A (1995)',\n 'As Good As It Gets (1997)',\n 'Nightmare on Elm Street, A (1984)',\n 'Adventures of Priscilla, Queen of the Desert, The (1994)',\n 'Hudsucker Proxy, The (1994)',\n '101 Dalmatians (1996)',\n 'Tombstone (1993)',\n 'Ice Storm, The (1997)',\n 'Conan the Barbarian (1981)',\n \"William Shakespeare's Romeo and Juliet (1996)\",\n 'Scream 2 (1997)',\n 'On Golden Pond (1981)',\n 'Cable Guy, The (1996)',\n 'Mr. Smith Goes to Washington (1939)',\n 'True Romance (1993)',\n 'Strictly Ballroom (1992)',\n 'Philadelphia Story, The (1940)',\n 'Outbreak (1995)',\n 'Craft, The (1996)',\n 'Ace Ventura: Pet Detective (1994)',\n 'Waterworld (1995)',\n 'Little Women (1994)',\n 'In the Name of the Father (1993)',\n 'Benny & Joon (1993)',\n 'Young Guns (1988)',\n 'Sex, Lies, and Videotape (1989)',\n 'Pinocchio (1940)',\n 'Miracle on 34th Street (1994)',\n 'Mimic (1997)',\n 'Down Periscope (1996)',\n 'Basic Instinct (1992)',\n 'Private Parts (1997)',\n \"Muriel's Wedding (1994)\",\n 'I Know What You Did Last Summer (1997)',\n 'Alien 3 (1992)',\n 'American Werewolf in London, An (1981)',\n 'Streetcar Named Desire, A (1951)',\n \"Romy and Michele's High School Reunion (1997)\",\n 'Dirty Dancing (1987)',\n 'Spitfire Grill, The (1996)',\n 'Desperado (1995)',\n 'Day the Earth Stood Still, The (1951)',\n 'Client, The (1994)',\n 'Mrs. Brown (Her Majesty, Mrs. Brown) (1997)',\n 'Jumanji (1995)',\n 'Fierce Creatures (1997)',\n 'City of Lost Children, The (1995)',\n 'So I Married an Axe Murderer (1993)',\n 'Matilda (1996)',\n \"Breakfast at Tiffany's (1961)\",\n 'Very Brady Sequel, A (1996)',\n 'Space Jam (1996)',\n 'My Life as a Dog (Mitt liv som hund) (1985)',\n 'Duck Soup (1933)',\n 'Cliffhanger (1993)',\n '2 Days in the Valley (1996)',\n 'Unbearable Lightness of Being, The (1988)',\n 'Rob Roy (1995)',\n 'Return of the Pink Panther, The (1974)',\n 'Money Talks (1997)',\n 'Michael Collins (1996)',\n 'From Dusk Till Dawn (1996)',\n 'Demolition Man (1993)',\n 'Manhattan (1979)',\n 'Madness of King George, The (1994)',\n 'Escape from New York (1981)',\n 'Escape from L.A. (1996)',\n 'Casino (1995)',\n 'Bean (1997)',\n 'Rosencrantz and Guildenstern Are Dead (1990)',\n 'Rebel Without a Cause (1955)',\n 'Nixon (1995)',\n 'Hamlet (1996)',\n 'Four Rooms (1995)',\n 'Three Musketeers, The (1993)',\n 'Richard III (1995)',\n \"Miller's Crossing (1990)\",\n 'Grifters, The (1990)',\n 'Evil Dead II (1987)',\n 'High Noon (1952)',\n 'To Die For (1995)',\n 'Strange Days (1995)',\n 'Jackal, The (1997)',\n 'Addams Family Values (1993)',\n 'My Fellow Americans (1996)',\n 'First Knight (1995)',\n 'Copycat (1995)',\n 'Cape Fear (1962)',\n 'Bullets Over Broadway (1994)',\n 'Beautician and the Beast, The (1997)',\n 'White Squall (1996)',\n 'Up Close and Personal (1996)',\n 'Omen, The (1976)',\n 'Jungle Book, The (1994)',\n 'Bob Roberts (1992)',\n 'Muppet Treasure Island (1996)',\n 'French Kiss (1995)',\n 'Three Colors: Red (1994)',\n 'Arrival, The (1996)',\n 'Sword in the Stone, The (1963)',\n 'Somewhere in Time (1980)',\n 'Sleeper (1973)',\n 'Santa Clause, The (1994)',\n 'Mulholland Falls (1996)',\n 'Juror, The (1996)',\n 'Cook the Thief His Wife & Her Lover, The (1989)',\n 'Picture Perfect (1997)',\n 'Nell (1994)',\n 'Legends of the Fall (1994)',\n 'It Happened One Night (1934)',\n 'I.Q. (1994)',\n 'Crumb (1994)',\n 'Alice in Wonderland (1951)',\n 'Treasure of the Sierra Madre, The (1948)',\n 'Phantom, The (1996)',\n 'Midnight in the Garden of Good and Evil (1997)',\n 'Man Who Would Be King, The (1975)',\n 'Eat Drink Man Woman (1994)',\n 'Chain Reaction (1996)',\n 'Secret Garden, The (1993)',\n 'Pump Up the Volume (1990)',\n 'Dolores Claiborne (1994)',\n 'City Hall (1996)',\n 'Better Off Dead... (1985)',\n 'Shadowlands (1993)',\n \"Marvin's Room (1996)\",\n 'Victor/Victoria (1982)',\n 'Reality Bites (1994)',\n 'Crucible, The (1996)',\n 'Breakdown (1997)',\n 'Don Juan DeMarco (1995)',\n 'Circle of Friends (1995)',\n 'Brady Bunch Movie, The (1995)',\n 'Winnie the Pooh and the Blustery Day (1968)',\n 'Wings of the Dove, The (1997)',\n 'Vegas Vacation (1997)',\n 'Robin Hood: Prince of Thieves (1991)',\n 'Smoke (1995)',\n 'Six Degrees of Separation (1993)',\n 'Sgt. Bilko (1996)',\n 'Breaking the Waves (1996)',\n \"She's the One (1996)\",\n 'Parent Trap, The (1961)',\n 'Hoodlum (1997)',\n 'Heavy Metal (1981)',\n 'Brothers McMullen, The (1995)',\n 'Big Sleep, The (1946)',\n 'Wedding Singer, The (1998)',\n 'Third Man, The (1949)',\n 'Seventh Seal, The (Sjunde inseglet, Det) (1957)',\n 'Othello (1995)',\n 'Desperate Measures (1998)',\n 'Angels and Insects (1995)',\n '20,000 Leagues Under the Sea (1954)',\n \"Things to Do in Denver when You're Dead (1995)\",\n 'Secret of Roan Inish, The (1994)',\n 'Restoration (1995)',\n 'How to Make an American Quilt (1995)',\n 'Diabolique (1996)',\n 'Ran (1985)',\n 'Jack (1996)',\n 'Heavenly Creatures (1994)',\n 'Enchanted April (1991)',\n 'Naked Gun 33 1/3: The Final Insult (1994)',\n \"McHale's Navy (1997)\",\n 'Kull the Conqueror (1997)',\n 'Glengarry Glen Ross (1992)',\n 'Dumb & Dumber (1994)',\n 'Christmas Carol, A (1938)',\n 'Body Snatchers (1993)',\n \"Antonia's Line (1995)\",\n 'Roman Holiday (1953)',\n \"Preacher's Wife, The (1996)\",\n 'Man Without a Face, The (1993)',\n 'Hot Shots! Part Deux (1993)',\n 'Dial M for Murder (1954)',\n 'Cool Runnings (1993)',\n 'Bringing Up Baby (1938)',\n 'Wolf (1994)',\n 'Wallace & Gromit: The Best of Aardman Animation (1996)',\n 'Striptease (1996)',\n 'Short Cuts (1993)',\n 'Quiet Man, The (1952)',\n 'Private Benjamin (1980)',\n 'Forbidden Planet (1956)',\n 'Bridges of Madison County, The (1995)',\n 'Adventures of Robin Hood, The (1938)',\n 'Tommy Boy (1995)',\n 'Shallow Grave (1994)',\n 'Rebecca (1940)',\n 'Mirror Has Two Faces, The (1996)',\n 'Jaws 2 (1978)',\n 'In the Company of Men (1997)',\n 'Hercules (1997)',\n 'Grand Day Out, A (1992)',\n 'Diva (1981)',\n 'Cyrano de Bergerac (1990)',\n 'Anastasia (1997)',\n 'All About Eve (1950)',\n 'Supercop (1992)',\n 'Sunset Blvd. (1950)',\n 'Lawnmower Man, The (1992)',\n 'Kids in the Hall: Brain Candy (1996)',\n 'Delicatessen (1991)',\n 'Deconstructing Harry (1997)',\n 'Candyman (1992)',\n 'Age of Innocence, The (1993)',\n 'U Turn (1997)',\n 'Three Colors: Blue (1993)',\n 'Stealing Beauty (1996)',\n 'Sabrina (1954)',\n 'Rudy (1993)',\n 'Old Yeller (1957)',\n 'Night of the Living Dead (1968)',\n 'Jean de Florette (1986)',\n 'Fan, The (1996)',\n 'Extreme Measures (1996)',\n \"Eve's Bayou (1997)\",\n 'Dazed and Confused (1993)',\n 'Walk in the Clouds, A (1995)',\n 'Star Trek V: The Final Frontier (1989)',\n 'Local Hero (1983)',\n 'Jane Eyre (1996)',\n 'Immortal Beloved (1994)',\n 'Apartment, The (1960)',\n 'My Favorite Year (1982)',\n 'Forget Paris (1995)',\n 'Cat on a Hot Tin Roof (1958)',\n 'Batman & Robin (1997)',\n 'Homeward Bound: The Incredible Journey (1993)',\n 'Fox and the Hound, The (1981)',\n \"Weekend at Bernie's (1989)\",\n 'Thin Man, The (1934)',\n 'Murder in the First (1995)',\n 'Father of the Bride (1950)',\n 'Bed of Roses (1996)',\n 'Three Colors: White (1994)',\n 'Soul Food (1997)',\n 'Some Kind of Wonderful (1987)',\n 'Sirens (1994)',\n \"Mary Shelley's Frankenstein (1994)\",\n 'Last Action Hero (1993)',\n 'Kalifornia (1993)',\n 'East of Eden (1955)',\n 'Around the World in 80 Days (1956)',\n '39 Steps, The (1935)',\n \"Sophie's Choice (1982)\",\n 'Ref, The (1994)',\n 'Raise the Red Lantern (1991)',\n 'Postman, The (1997)',\n 'Nine Months (1995)',\n 'Manon of the Spring (Manon des sources) (1986)',\n 'Last Supper, The (1995)',\n 'Home for the Holidays (1995)',\n 'Wings of Desire (1987)',\n 'To Wong Foo, Thanks for Everything! Julie Newmar (1995)',\n 'Red Corner (1997)',\n 'Island of Dr. Moreau, The (1996)',\n 'Devil in a Blue Dress (1995)',\n 'Daylight (1996)',\n 'Bedknobs and Broomsticks (1971)',\n 'Bananas (1971)',\n 'Bad Boys (1995)',\n 'Robin Hood: Men in Tights (1993)',\n 'His Girl Friday (1940)',\n 'Celluloid Closet, The (1995)',\n 'Tales from the Crypt Presents: Bordello of Blood (1996)',\n 'Looking for Richard (1996)',\n 'Black Sheep (1996)',\n 'Apostle, The (1997)',\n 'Serial Mom (1994)',\n 'Nosferatu (Nosferatu, eine Symphonie des Grauens) (1922)',\n 'Mallrats (1995)',\n \"Carlito's Way (1993)\",\n 'Aristocats, The (1970)',\n 'Addicted to Love (1997)',\n \"She's So Lovely (1997)\",\n 'Life Less Ordinary, A (1997)',\n 'Last Man Standing (1996)',\n 'Koyaanisqatsi (1983)',\n 'Flubber (1997)',\n 'Days of Thunder (1990)',\n 'Barcelona (1994)',\n 'Amityville Horror, The (1979)',\n 'Red Rock West (1992)',\n 'Notorious (1946)',\n 'Man Who Knew Too Little, The (1997)',\n 'Excess Baggage (1997)',\n 'Casper (1995)',\n 'Tin Men (1987)',\n 'Pocahontas (1995)',\n 'MatchMaker, The (1997)',\n 'Giant (1956)',\n 'Wyatt Earp (1994)',\n 'Trees Lounge (1996)',\n 'To Catch a Thief (1955)',\n 'Perfect World, A (1993)',\n 'Once Upon a Time in America (1984)',\n 'Menace II Society (1993)',\n 'Love Bug, The (1969)',\n 'American in Paris, An (1951)',\n 'Akira (1988)',\n 'Thinner (1996)',\n 'Substitute, The (1996)',\n 'Rocket Man (1997)',\n 'Mortal Kombat (1995)',\n 'Kids (1995)',\n 'Great White Hype, The (1996)',\n 'Bulletproof (1996)',\n 'Before Sunrise (1995)',\n 'Under Siege 2: Dark Territory (1995)',\n \"Smilla's Sense of Snow (1997)\",\n 'Quick and the Dead, The (1995)',\n 'Powder (1995)',\n 'Glimmer Man, The (1996)',\n 'Cat People (1982)',\n 'Bronx Tale, A (1993)',\n 'Booty Call (1997)',\n 'Beverly Hills Ninja (1997)',\n 'Waiting for Guffman (1996)',\n 'Up in Smoke (1978)',\n 'Swimming with Sharks (1995)',\n 'Sudden Death (1995)',\n 'Mad City (1997)',\n 'Dangerous Minds (1995)',\n 'With Honors (1994)',\n 'Shall We Dance? (1996)',\n 'Screamers (1995)',\n 'Paris, Texas (1984)',\n \"Nobody's Fool (1994)\",\n 'Malice (1993)',\n 'It Could Happen to You (1994)',\n 'Great Dictator, The (1940)',\n 'Farewell My Concubine (1993)',\n 'Doors, The (1991)',\n 'Bride of Frankenstein (1935)',\n 'Blob, The (1958)',\n \"What's Love Got to Do with It (1993)\",\n 'Species (1995)',\n 'Shadow, The (1994)',\n 'Junior (1994)',\n \"Joe's Apartment (1996)\",\n 'Family Thing, A (1996)',\n 'Citizen Ruth (1996)',\n 'Blue in the Face (1995)',\n 'Young Guns II (1990)',\n 'When We Were Kings (1996)',\n 'To Gillian on Her 37th Birthday (1996)',\n 'Sweet Hereafter, The (1997)',\n 'Shadow Conspiracy (1997)',\n 'Ridicule (1996)',\n 'Return of Martin Guerre, The (Retour de Martin Guerre, Le) (1982)',\n 'Persuasion (1995)',\n 'Nick of Time (1995)',\n 'Mouse Hunt (1997)',\n 'M (1931)',\n 'Leave It to Beaver (1997)',\n 'Fire Down Below (1997)',\n 'Fear (1996)',\n \"City Slickers II: The Legend of Curly's Gold (1994)\",\n 'Bottle Rocket (1996)',\n 'Basquiat (1996)',\n 'Wild Bunch, The (1969)',\n 'Tales From the Crypt Presents: Demon Knight (1995)',\n 'Spy Hard (1996)',\n 'Rising Sun (1993)',\n 'Renaissance Man (1994)',\n 'Playing God (1997)',\n \"Pete's Dragon (1977)\",\n 'Mortal Kombat: Annihilation (1997)',\n 'Money Train (1995)',\n 'Ghost and Mrs. Muir, The (1947)',\n 'Chamber, The (1996)',\n 'Air Bud (1997)',\n 'Moll Flanders (1996)',\n 'Love Jones (1997)',\n 'Kundun (1997)',\n 'Freeway (1996)',\n 'Flirting With Disaster (1996)',\n 'Congo (1995)',\n 'Big Lebowski, The (1998)',\n \"Young Poisoner's Handbook, The (1995)\",\n 'That Darn Cat! (1997)',\n 'Tank Girl (1995)',\n 'Sphere (1998)',\n 'Some Folks Call It a Sling Blade (1993)',\n 'Little Princess, A (1995)',\n 'Johnny Mnemonic (1995)',\n 'Gigi (1958)',\n 'Fallen (1998)',\n 'Coneheads (1993)',\n 'Associate, The (1996)',\n '187 (1997)',\n 'Tin Drum, The (Blechtrommel, Die) (1979)',\n 'Priest (1994)',\n 'Paper, The (1994)',\n 'Laura (1944)',\n 'Killing Zoe (1994)',\n 'Harriet the Spy (1996)',\n 'Hard Target (1993)',\n 'First Kid (1996)',\n 'Eddie (1996)',\n 'Disclosure (1994)',\n 'Charade (1963)',\n 'Basketball Diaries, The (1995)',\n 'When a Man Loves a Woman (1994)',\n 'Swiss Family Robinson (1960)',\n 'Son in Law (1993)',\n 'Replacement Killers, The (1998)',\n 'Only You (1994)',\n 'Mary Reilly (1996)',\n 'Judge Dredd (1995)',\n 'Indian in the Cupboard, The (1995)',\n 'French Twist (Gazon maudit) (1995)',\n 'Crow: City of Angels, The (1996)',\n 'Corrina, Corrina (1994)',\n 'Career Girls (1997)',\n 'Candidate, The (1972)',\n 'Assassins (1995)',\n 'Angels in the Outfield (1994)',\n 'Adventures of Pinocchio, The (1996)',\n 'Virtuosity (1995)',\n 'Speed 2: Cruise Control (1997)',\n 'Once Upon a Time in the West (1969)',\n 'Howling, The (1981)',\n 'Get on the Bus (1996)',\n 'Anaconda (1997)',\n '8 1/2 (1963)',\n 'Thousand Acres, A (1997)',\n 'Sliver (1993)',\n 'Romeo Is Bleeding (1993)',\n 'Milk Money (1994)',\n 'I Shot Andy Warhol (1996)',\n 'Billy Madison (1995)',\n 'Belle de jour (1967)',\n 'Ace Ventura: When Nature Calls (1995)',\n 'Speechless (1994)',\n 'Night on Earth (1991)',\n 'Metro (1997)',\n \"Wes Craven's New Nightmare (1994)\",\n 'Trigger Effect, The (1996)',\n 'Thin Blue Line, The (1988)',\n 'Gaslight (1944)',\n 'Down by Law (1986)',\n \"Don't Be a Menace to South Central While Drinking Your Juice in the Hood (1996)\",\n 'Washington Square (1997)',\n 'Unforgettable (1996)',\n 'Touch of Evil (1958)',\n 'Terminal Velocity (1994)',\n 'Orlando (1993)',\n 'Mediterraneo (1991)',\n 'Lost Horizon (1937)',\n 'Jeffrey (1995)',\n 'Fled (1996)',\n 'Dead Man (1995)',\n 'Boys on the Side (1995)',\n 'Paths of Glory (1957)',\n 'Hackers (1995)',\n 'Free Willy (1993)',\n 'Clockers (1995)',\n 'Anna Karenina (1997)',\n 'Transformers: The Movie, The (1986)',\n 'Tie Me Up! Tie Me Down! (1990)',\n 'Prophecy, The (1995)',\n 'Old Man and the Sea, The (1958)',\n 'Night Falls on Manhattan (1997)',\n 'Homeward Bound II: Lost in San Francisco (1996)',\n 'Feeling Minnesota (1996)',\n 'Fast, Cheap & Out of Control (1997)',\n 'Eye for an Eye (1996)',\n 'Englishman Who Went Up a Hill, But Came Down a Mountain, The (1995)',\n \"Cats Don't Dance (1997)\",\n 'Brassed Off (1996)',\n 'Boomerang (1992)',\n 'Airheads (1994)',\n 'Timecop (1994)',\n 'Threesome (1994)',\n 'Program, The (1993)',\n 'Operation Dumbo Drop (1995)',\n 'Once Were Warriors (1994)',\n 'Meet Me in St. Louis (1944)',\n 'Kiss Me, Guido (1997)',\n 'Hard Rain (1998)',\n 'Great Race, The (1965)',\n 'Flintstones, The (1994)',\n \"Fathers' Day (1997)\",\n 'Drop Zone (1994)',\n 'Die xue shuang xiong (Killer, The) (1989)',\n 'Bio-Dome (1996)',\n 'Spellbound (1945)',\n 'Shaggy Dog, The (1959)',\n 'My Own Private Idaho (1991)',\n 'Higher Learning (1995)',\n 'Georgia (1995)',\n 'FairyTale: A True Story (1997)',\n 'Escape to Witch Mountain (1975)',\n 'Barb Wire (1996)',\n 'Twelfth Night (1996)',\n \"Stephen King's The Langoliers (1995)\",\n 'If Lucy Fell (1996)',\n 'High School High (1996)',\n 'Ghosts of Mississippi (1996)',\n 'Evening Star, The (1996)',\n 'Deceiver (1997)',\n 'Canadian Bacon (1994)',\n 'Blown Away (1994)',\n 'Beautiful Thing (1996)',\n 'Passion Fish (1992)',\n 'Once Upon a Time... When We Were Colored (1995)',\n 'Just Cause (1995)',\n 'In Love and War (1996)',\n 'Death and the Maiden (1994)',\n 'Crossing Guard, The (1995)',\n 'Chungking Express (1994)',\n 'Blues Brothers 2000 (1998)',\n 'Beverly Hills Cop III (1994)',\n 'Barbarella (1968)',\n 'Another Stakeout (1993)',\n 'Wishmaster (1997)',\n 'Vanya on 42nd Street (1994)',\n 'Tales from the Hood (1995)',\n 'Spanking the Monkey (1994)',\n 'Quest, The (1996)',\n 'Pollyanna (1960)',\n 'Paris Is Burning (1990)',\n 'My Man Godfrey (1936)',\n 'Manhattan Murder Mystery (1993)',\n 'Made in America (1993)',\n 'Living in Oblivion (1995)',\n \"Heaven's Prisoners (1996)\",\n 'Great Expectations (1998)',\n 'Free Willy 3: The Rescue (1997)',\n 'Exotica (1994)',\n 'Black Beauty (1994)',\n 'Walkabout (1971)',\n 'Super Mario Bros. (1993)',\n 'Spice World (1997)',\n 'Something to Talk About (1995)',\n 'Shanghai Triad (Yao a yao yao dao waipo qiao) (1995)',\n 'Pillow Book, The (1995)',\n 'Ninotchka (1939)',\n 'Love! Valour! Compassion! (1997)',\n 'In the Mouth of Madness (1995)',\n 'Ghost in the Shell (Kokaku kidotai) (1995)',\n 'Friday (1995)',\n 'Before and After (1996)',\n 'Aladdin and the King of Thieves (1996)',\n 'Affair to Remember, An (1957)',\n 'Two if by Sea (1996)',\n 'Smile Like Yours, A (1997)',\n 'Relic, The (1997)',\n 'Portrait of a Lady, The (1996)',\n 'Naked (1993)',\n 'Meet John Doe (1941)',\n 'Keys to Tulsa (1997)',\n 'Judgment Night (1993)',\n 'House Arrest (1996)',\n 'Halloween: The Curse of Michael Myers (1995)',\n 'Girl 6 (1996)',\n 'Fearless (1993)',\n 'Dracula: Dead and Loving It (1995)',\n 'Apple Dumpling Gang, The (1975)',\n 'Queen Margot (Reine Margot, La) (1994)',\n 'Now and Then (1995)',\n \"Microcosmos: Le peuple de l'herbe (1996)\",\n 'Lord of Illusions (1995)',\n 'Houseguest (1994)',\n 'House of the Spirits, The (1993)',\n 'Grease 2 (1982)',\n 'Garden of Finzi-Contini, The (Giardino dei Finzi-Contini, Il) (1970)',\n 'Fools Rush In (1997)',\n 'Drop Dead Fred (1991)',\n 'Cry, the Beloved Country (1995)',\n 'Burnt By the Sun (1994)',\n 'Until the End of the World (Bis ans Ende der Welt) (1991)',\n 'Turbulence (1997)',\n 'Trial and Error (1997)',\n 'Showgirls (1995)',\n 'Ruby in Paradise (1993)',\n 'Mr. Wrong (1996)',\n 'Live Nude Girls (1995)',\n 'Kansas City (1996)',\n 'Jude (1996)',\n 'Inventing the Abbotts (1997)',\n 'Fog, The (1980)',\n 'Cemetery Man (Dellamorte Dellamore) (1994)',\n 'Welcome To Sarajevo (1997)',\n 'Village of the Damned (1995)',\n 'Unstrung Heroes (1995)',\n 'Three Caballeros, The (1945)',\n 'Pallbearer, The (1996)',\n 'Oliver & Company (1988)',\n 'Mrs. Winterbourne (1996)',\n 'Mrs. Parker and the Vicious Circle (1994)',\n 'Mother Night (1996)',\n 'Marked for Death (1990)',\n 'Little Buddha (1993)',\n \"Kid in King Arthur's Court, A (1995)\",\n 'Kama Sutra: A Tale of Love (1996)',\n 'Double vie de Véronique, La (Double Life of Veronique, The) (1991)',\n 'Bogus (1996)',\n 'Body Snatcher, The (1945)',\n 'Blood & Wine (1997)',\n 'Umbrellas of Cherbourg, The (Parapluies de Cherbourg, Les) (1964)',\n 'Top Hat (1935)',\n 'Richie Rich (1994)',\n 'Oscar & Lucinda (1997)',\n 'My Family (1995)',\n 'Misérables, Les (1995)',\n 'Lawnmower Man 2: Beyond Cyberspace (1996)',\n \"It's My Party (1995)\",\n 'How to Be a Player (1997)',\n 'Funny Face (1957)',\n 'Funeral, The (1996)',\n 'Candyman: Farewell to the Flesh (1995)',\n 'Anne Frank Remembered (1995)',\n 'Specialist, The (1994)',\n 'Prophecy II, The (1998)',\n 'Paradise Lost: The Child Murders at Robin Hood Hills (1996)',\n 'Maximum Risk (1996)',\n 'Ma vie en rose (My Life in Pink) (1997)',\n 'Kiss of Death (1995)',\n 'Indian Summer (1996)',\n 'Half Baked (1998)',\n 'Goofy Movie, A (1995)',\n 'For Whom the Bell Tolls (1943)',\n 'Flipper (1996)',\n 'Beverly Hillbillies, The (1993)',\n \"Widows' Peak (1994)\",\n 'Trust (1990)',\n 'That Darn Cat! (1965)',\n 'Surviving Picasso (1996)',\n 'Steel (1997)',\n 'Star Maps (1997)',\n 'Set It Off (1996)',\n 'Out to Sea (1997)',\n 'Major Payne (1994)',\n 'Home Alone 3 (1997)',\n \"Gridlock'd (1997)\",\n 'Fatal Instinct (1993)',\n 'D3: The Mighty Ducks (1996)',\n 'Cowboy Way, The (1994)',\n 'Children of the Corn: The Gathering (1996)',\n 'Blink (1994)',\n 'Backbeat (1993)',\n 'Amos & Andrew (1993)',\n 'To Be or Not to Be (1942)',\n 'Thirty-Two Short Films About Glenn Gould (1993)',\n \"Robert A. Heinlein's The Puppet Masters (1994)\",\n 'Ready to Wear (Pret-A-Porter) (1994)',\n 'Picnic (1955)',\n 'M. Butterfly (1993)',\n 'Lost in Space (1998)',\n 'Little Rascals, The (1994)',\n 'Jingle All the Way (1996)',\n 'Inspector General, The (1949)',\n 'In the Army Now (1994)',\n 'House of Yes, The (1997)',\n 'Hellraiser: Bloodline (1996)',\n 'Hate (Haine, La) (1995)',\n 'Getaway, The (1994)',\n 'Firestorm (1998)',\n 'Dead Presidents (1995)',\n 'Cutthroat Island (1995)',\n 'Blue Angel, The (Blaue Engel, Der) (1930)',\n 'Beyond Rangoon (1995)',\n 'Assignment, The (1997)',\n 'Andre (1994)',\n 'Amateur (1994)',\n 'Afterglow (1997)',\n 'Switchback (1997)',\n 'Stupids, The (1996)',\n 'Shall We Dance? (1937)',\n 'Road to Wellville, The (1994)',\n 'Mute Witness (1994)',\n 'Madonna: Truth or Dare (1991)',\n 'Jade (1995)',\n \"I'm Not Rappaport (1996)\",\n 'Farinelli: il castrato (1994)',\n 'Big Blue, The (Grand bleu, Le) (1988)',\n 'When the Cats Away (Chacun cherche son chat) (1996)',\n 'Waiting to Exhale (1995)',\n 'Stuart Saves His Family (1995)',\n 'Selena (1997)',\n 'Ruling Class, The (1972)',\n 'Party Girl (1995)',\n 'Little Big League (1994)',\n 'Jaws 3-D (1983)',\n 'In the Bleak Midwinter (1995)',\n 'Highlander III: The Sorcerer (1994)',\n 'Gang Related (1997)',\n 'Exit to Eden (1994)',\n 'Dark City (1998)',\n 'Cabin Boy (1994)',\n 'Believers, The (1987)',\n ...]" }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movie_title_lookup.get_vocabulary()" ], "metadata": { "collapsed": false, "pycharm": { "name": "#%%\n" } } }, { "cell_type": "code", "execution_count": 6, "outputs": [ { "data": { "text/plain": "['[UNK]',\n \"Ulee's Gold (1997)\",\n 'That Darn Cat! (1997)',\n 'Substance of Fire, The (1996)',\n 'Sliding Doors (1998)',\n 'Nightwatch (1997)',\n 'Money Talks (1997)',\n 'Kull the Conqueror (1997)',\n 'Ice Storm, The (1997)',\n 'Hurricane Streets (1998)',\n 'Hugo Pool (1997)',\n 'Fly Away Home (1996)',\n 'Desperate Measures (1998)',\n 'Designated Mourner, The (1997)',\n 'Deceiver (1997)',\n 'Chasing Amy (1997)',\n 'Chairman of the Board (1998)',\n 'Butcher Boy, The (1998)',\n 'Body Snatchers (1993)',\n 'Á köldum klaka (Cold Fever) (1994)',\n 'unknown',\n 'Zeus and Roxanne (1997)',\n \"Young Poisoner's Handbook, The (1995)\",\n 'Young Guns II (1990)',\n 'Young Guns (1988)',\n 'Young Frankenstein (1974)',\n 'You So Crazy (1994)',\n 'Year of the Horse (1997)',\n 'Yankee Zulu (1994)',\n 'Wyatt Earp (1994)',\n 'Wrong Trousers, The (1993)',\n 'World of Apu, The (Apur Sansar) (1959)',\n \"Wooden Man's Bride, The (Wu Kui) (1994)\",\n 'Wonderland (1997)',\n 'Wonderful, Horrible Life of Leni Riefenstahl, The (1993)',\n 'Women, The (1939)',\n 'Woman in Question, The (1950)',\n 'Wolf (1994)',\n 'Wizard of Oz, The (1939)',\n 'Witness (1985)',\n 'Withnail and I (1987)',\n 'With Honors (1994)',\n 'Wishmaster (1997)',\n 'Winter Guest, The (1997)',\n 'Winnie the Pooh and the Blustery Day (1968)',\n 'Wings of the Dove, The (1997)',\n 'Wings of Desire (1987)',\n 'Wings of Courage (1995)',\n 'Window to Paris (1994)',\n 'Willy Wonka and the Chocolate Factory (1971)',\n \"William Shakespeare's Romeo and Juliet (1996)\",\n 'Wild Things (1998)',\n 'Wild Reeds (1994)',\n 'Wild Bunch, The (1969)',\n 'Wild Bill (1995)',\n 'Wild America (1997)',\n 'Wife, The (1995)',\n \"Widows' Peak (1994)\",\n 'Whole Wide World, The (1996)',\n 'White Squall (1996)',\n \"White Man's Burden (1995)\",\n 'White Balloon, The (1995)',\n 'While You Were Sleeping (1995)',\n 'When the Cats Away (Chacun cherche son chat) (1996)',\n 'When a Man Loves a Woman (1994)',\n 'When We Were Kings (1996)',\n 'When Night Is Falling (1995)',\n 'When Harry Met Sally... (1989)',\n \"What's Love Got to Do with It (1993)\",\n \"What's Eating Gilbert Grape (1993)\",\n 'What Happened Was... (1994)',\n \"Wes Craven's New Nightmare (1994)\",\n \"Wend Kuuni (God's Gift) (1982)\",\n 'Welcome to the Dollhouse (1995)',\n 'Welcome To Sarajevo (1997)',\n \"Weekend at Bernie's (1989)\",\n 'Wedding Singer, The (1998)',\n 'Wedding Gift, The (1994)',\n 'Wedding Bell Blues (1996)',\n 'Waterworld (1995)',\n 'Washington Square (1997)',\n 'Warriors of Virtue (1997)',\n 'War, The (1994)',\n 'War at Home, The (1996)',\n 'War Room, The (1993)',\n 'Wallace & Gromit: The Best of Aardman Animation (1996)',\n 'Walking and Talking (1996)',\n 'Walking Dead, The (1995)',\n 'Walkabout (1971)',\n 'Walk in the Sun, A (1945)',\n 'Walk in the Clouds, A (1995)',\n 'Waiting to Exhale (1995)',\n 'Waiting for Guffman (1996)',\n 'Wag the Dog (1997)',\n 'Volcano (1997)',\n 'Visitors, The (Visiteurs, Les) (1993)',\n 'Virtuosity (1995)',\n 'Village of the Damned (1995)',\n 'Vie est belle, La (Life is Rosey) (1987)',\n 'Victor/Victoria (1982)',\n 'Very Natural Thing, A (1974)',\n 'Very Brady Sequel, A (1996)',\n 'Vertigo (1958)',\n 'Vermont Is For Lovers (1992)',\n 'Vermin (1998)',\n 'Venice/Venice (1992)',\n 'Vegas Vacation (1997)',\n 'Vanya on 42nd Street (1994)',\n 'Van, The (1996)',\n 'Vampire in Brooklyn (1995)',\n 'Usual Suspects, The (1995)',\n 'Up in Smoke (1978)',\n 'Up Close and Personal (1996)',\n 'Unzipped (1995)',\n 'Until the End of the World (Bis ans Ende der Welt) (1991)',\n 'Unstrung Heroes (1995)',\n 'Unhook the Stars (1996)',\n 'Unforgiven (1992)',\n 'Unforgettable (1996)',\n 'Underworld (1997)',\n 'Underneath, The (1995)',\n 'Underground (1995)',\n 'Under Siege 2: Dark Territory (1995)',\n 'Under Siege (1992)',\n 'Unbearable Lightness of Being, The (1988)',\n 'Umbrellas of Cherbourg, The (Parapluies de Cherbourg, Les) (1964)',\n 'U.S. Marshalls (1998)',\n 'U Turn (1997)',\n 'Two or Three Things I Know About Her (1966)',\n 'Two if by Sea (1996)',\n 'Two Much (1996)',\n 'Two Friends (1986) ',\n 'Two Deaths (1995)',\n 'Two Bits (1995)',\n 'Twister (1996)',\n 'Twisted (1996)',\n 'Twin Town (1997)',\n 'Twilight (1998)',\n 'Twelve Monkeys (1995)',\n 'Twelfth Night (1996)',\n 'Turning, The (1992)',\n 'Turbulence (1997)',\n 'Turbo: A Power Rangers Movie (1997)',\n 'Truth or Consequences, N.M. (1997)',\n 'Truth About Cats & Dogs, The (1996)',\n 'Trust (1990)',\n 'Truman Show, The (1998)',\n 'True Romance (1993)',\n 'True Lies (1994)',\n 'True Crime (1995)',\n 'Trigger Effect, The (1996)',\n 'Trial by Jury (1994)',\n 'Trial and Error (1997)',\n 'Trees Lounge (1996)',\n 'Treasure of the Sierra Madre, The (1948)',\n 'Traveller (1997)',\n 'Transformers: The Movie, The (1986)',\n 'Trainspotting (1996)',\n 'Toy Story (1995)',\n 'Touki Bouki (Journey of the Hyena) (1973)',\n 'Tough and Deadly (1995)',\n 'Touch of Evil (1958)',\n 'Touch (1997)',\n 'Total Eclipse (1995)',\n 'Top Hat (1935)',\n 'Top Gun (1986)',\n 'Tomorrow Never Dies (1997)',\n 'Tommy Boy (1995)',\n 'Tombstone (1993)',\n 'Tom and Huck (1995)',\n 'Tom & Viv (1994)',\n 'Tokyo Fist (1995)',\n 'To Wong Foo, Thanks for Everything! Julie Newmar (1995)',\n 'To Live (Huozhe) (1994)',\n 'To Kill a Mockingbird (1962)',\n 'To Have, or Not (1995)',\n 'To Gillian on Her 37th Birthday (1996)',\n 'To Die For (1995)',\n 'To Cross the Rubicon (1991)',\n 'To Catch a Thief (1955)',\n 'To Be or Not to Be (1942)',\n 'Titanic (1997)',\n 'Tin Men (1987)',\n 'Tin Drum, The (Blechtrommel, Die) (1979)',\n 'Tin Cup (1996)',\n 'Timecop (1994)',\n 'Time to Kill, A (1996)',\n 'Time Tracers (1995)',\n 'Tigrero: A Film That Was Never Made (1994)',\n 'Tie That Binds, The (1995)',\n 'Tie Me Up! Tie Me Down! (1990)',\n 'Threesome (1994)',\n 'Three Wishes (1995)',\n 'Three Musketeers, The (1993)',\n 'Three Lives and Only One Death (1996)',\n 'Three Colors: White (1994)',\n 'Three Colors: Red (1994)',\n 'Three Colors: Blue (1993)',\n 'Three Caballeros, The (1945)',\n 'Thousand Acres, A (1997)',\n 'This Is Spinal Tap (1984)',\n 'Thirty-Two Short Films About Glenn Gould (1993)',\n 'Third Man, The (1949)',\n 'Thinner (1996)',\n \"Things to Do in Denver when You're Dead (1995)\",\n 'Thin Man, The (1934)',\n 'Thin Line Between Love and Hate, A (1996)',\n 'Thin Blue Line, The (1988)',\n 'Thieves (Voleurs, Les) (1996)',\n 'They Made Me a Criminal (1939)',\n 'Theodore Rex (1995)',\n 'The Innocent (1994)',\n 'The Deadly Cure (1996)',\n 'The Courtyard (1995)',\n 'That Thing You Do! (1996)',\n 'That Old Feeling (1997)',\n 'That Darn Cat! (1965)',\n 'Tetsuo II: Body Hammer (1992)',\n 'Terror in a Texas Town (1958)',\n 'Terminator, The (1984)',\n 'Terminator 2: Judgment Day (1991)',\n 'Terminal Velocity (1994)',\n 'Temptress Moon (Feng Yue) (1996)',\n 'Telling Lies in America (1997)',\n 'Taxi Driver (1976)',\n 'Target (1995)',\n 'Tank Girl (1995)',\n 'Tango Lesson, The (1997)',\n 'Talking About Sex (1994)',\n 'Tales from the Hood (1995)',\n 'Tales from the Crypt Presents: Bordello of Blood (1996)',\n 'Tales From the Crypt Presents: Demon Knight (1995)',\n 'Tainted (1998)',\n 'T-Men (1947)',\n 'Symphonie pastorale, La (1946)',\n 'Sword in the Stone, The (1963)',\n 'Switchblade Sisters (1975)',\n 'Switchback (1997)',\n 'Swiss Family Robinson (1960)',\n 'Swingers (1996)',\n 'Swimming with Sharks (1995)',\n 'Swept from the Sea (1997)',\n 'Sweet Nothing (1995)',\n 'Sweet Hereafter, The (1997)',\n 'Swan Princess, The (1994)',\n 'Suture (1993)',\n 'Surviving the Game (1994)',\n 'Surviving Picasso (1996)',\n 'Supercop (1992)',\n 'Super Mario Bros. (1993)',\n 'Sunset Park (1996)',\n 'Sunset Blvd. (1950)',\n 'Sunchaser, The (1996)',\n 'Sum of Us, The (1994)',\n 'Sudden Manhattan (1996)',\n 'Sudden Death (1995)',\n 'Substitute, The (1996)',\n 'SubUrbia (1997)',\n 'Stupids, The (1996)',\n 'Stuart Saves His Family (1995)',\n 'Striptease (1996)',\n 'Stripes (1981)',\n 'Striking Distance (1993)',\n 'Strictly Ballroom (1992)',\n 'Streetcar Named Desire, A (1951)',\n 'Street Fighter (1994)',\n 'Strawberry and Chocolate (Fresa y chocolate) (1993)',\n 'Stranger, The (1994)',\n 'Stranger in the House (1997)',\n 'Strange Days (1995)',\n 'Story of Xinghua, The (1993)',\n 'Stonewall (1995)',\n 'Sting, The (1973)',\n \"Stephen King's The Langoliers (1995)\",\n 'Stefano Quantestorie (1993)',\n 'Steel (1997)',\n 'Stealing Beauty (1996)',\n 'Steal Big, Steal Little (1995)',\n 'Starship Troopers (1997)',\n 'Stars Fell on Henrietta, The (1995)',\n 'Stargate (1994)',\n 'Star Wars (1977)',\n 'Star Trek: The Wrath of Khan (1982)',\n 'Star Trek: The Motion Picture (1979)',\n 'Star Trek: Generations (1994)',\n 'Star Trek: First Contact (1996)',\n 'Star Trek VI: The Undiscovered Country (1991)',\n 'Star Trek V: The Final Frontier (1989)',\n 'Star Trek IV: The Voyage Home (1986)',\n 'Star Trek III: The Search for Spock (1984)',\n 'Star Maps (1997)',\n \"Star Maker, The (Uomo delle stelle, L') (1995)\",\n 'Star Kid (1997)',\n 'Stand by Me (1986)',\n 'Stalker (1979)',\n 'Stalingrad (1993)',\n 'Stag (1997)',\n 'Squeeze (1996)',\n 'Spy Hard (1996)',\n 'Sprung (1997)',\n 'Spitfire Grill, The (1996)',\n 'Spirits of the Dead (Tre passi nel delirio) (1968)',\n 'Spice World (1997)',\n 'Sphere (1998)',\n 'Spellbound (1945)',\n 'Speed 2: Cruise Control (1997)',\n 'Speed (1994)',\n 'Speechless (1994)',\n 'Species (1995)',\n 'Specialist, The (1994)',\n 'Spawn (1997)',\n 'Spanking the Monkey (1994)',\n 'Spanish Prisoner, The (1997)',\n 'Space Jam (1996)',\n 'Sound of Music, The (1965)',\n 'Soul Food (1997)',\n \"Sophie's Choice (1982)\",\n 'Son in Law (1993)',\n 'Somewhere in Time (1980)',\n 'Something to Talk About (1995)',\n \"Someone Else's America (1995)\",\n 'Somebody to Love (1994)',\n \"Some Mother's Son (1996)\",\n 'Some Like It Hot (1959)',\n 'Some Kind of Wonderful (1987)',\n 'Some Folks Call It a Sling Blade (1993)',\n 'Solo (1996)',\n 'So I Married an Axe Murderer (1993)',\n 'So Dear to My Heart (1949)',\n 'Snow White and the Seven Dwarfs (1937)',\n 'Sneakers (1992)',\n 'Smoke (1995)',\n \"Smilla's Sense of Snow (1997)\",\n 'Smile Like Yours, A (1997)',\n 'Small Faces (1995)',\n 'Sliver (1993)',\n 'Slingshot, The (1993)',\n 'Sling Blade (1996)',\n 'Sleepover (1995)',\n 'Sleepless in Seattle (1993)',\n 'Sleepers (1996)',\n 'Sleeper (1973)',\n 'Sixth Man, The (1997)',\n 'Six Degrees of Separation (1993)',\n 'Sirens (1994)',\n \"Singin' in the Rain (1952)\",\n 'Simple Wish, A (1997)',\n 'Simple Twist of Fate, A (1994)',\n 'Silence of the Palace, The (Saimt el Qusur) (1994)',\n 'Silence of the Lambs, The (1991)',\n 'Showgirls (1995)',\n 'Show, The (1995)',\n 'Short Cuts (1993)',\n 'Shopping (1994)',\n 'Shooting Fish (1997)',\n 'Shooter, The (1995)',\n 'Shining, The (1980)',\n 'Shine (1996)',\n 'Shiloh (1997)',\n \"She's the One (1996)\",\n \"She's So Lovely (1997)\",\n 'Shawshank Redemption, The (1994)',\n 'Shanghai Triad (Yao a yao yao dao waipo qiao) (1995)',\n 'Shallow Grave (1994)',\n 'Shall We Dance? (1996)',\n 'Shall We Dance? (1937)',\n 'Shaggy Dog, The (1959)',\n 'Shadows (Cienie) (1988)',\n 'Shadowlands (1993)',\n 'Shadow, The (1994)',\n 'Shadow of Angels (Schatten der Engel) (1976)',\n 'Shadow Conspiracy (1997)',\n 'Sgt. Bilko (1996)',\n 'Sexual Life of the Belgians, The (1994)',\n 'Sex, Lies, and Videotape (1989)',\n 'Seventh Seal, The (Sjunde inseglet, Det) (1957)',\n 'Seven Years in Tibet (1997)',\n 'Seven (Se7en) (1995)',\n 'Set It Off (1996)',\n 'Serial Mom (1994)',\n 'Senseless (1998)',\n 'Sense and Sensibility (1995)',\n 'Selena (1997)',\n 'Secrets & Lies (1996)',\n 'Secret of Roan Inish, The (1994)',\n 'Secret Garden, The (1993)',\n 'Secret Agent, The (1996)',\n 'Secret Adventures of Tom Thumb, The (1993)',\n 'Second Jungle Book: Mowgli & Baloo, The (1997)',\n 'Searching for Bobby Fischer (1993)',\n 'Search for One-eye Jimmy, The (1996)',\n 'Screamers (1995)',\n 'Scream of Stone (Schrei aus Stein) (1991)',\n 'Scream 2 (1997)',\n 'Scream (1996)',\n 'Scout, The (1994)',\n 'Schizopolis (1996)',\n \"Schindler's List (1993)\",\n 'Scarlet Letter, The (1995)',\n 'Scarlet Letter, The (1926)',\n 'Savage Nights (Nuits fauves, Les) (1992)',\n 'Santa with Muscles (1996)',\n 'Santa Clause, The (1994)',\n 'Salut cousin! (1996)',\n 'Saint, The (1997)',\n 'Saint of Fort Washington, The (1993)',\n 'Safe Passage (1994)',\n 'Safe (1995)',\n 'Sabrina (1995)',\n 'Sabrina (1954)',\n 'S.F.W. (1994)',\n 'Run of the Country, The (1995)',\n 'Rumble in the Bronx (1995)',\n 'Ruling Class, The (1972)',\n 'Rudy (1993)',\n 'Ruby in Paradise (1993)',\n 'Rough Magic (1995)',\n 'Rosewood (1997)',\n 'Rosencrantz and Guildenstern Are Dead (1990)',\n \"Roseanna's Grave (For Roseanna) (1997)\",\n 'Roommates (1995)',\n 'Room with a View, A (1986)',\n \"Romy and Michele's High School Reunion (1997)\",\n 'Romper Stomper (1992)',\n 'Romeo Is Bleeding (1993)',\n 'Roman Holiday (1953)',\n 'Rocket Man (1997)',\n 'Rock, The (1996)',\n 'Robocop 3 (1993)',\n 'Robin Hood: Prince of Thieves (1991)',\n 'Robin Hood: Men in Tights (1993)',\n \"Robert A. Heinlein's The Puppet Masters (1994)\",\n 'Rob Roy (1995)',\n 'Road to Wellville, The (1994)',\n 'River Wild, The (1994)',\n 'Rising Sun (1993)',\n 'Ripe (1996)',\n 'Right Stuff, The (1983)',\n 'Ridicule (1996)',\n 'Richie Rich (1994)',\n 'Richard III (1995)',\n \"Rich Man's Wife, The (1996)\",\n 'Rhyme & Reason (1997)',\n 'Return of the Pink Panther, The (1974)',\n 'Return of the Jedi (1983)',\n 'Return of Martin Guerre, The (Retour de Martin Guerre, Le) (1982)',\n 'Restoration (1995)',\n 'Reservoir Dogs (1992)',\n 'Replacement Killers, The (1998)',\n 'Rent-a-Kid (1995)',\n 'Rendezvous in Paris (Rendez-vous de Paris, Les) (1995)',\n 'Renaissance Man (1994)',\n 'Remains of the Day, The (1993)',\n 'Reluctant Debutante, The (1958)',\n 'Relic, The (1997)',\n 'Relative Fear (1994)',\n 'Ref, The (1994)',\n 'Red Rock West (1992)',\n 'Red Firecracker, Green Firecracker (1994)',\n 'Red Corner (1997)',\n 'Reckless (1995)',\n 'Rebel Without a Cause (1955)',\n 'Rebecca (1940)',\n 'Rear Window (1954)',\n 'Reality Bites (1994)',\n 'Real Genius (1985)',\n 'Ready to Wear (Pret-A-Porter) (1994)',\n 'Raw Deal (1948)',\n 'Ransom (1996)',\n 'Ran (1985)',\n 'Raising Arizona (1987)',\n 'Raise the Red Lantern (1991)',\n 'Rainmaker, The (1997)',\n 'Raiders of the Lost Ark (1981)',\n 'Raging Bull (1980)',\n 'Radioland Murders (1994)',\n 'Race the Sun (1996)',\n 'Quiz Show (1994)',\n 'Quiet Room, The (1996)',\n 'Quiet Man, The (1952)',\n 'Quick and the Dead, The (1995)',\n 'Quest, The (1996)',\n 'Queen Margot (Reine Margot, La) (1994)',\n 'Quartier Mozart (1992)',\n \"Pyromaniac's Love Story, A (1995)\",\n 'Pushing Hands (1992)',\n 'Purple Noon (1960)',\n 'Pump Up the Volume (1990)',\n 'Pulp Fiction (1994)',\n 'Psycho (1960)',\n 'Prophecy, The (1995)',\n 'Prophecy II, The (1998)',\n 'Promise, The (Versprechen, Das) (1994)',\n 'Promesse, La (1996)',\n 'Program, The (1993)',\n 'Professional, The (1994)',\n 'Private Parts (1997)',\n 'Private Benjamin (1980)',\n 'Prisoner of the Mountains (Kavkazsky Plennik) (1996)',\n 'Princess Caraboo (1994)',\n 'Princess Bride, The (1987)',\n 'Primary Colors (1998)',\n 'Primal Fear (1996)',\n 'Priest (1994)',\n 'Price Above Rubies, A (1998)',\n 'Pretty Woman (1990)',\n 'Prefontaine (1997)',\n \"Preacher's Wife, The (1996)\",\n 'Power 98 (1995)',\n 'Powder (1995)',\n 'Postman, The (1997)',\n 'Postino, Il (1994)',\n 'Portrait of a Lady, The (1996)',\n 'Ponette (1996)',\n 'Pompatus of Love, The (1996)',\n 'Pollyanna (1960)',\n 'Police Story 4: Project S (Chao ji ji hua) (1993)',\n 'Poison Ivy II (1995)',\n 'Poetic Justice (1993)',\n 'Pocahontas (1995)',\n 'Playing God (1997)',\n 'Platoon (1986)',\n 'Pinocchio (1940)',\n 'Pink Floyd - The Wall (1982)',\n 'Pillow Book, The (1995)',\n 'Pie in the Sky (1995)',\n 'Picture Perfect (1997)',\n 'Picture Bride (1995)',\n 'Picnic (1955)',\n 'Piano, The (1993)',\n 'Philadelphia Story, The (1940)',\n 'Philadelphia (1993)',\n 'Phenomenon (1996)',\n 'Phat Beach (1996)',\n \"Pharaoh's Army (1995)\",\n 'Phantoms (1998)',\n 'Phantom, The (1996)',\n \"Pete's Dragon (1977)\",\n 'Pest, The (1997)',\n 'Persuasion (1995)',\n 'Perfect World, A (1993)',\n 'Perfect Candidate, A (1996)',\n 'Perez Family, The (1995)',\n 'People vs. Larry Flynt, The (1996)',\n 'Penny Serenade (1941)',\n 'Peacemaker, The (1997)',\n 'Patton (1970)',\n 'Paths of Glory (1957)',\n 'Pather Panchali (1955)',\n 'Passion Fish (1992)',\n 'Party Girl (1995)',\n 'Paris, Texas (1984)',\n 'Paris, France (1993)',\n 'Paris Was a Woman (1995)',\n 'Paris Is Burning (1990)',\n 'Parent Trap, The (1961)',\n 'Paradise Road (1997)',\n 'Paradise Lost: The Child Murders at Robin Hood Hills (1996)',\n 'Paper, The (1994)',\n 'Panther (1995)',\n 'Palookaville (1996)',\n 'Palmetto (1998)',\n 'Pallbearer, The (1996)',\n 'Pagemaster, The (1994)',\n 'Outlaw, The (1943)',\n 'Outbreak (1995)',\n 'Out to Sea (1997)',\n 'Other Voices, Other Rooms (1997)',\n 'Othello (1995)',\n 'Oscar & Lucinda (1997)',\n 'Orlando (1993)',\n 'Original Gangstas (1996)',\n 'Operation Dumbo Drop (1995)',\n 'Open Season (1996)',\n 'Only You (1994)',\n 'One Night Stand (1997)',\n \"One Flew Over the Cuckoo's Nest (1975)\",\n 'One Fine Day (1996)',\n 'Once Were Warriors (1994)',\n 'Once Upon a Time... When We Were Colored (1995)',\n 'Once Upon a Time in the West (1969)',\n 'Once Upon a Time in America (1984)',\n 'On Golden Pond (1981)',\n 'Omen, The (1976)',\n 'Oliver & Company (1988)',\n 'Old Yeller (1957)',\n 'Old Man and the Sea, The (1958)',\n 'Old Lady Who Walked in the Sea, The (Vieille qui marchait dans la mer, La) (1991)',\n 'Office Killer (1997)',\n 'Of Love and Shadows (1994)',\n 'Of Human Bondage (1934)',\n 'Object of My Affection, The (1998)',\n 'Nénette et Boni (1996)',\n 'Nutty Professor, The (1996)',\n 'Nowhere (1997)',\n 'Now and Then (1995)',\n 'Notorious (1946)',\n 'Nothing to Lose (1994)',\n 'Nothing Personal (1995)',\n 'Nosferatu a Venezia (1986)',\n 'Nosferatu (Nosferatu, eine Symphonie des Grauens) (1922)',\n 'North by Northwest (1959)',\n 'North (1994)',\n 'Normal Life (1996)',\n \"Nobody's Fool (1994)\",\n 'Nobody Loves Me (Keiner liebt mich) (1994)',\n 'No Escape (1994)',\n 'Nixon (1995)',\n 'Ninotchka (1939)',\n 'Nine Months (1995)',\n 'Nina Takes a Lover (1994)',\n 'Nil By Mouth (1997)',\n 'Nikita (La Femme Nikita) (1990)',\n 'Nightmare on Elm Street, A (1984)',\n 'Nightmare Before Christmas, The (1993)',\n 'Night on Earth (1991)',\n 'Night of the Living Dead (1968)',\n 'Night Flier (1997)',\n 'Night Falls on Manhattan (1997)',\n 'Nico Icon (1995)',\n 'Nick of Time (1995)',\n 'Niagara, Niagara (1997)',\n 'Next Step, The (1995)',\n 'Next Karate Kid, The (1994)',\n 'Newton Boys, The (1998)',\n 'New York Cop (1996)',\n 'New Jersey Drive (1995)',\n 'New Age, The (1994)',\n 'NeverEnding Story III, The (1994)',\n 'Net, The (1995)',\n 'Neon Bible, The (1995)',\n 'Nemesis 2: Nebula (1995)',\n 'Nelly & Monsieur Arnaud (1995)',\n 'Nell (1994)',\n 'Natural Born Killers (1994)',\n \"National Lampoon's Senior Trip (1995)\",\n 'Naked in New York (1994)',\n 'Naked Gun 33 1/3: The Final Insult (1994)',\n 'Naked (1993)',\n 'Nadja (1994)',\n 'Mystery Science Theater 3000: The Movie (1996)',\n 'My Own Private Idaho (1991)',\n 'My Man Godfrey (1936)',\n 'My Life as a Dog (Mitt liv som hund) (1985)',\n \"My Life and Times With Antonin Artaud (En compagnie d'Antonin Artaud) (1993)\",\n 'My Left Foot (1989)',\n 'My Fellow Americans (1996)',\n 'My Favorite Year (1982)',\n 'My Favorite Season (1993)',\n 'My Family (1995)',\n 'My Fair Lady (1964)',\n 'My Crazy Life (Mi vida loca) (1993)',\n \"My Best Friend's Wedding (1997)\",\n 'Mute Witness (1994)',\n \"Muriel's Wedding (1994)\",\n 'Murder, My Sweet (1944)',\n 'Murder in the First (1995)',\n 'Murder at 1600 (1997)',\n 'Muppet Treasure Island (1996)',\n 'Multiplicity (1996)',\n 'Mulholland Falls (1996)',\n 'Much Ado About Nothing (1993)',\n 'Mrs. Winterbourne (1996)',\n 'Mrs. Parker and the Vicious Circle (1994)',\n 'Mrs. Doubtfire (1993)',\n 'Mrs. Dalloway (1997)',\n 'Mrs. Brown (Her Majesty, Mrs. Brown) (1997)',\n 'Mr. Wrong (1996)',\n 'Mr. Wonderful (1993)',\n 'Mr. Smith Goes to Washington (1939)',\n 'Mr. Magoo (1997)',\n 'Mr. Jones (1993)',\n \"Mr. Holland's Opus (1995)\",\n 'Mouse Hunt (1997)',\n 'Mother Night (1996)',\n 'Mother (1996)',\n 'Mostro, Il (1994)',\n 'Mortal Kombat: Annihilation (1997)',\n 'Mortal Kombat (1995)',\n 'Moonlight and Valentino (1995)',\n \"Monty Python's Life of Brian (1979)\",\n 'Monty Python and the Holy Grail (1974)',\n 'Month by the Lake, A (1995)',\n 'Money Train (1995)',\n 'Mondo (1996)',\n 'Moll Flanders (1996)',\n 'Modern Affair, A (1995)',\n 'Mixed Nuts (1994)',\n 'Misérables, Les (1995)',\n 'Mission: Impossible (1996)',\n 'Mirror Has Two Faces, The (1996)',\n 'Mirage (1995)',\n 'Miracle on 34th Street (1994)',\n 'Mina Tannenbaum (1994)',\n 'Mimic (1997)',\n \"Miller's Crossing (1990)\",\n 'Mille bolle blu (1993)',\n 'Milk Money (1994)',\n 'Mighty, The (1998)',\n 'Mighty Morphin Power Rangers: The Movie (1995)',\n 'Mighty Aphrodite (1995)',\n 'Midnight in the Garden of Good and Evil (1997)',\n 'Midnight Dancers (Sibak) (1994)',\n \"Microcosmos: Le peuple de l'herbe (1996)\",\n 'Michael Collins (1996)',\n 'Michael (1996)',\n 'Miami Rhapsody (1995)',\n 'Metro (1997)',\n 'Metisse (Café au Lait) (1993)',\n 'Mercury Rising (1998)',\n 'Menace II Society (1993)',\n 'Men of Means (1998)',\n 'Men in Black (1997)',\n 'Men With Guns (1997)',\n 'Meet Wally Sparks (1997)',\n 'Meet Me in St. Louis (1944)',\n 'Meet John Doe (1941)',\n 'Mediterraneo (1991)',\n \"McHale's Navy (1997)\",\n 'Maybe, Maybe Not (Bewegte Mann, Der) (1994)',\n 'Maya Lin: A Strong Clear Vision (1994)',\n 'Maximum Risk (1996)',\n 'Maverick (1994)',\n 'Matilda (1996)',\n 'MatchMaker, The (1997)',\n \"Mat' i syn (1997)\",\n 'Mask, The (1994)',\n \"Mary Shelley's Frankenstein (1994)\",\n 'Mary Reilly (1996)',\n 'Mary Poppins (1964)',\n \"Marvin's Room (1996)\",\n 'Mars Attacks! (1996)',\n 'Marlene Dietrich: Shadow and Light (1996) ',\n 'Marked for Death (1990)',\n 'Mark of Zorro, The (1940)',\n \"Margaret's Museum (1995)\",\n 'Manon of the Spring (Manon des sources) (1986)',\n 'Manny & Lo (1996)',\n 'Manhattan Murder Mystery (1993)',\n 'Manhattan (1979)',\n 'Manchurian Candidate, The (1962)',\n 'Man of the Year (1995)',\n 'Man of the House (1995)',\n 'Man of No Importance, A (1994)',\n 'Man in the Iron Mask, The (1998)',\n 'Man from Down Under, The (1943)',\n 'Man Without a Face, The (1993)',\n 'Man Who Would Be King, The (1975)',\n 'Man Who Knew Too Little, The (1997)',\n 'Mamma Roma (1962)',\n 'Maltese Falcon, The (1941)',\n 'Mallrats (1995)',\n 'Malice (1993)',\n 'Major Payne (1994)',\n 'Magnificent Seven, The (1954)',\n 'Magic Hour, The (1998)',\n 'Madonna: Truth or Dare (1991)',\n 'Madness of King George, The (1994)',\n 'Made in America (1993)',\n 'Madame Butterfly (1995)',\n 'Mad Love (1995)',\n 'Mad Dog Time (1996)',\n 'Mad City (1997)',\n 'Machine, The (1994)',\n 'Ma vie en rose (My Life in Pink) (1997)',\n 'MURDER and murder (1996)',\n 'M. Butterfly (1993)',\n 'M*A*S*H (1970)',\n 'M (1931)',\n 'Low Life, The (1994)',\n 'Low Down Dirty Shame, A (1994)',\n \"Lover's Knot (1996)\",\n 'Love! Valour! Compassion! (1997)',\n 'Love in the Afternoon (1957)',\n 'Love and a .45 (1994)',\n 'Love and Other Catastrophes (1996)',\n 'Love and Death on Long Island (1997)',\n 'Love Serenade (1996)',\n 'Love Jones (1997)',\n 'Love Is All There Is (1996)',\n 'Love Bug, The (1969)',\n 'Love Affair (1994)',\n 'Love & Human Remains (1993)',\n 'Lotto Land (1995)',\n 'Lost in Space (1998)',\n 'Lost World: Jurassic Park, The (1997)',\n 'Lost Horizon (1937)',\n 'Lost Highway (1997)',\n 'Losing Isaiah (1995)',\n 'Losing Chase (1996)',\n 'Lord of Illusions (1995)',\n 'Looking for Richard (1996)',\n 'Long Kiss Goodnight, The (1996)',\n 'Lone Star (1996)',\n 'Locusts, The (1997)',\n 'Loch Ness (1995)',\n 'Local Hero (1983)',\n 'Loaded (1994)',\n 'Living in Oblivion (1995)',\n 'Live Nude Girls (1995)',\n 'Little Women (1994)',\n 'Little Rascals, The (1994)',\n 'Little Princess, The (1939)',\n 'Little Princess, A (1995)',\n 'Little Odessa (1994)',\n 'Little Lord Fauntleroy (1936)',\n 'Little City (1998)',\n 'Little Buddha (1993)',\n 'Little Big League (1994)',\n 'Lion King, The (1994)',\n 'Line King: Al Hirschfeld, The (1996)',\n 'Like Water For Chocolate (Como agua para chocolate) (1992)',\n 'Lightning Jack (1994)',\n 'Life with Mikey (1993)',\n 'Life Less Ordinary, A (1997)',\n 'Liebelei (1933)',\n 'Liar Liar (1997)',\n 'Letter From Death Row, A (1998)',\n 'Leopard Son, The (1996)',\n 'Legends of the Fall (1994)',\n 'Legal Deceit (1997)',\n 'Leaving Las Vegas (1995)',\n 'Leave It to Beaver (1997)',\n 'Leading Man, The (1996)',\n 'Lay of the Land, The (1997)',\n 'Lawrence of Arabia (1962)',\n 'Lawnmower Man, The (1992)',\n 'Lawnmower Man 2: Beyond Cyberspace (1996)',\n 'Laura (1944)',\n 'Late Bloomers (1996)',\n 'Last of the Mohicans, The (1992)',\n 'Last Time I Saw Paris, The (1954)',\n 'Last Time I Committed Suicide, The (1997)',\n 'Last Supper, The (1995)',\n 'Last Summer in the Hamptons (1995)',\n 'Last Man Standing (1996)',\n 'Last Klezmer: Leopold Kozlowski, His Life and Music, The (1995)',\n 'Last Dance (1996)',\n 'Last Action Hero (1993)',\n 'Lassie (1994)',\n 'Lashou shentan (1992)',\n 'Larger Than Life (1996)',\n 'Land and Freedom (Tierra y libertad) (1995)',\n 'Land Before Time III: The Time of the Great Giving (1995) (V)',\n 'Lamerica (1994)',\n 'Ladybird Ladybird (1994)',\n 'Lady of Burlesque (1943)',\n 'L.A. Confidential (1997)',\n 'Kundun (1997)',\n 'Koyaanisqatsi (1983)',\n 'Kolya (1996)',\n 'Kissed (1996)',\n 'Kiss the Girls (1997)',\n 'Kiss of Death (1995)',\n 'Kiss Me, Guido (1997)',\n 'Kingpin (1996)',\n 'King of the Hill (1993)',\n 'King of New York (1990)',\n 'Kim (1950)',\n 'Killing Zoe (1994)',\n 'Killing Fields, The (1984)',\n 'Killer: A Journal of Murder (1995)',\n 'Killer (Bulletproof Heart) (1994)',\n 'Kika (1993)',\n 'Kids in the Hall: Brain Candy (1996)',\n 'Kids (1995)',\n \"Kid in King Arthur's Court, A (1995)\",\n 'Kicking and Screaming (1995)',\n 'Kicked in the Head (1997)',\n 'Keys to Tulsa (1997)',\n 'Kazaam (1996)',\n 'Kaspar Hauser (1993)',\n 'Kansas City (1996)',\n 'Kama Sutra: A Tale of Love (1996)',\n 'Kalifornia (1993)',\n 'Just Cause (1995)',\n 'Jury Duty (1995)',\n 'Juror, The (1996)',\n 'Jurassic Park (1993)',\n \"Jupiter's Wife (1994)\",\n 'Junior (1994)',\n 'Jungle2Jungle (1997)',\n 'Jungle Book, The (1994)',\n 'Jumanji (1995)',\n 'Judgment Night (1993)',\n 'Judge Dredd (1995)',\n 'Jude (1996)',\n 'Joy Luck Club, The (1993)',\n 'Journey of August King, The (1995)',\n 'Johns (1996)',\n 'Johnny Mnemonic (1995)',\n 'Johnny 100 Pesos (1993)',\n \"Joe's Apartment (1996)\",\n 'Jingle All the Way (1996)',\n 'Jimmy Hollywood (1994)',\n 'Jerry Maguire (1996)',\n 'Jerky Boys, The (1994)',\n 'Jeffrey (1995)',\n 'Jefferson in Paris (1995)',\n 'Jean de Florette (1986)',\n 'Jaws 3-D (1983)',\n 'Jaws 2 (1978)',\n 'Jaws (1975)',\n \"Jason's Lyric (1994)\",\n 'Jane Eyre (1996)',\n 'James and the Giant Peach (1996)',\n 'Jade (1995)',\n \"Jackie Chan's First Strike (1996)\",\n 'Jackie Brown (1997)',\n 'Jackal, The (1997)',\n 'Jack and Sarah (1995)',\n 'Jack (1996)',\n 'JLG/JLG - autoportrait de décembre (1994)',\n \"It's a Wonderful Life (1946)\",\n \"It's My Party (1995)\",\n 'It Takes Two (1995)',\n 'It Happened One Night (1934)',\n 'It Could Happen to You (1994)',\n 'Island of Dr. Moreau, The (1996)',\n 'Invitation, The (Zaproszenie) (1986)',\n 'Inventing the Abbotts (1997)',\n 'Intimate Relations (1996)',\n 'Interview with the Vampire (1994)',\n 'Inspector General, The (1949)',\n 'Innocents, The (1961)',\n 'Innocent Sleep, The (1995)',\n 'Inkwell, The (1994)',\n 'Infinity (1996)',\n 'Indiana Jones and the Last Crusade (1989)',\n 'Indian in the Cupboard, The (1995)',\n 'Indian Summer (1996)',\n 'Independence Day (ID4) (1996)',\n 'Incognito (1997)',\n 'In the Realm of the Senses (Ai no corrida) (1976)',\n 'In the Name of the Father (1993)',\n 'In the Mouth of Madness (1995)',\n 'In the Line of Fire (1993)',\n 'In the Line of Duty 2 (1987)',\n 'In the Company of Men (1997)',\n 'In the Bleak Midwinter (1995)',\n 'In the Army Now (1994)',\n 'In Love and War (1996)',\n 'In & Out (1997)',\n 'Immortal Beloved (1994)',\n 'Ill Gotten Gains (1997)',\n 'If Lucy Fell (1996)',\n 'I.Q. (1994)',\n 'I, Worst of All (Yo, la peor de todas) (1990)',\n \"I'm Not Rappaport (1996)\",\n \"I'll Do Anything (1994)\",\n 'I Shot Andy Warhol (1996)',\n 'I Love Trouble (1994)',\n 'I Like It Like That (1994)',\n 'I Know What You Did Last Summer (1997)',\n \"I Don't Want to Talk About It (De eso no se habla) (1993)\",\n \"I Can't Sleep (J'ai pas sommeil) (1994)\",\n 'Hush (1998)',\n 'Hunted, The (1995)',\n 'Hunt for Red October, The (1990)',\n 'Hungarian Fairy Tale, A (1987)',\n 'Hunchback of Notre Dame, The (1996)',\n 'Hudsucker Proxy, The (1994)',\n 'Howling, The (1981)',\n 'How to Make an American Quilt (1995)',\n 'How to Be a Player (1997)',\n 'Houseguest (1994)',\n 'House of the Spirits, The (1993)',\n 'House of Yes, The (1997)',\n 'House Party 3 (1994)',\n 'House Arrest (1996)',\n 'Hour of the Pig, The (1993)',\n 'Hotel de Love (1996)',\n 'Hot Shots! Part Deux (1993)',\n 'Hostile Intentions (1994)',\n 'Horseman on the Roof, The (Hussard sur le toit, Le) (1995)',\n 'Horse Whisperer, The (1998)',\n 'Hoop Dreams (1994)',\n 'Hoodlum (1997)',\n 'Homeward Bound: The Incredible Journey (1993)',\n 'Homeward Bound II: Lost in San Francisco (1996)',\n 'Home for the Holidays (1995)',\n 'Home Alone 3 (1997)',\n 'Home Alone (1990)',\n 'Homage (1995)',\n 'Hollow Reed (1996)',\n 'His Girl Friday (1940)',\n 'Highlander III: The Sorcerer (1994)',\n 'Highlander (1986)',\n 'Higher Learning (1995)',\n 'High School High (1996)',\n 'High Noon (1952)',\n 'Hideaway (1995)',\n 'Here Comes Cookie (1935)',\n 'Hercules (1997)',\n 'Herbie Rides Again (1974)',\n 'Henry V (1989)',\n 'Hellraiser: Bloodline (1996)',\n 'Heidi Fleiss: Hollywood Madam (1995) ',\n 'Hedd Wyn (1992)',\n 'Heavyweights (1994)',\n ...]" }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movie_titles_vocabulary.get_vocabulary()" ], "metadata": { "collapsed": false, "pycharm": { "name": "#%%\n" } } }, { "cell_type": "code", "execution_count": 7, "outputs": [ { "data": { "text/plain": "" }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movie_title_lookup([\"Star Wars (1977)\", \"One Flew Over the Cuckoo's Nest (1975)\"])" ], "metadata": { "collapsed": false, "pycharm": { "name": "#%%\n" } } }, { "cell_type": "code", "execution_count": 8, "outputs": [], "source": [ "# We set up a large number of bins to reduce the chance of hash collisions.\n", "num_hashing_bins = 200_000\n", "\n", "movie_title_hashing = tf.keras.layers.experimental.preprocessing.Hashing(\n", " num_bins=num_hashing_bins\n", ")" ], "metadata": { "collapsed": false, "pycharm": { "name": "#%%\n" } } }, { "cell_type": "code", "execution_count": 9, "outputs": [ { "data": { "text/plain": "" }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movie_title_hashing([\"Star Wars (1977)\", \"One Flew Over the Cuckoo's Nest (1975)\"])" ], "metadata": { "collapsed": false, "pycharm": { "name": "#%%\n" } } }, { "cell_type": "code", "execution_count": 10, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "WARNING:tensorflow:vocab_size is deprecated, please use vocabulary_size.\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "WARNING:tensorflow:vocab_size is deprecated, please use vocabulary_size.\n" ] } ], "source": [ "movie_title_embedding = tf.keras.layers.Embedding(\n", " # Let's use the explicit vocabulary lookup.\n", " input_dim=movie_title_lookup.vocab_size(),\n", " output_dim=32\n", ")" ], "metadata": { "collapsed": false, "pycharm": { "name": "#%%\n" } } }, { "cell_type": "code", "execution_count": 11, "outputs": [], "source": [ "movie_title_model = tf.keras.Sequential([movie_title_lookup, movie_title_embedding])" ], "metadata": { "collapsed": false, "pycharm": { "name": "#%%\n" } } }, { "cell_type": "code", "execution_count": 12, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "WARNING:tensorflow:Layers in a Sequential model should only have a single input tensor, but we receive a input: ['Star Wars (1977)']\n", "Consider rewriting this model with the Functional API.\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "WARNING:tensorflow:Layers in a Sequential model should only have a single input tensor, but we receive a input: ['Star Wars (1977)']\n", "Consider rewriting this model with the Functional API.\n" ] }, { "data": { "text/plain": "" }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "movie_title_model([\"Star Wars (1977)\"])" ], "metadata": { "collapsed": false, "pycharm": { "name": "#%%\n" } } }, { "cell_type": "code", "execution_count": 13, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "WARNING:tensorflow:vocab_size is deprecated, please use vocabulary_size.\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "WARNING:tensorflow:vocab_size is deprecated, please use vocabulary_size.\n" ] } ], "source": [ "user_id_lookup = tf.keras.layers.experimental.preprocessing.StringLookup()\n", "user_id_lookup.adapt(ratings.map(lambda x: x[\"user_id\"]))\n", "\n", "user_id_embedding = tf.keras.layers.Embedding(user_id_lookup.vocab_size(), 32)\n", "\n", "user_id_model = tf.keras.Sequential([user_id_lookup, user_id_embedding])" ], "metadata": { "collapsed": false, "pycharm": { "name": "#%%\n" } } }, { "cell_type": "code", "execution_count": 14, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Timestamp: 879024327.\n", "Timestamp: 875654590.\n", "Timestamp: 882075110.\n" ] } ], "source": [ "for x in ratings.take(3).as_numpy_iterator():\n", " print(f\"Timestamp: {x['timestamp']}.\")" ], "metadata": { "collapsed": false, "pycharm": { "name": "#%%\n" } } }, { "cell_type": "code", "execution_count": 15, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Normalized timestamp: [[-0.8429372]].\n", "Normalized timestamp: [[-1.4735202]].\n", "Normalized timestamp: [[-0.27203265]].\n" ] } ], "source": [ "timestamp_normalization = tf.keras.layers.experimental.preprocessing.Normalization()\n", "timestamp_normalization.adapt(ratings.map(lambda x: x[\"timestamp\"]).batch(1024))\n", "\n", "for x in ratings.take(3).as_numpy_iterator():\n", " print(f\"Normalized timestamp: {timestamp_normalization(x['timestamp'])}.\")" ], "metadata": { "collapsed": false, "pycharm": { "name": "#%%\n" } } }, { "cell_type": "code", "execution_count": 16, "outputs": [], "source": [ "max_timestamp = ratings.map(lambda x: x[\"timestamp\"]).reduce(\n", " tf.cast(0, tf.int64), tf.maximum).numpy().max()" ], "metadata": { "collapsed": false, "pycharm": { "name": "#%%\n" } } }, { "cell_type": "code", "execution_count": 17, "outputs": [], "source": [ "max_timestamp = ratings.map(lambda x: x[\"timestamp\"]).reduce(\n", " tf.cast(0, tf.int64), tf.maximum).numpy().max()\n", "min_timestamp = ratings.map(lambda x: x[\"timestamp\"]).reduce(\n", " np.int64(1e9), tf.minimum).numpy().min()" ], "metadata": { "collapsed": false, "pycharm": { "name": "#%%\n" } } }, { "cell_type": "code", "execution_count": 18, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Buckets: [8.74724710e+08 8.74743291e+08 8.74761871e+08]\n" ] } ], "source": [ "timestamp_buckets = np.linspace(\n", " min_timestamp, max_timestamp, num=1000)\n", "\n", "print(f\"Buckets: {timestamp_buckets[:3]}\")" ], "metadata": { "collapsed": false, "pycharm": { "name": "#%%\n" } } }, { "cell_type": "code", "execution_count": 19, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Timestamp embedding: [[-0.04667547 -0.02808862 0.01682058 0.0338834 -0.03198426 0.00383388\n", " 0.03077259 0.01907918 0.04480798 -0.03309586 -0.01344311 0.0165614\n", " -0.02186432 -0.01408075 0.00864227 -0.03585001 -0.00817011 0.01023756\n", " 0.02895612 -0.040274 0.0173769 0.0120603 -0.01638366 -0.04449072\n", " -0.01819245 -0.03192252 -0.00627976 0.01466325 0.04082705 0.03110823\n", " -0.02607706 0.02907329]].\n" ] } ], "source": [ "timestamp_embedding_model = tf.keras.Sequential([\n", " tf.keras.layers.experimental.preprocessing.Discretization(timestamp_buckets.tolist()),\n", " tf.keras.layers.Embedding(len(timestamp_buckets) + 1, 32)\n", "])\n", "\n", "for timestamp in ratings.take(1).map(lambda x: x[\"timestamp\"]).batch(1).as_numpy_iterator():\n", " print(f\"Timestamp embedding: {timestamp_embedding_model(timestamp)}.\")" ], "metadata": { "collapsed": false, "pycharm": { "name": "#%%\n" } } }, { "cell_type": "code", "execution_count": 20, "outputs": [], "source": [ "title_text = tf.keras.layers.experimental.preprocessing.TextVectorization()\n", "title_text.adapt(ratings.map(lambda x: x[\"movie_title\"]))" ], "metadata": { "collapsed": false, "pycharm": { "name": "#%%\n" } } }, { "cell_type": "code", "execution_count": 21, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "tf.Tensor([[ 32 266 162 2 267 265 53]], shape=(1, 7), dtype=int64)\n" ] } ], "source": [ "for row in ratings.batch(1).map(lambda x: x[\"movie_title\"]).take(1):\n", " print(title_text(row))" ], "metadata": { "collapsed": false, "pycharm": { "name": "#%%\n" } } }, { "cell_type": "code", "execution_count": 22, "outputs": [ { "data": { "text/plain": "['first', '1998', '1977', '1971', 'monty']" }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "title_text.get_vocabulary()[40:45]" ], "metadata": { "collapsed": false, "pycharm": { "name": "#%%\n" } } }, { "cell_type": "code", "execution_count": 23, "outputs": [ { "data": { "text/plain": "2468" }, "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(title_text.get_vocabulary())" ], "metadata": { "collapsed": false, "pycharm": { "name": "#%%\n" } } }, { "cell_type": "code", "execution_count": 24, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "tf.Tensor(\n", "[[-0.0438923 0.00482889 0.01170977 -0.04974284 -0.02898848 0.03447617\n", " -0.00012434 0.01063495 -0.02815315 -0.0414476 0.03511366 -0.00849334\n", " -0.02312708 0.02719413 0.03063178 0.04632486 0.04097709 0.02941669\n", " 0.04679706 -0.01792303 -0.03674388 0.0379673 0.00889906 -0.00635362\n", " -0.03862506 0.04349775 -0.04566013 0.03360397 0.02138766 0.02380446\n", " -0.02359644 0.02273068]], shape=(1, 32), dtype=float32)\n", "tf.Tensor(\n", "[[-0.04667547 -0.02808862 0.01682058 0.0338834 -0.03198426 0.00383388\n", " 0.03077259 0.01907918 0.04480798 -0.03309586 -0.01344311 0.0165614\n", " -0.02186432 -0.01408075 0.00864227 -0.03585001 -0.00817011 0.01023756\n", " 0.02895612 -0.040274 0.0173769 0.0120603 -0.01638366 -0.04449072\n", " -0.01819245 -0.03192252 -0.00627976 0.01466325 0.04082705 0.03110823\n", " -0.02607706 0.02907329]], shape=(1, 32), dtype=float32)\n", "tf.Tensor([[-0.8429372]], shape=(1, 1), dtype=float32)\n", "tf.Tensor(\n", "[[-4.3892302e-02 4.8288926e-03 1.1709772e-02 -4.9742844e-02\n", " -2.8988481e-02 3.4476172e-02 -1.2433529e-04 1.0634948e-02\n", " -2.8153146e-02 -4.1447602e-02 3.5113659e-02 -8.4933415e-03\n", " -2.3127079e-02 2.7194131e-02 3.0631784e-02 4.6324860e-02\n", " 4.0977094e-02 2.9416692e-02 4.6797063e-02 -1.7923035e-02\n", " -3.6743879e-02 3.7967298e-02 8.8990554e-03 -6.3536167e-03\n", " -3.8625062e-02 4.3497752e-02 -4.5660127e-02 3.3603970e-02\n", " 2.1387663e-02 2.3804460e-02 -2.3596441e-02 2.2730682e-02\n", " -4.6675470e-02 -2.8088618e-02 1.6820583e-02 3.3883404e-02\n", " -3.1984258e-02 3.8338788e-03 3.0772593e-02 1.9079182e-02\n", " 4.4807982e-02 -3.3095859e-02 -1.3443112e-02 1.6561400e-02\n", " -2.1864319e-02 -1.4080752e-02 8.6422674e-03 -3.5850011e-02\n", " -8.1701055e-03 1.0237563e-02 2.8956119e-02 -4.0274002e-02\n", " 1.7376903e-02 1.2060296e-02 -1.6383659e-02 -4.4490721e-02\n", " -1.8192448e-02 -3.1922519e-02 -6.2797554e-03 1.4663253e-02\n", " 4.0827047e-02 3.1108234e-02 -2.6077056e-02 2.9073287e-02\n", " -8.4293717e-01]], shape=(1, 65), dtype=float32)\n" ] } ], "source": [ "for row in ratings.batch(1).take(1):\n", " print(user_id_model(row['user_id']))\n", " print(timestamp_embedding_model(row['timestamp']))\n", " print(timestamp_normalization(row['timestamp']))\n", " print(tf.concat([user_id_model(row['user_id']),\n", " timestamp_embedding_model(row['timestamp']),\n", " timestamp_normalization(row['timestamp'])], axis=1))" ], "metadata": { "collapsed": false, "pycharm": { "name": "#%%\n" } } }, { "cell_type": "code", "execution_count": 25, "outputs": [], "source": [ "class UserModel(tf.keras.Model):\n", "\n", " def __init__(self):\n", " super().__init__()\n", "\n", " self.user_embedding = tf.keras.Sequential([\n", " user_id_lookup,\n", " tf.keras.layers.Embedding(user_id_lookup.vocab_size(), 32),\n", " ])\n", " self.timestamp_embedding = tf.keras.Sequential([\n", " tf.keras.layers.experimental.preprocessing.Discretization(timestamp_buckets.tolist()),\n", " tf.keras.layers.Embedding(len(timestamp_buckets) + 2, 32)\n", " ])\n", " self.normalized_timestamp = tf.keras.layers.experimental.preprocessing.Normalization()\n", "\n", " def call(self, inputs):\n", "\n", " # Take the input dictionary, pass it through each input layer,\n", " # and concatenate the result.\n", " return tf.concat([\n", " self.user_embedding(inputs[\"user_id\"]),\n", " self.timestamp_embedding(inputs[\"timestamp\"]),\n", " self.normalized_timestamp(inputs[\"timestamp\"])\n", " ], axis=1)" ], "metadata": { "collapsed": false, "pycharm": { "name": "#%%\n" } } }, { "cell_type": "code", "execution_count": 26, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "WARNING:tensorflow:vocab_size is deprecated, please use vocabulary_size.\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "WARNING:tensorflow:vocab_size is deprecated, please use vocabulary_size.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Computed representations: [-0.01393082 -0.048677 0.00579016]\n" ] } ], "source": [ "user_model = UserModel()\n", "\n", "user_model.normalized_timestamp.adapt(\n", " ratings.map(lambda x: x[\"timestamp\"]).batch(128))\n", "\n", "for row in ratings.batch(1).take(1):\n", " print(f\"Computed representations: {user_model(row)[0, :3]}\")" ], "metadata": { "collapsed": false, "pycharm": { "name": "#%%\n" } } }, { "cell_type": "code", "execution_count": 27, "outputs": [], "source": [ "class MovieModel(tf.keras.Model):\n", "\n", " def __init__(self):\n", " super().__init__()\n", "\n", " max_tokens = 10_000\n", "\n", " self.title_embedding = tf.keras.Sequential([\n", " movie_title_lookup,\n", " tf.keras.layers.Embedding(movie_title_lookup.vocab_size(), 32)\n", " ])\n", " self.title_text_embedding = tf.keras.Sequential([\n", " tf.keras.layers.experimental.preprocessing.TextVectorization(max_tokens=max_tokens),\n", " tf.keras.layers.Embedding(max_tokens, 32, mask_zero=True),\n", " # We average the embedding of individual words to get one embedding vector\n", " # per title.\n", " tf.keras.layers.GlobalAveragePooling1D(),\n", " ])\n", "\n", " def call(self, inputs):\n", " return tf.concat([\n", " self.title_embedding(inputs[\"movie_title\"]),\n", " self.title_text_embedding(inputs[\"movie_title\"]),\n", " ], axis=1)" ], "metadata": { "collapsed": false, "pycharm": { "name": "#%%\n" } } }, { "cell_type": "code", "execution_count": 28, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "WARNING:tensorflow:vocab_size is deprecated, please use vocabulary_size.\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "WARNING:tensorflow:vocab_size is deprecated, please use vocabulary_size.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Computed representations: [-0.04467254 0.00962601 -0.03479909]\n" ] } ], "source": [ "movie_model = MovieModel()\n", "\n", "movie_model.title_text_embedding.layers[0].adapt(\n", " ratings.map(lambda x: x[\"movie_title\"]))\n", "\n", "for row in ratings.batch(1).take(1):\n", " print(f\"Computed representations: {movie_model(row)[0, :3]}\")" ], "metadata": { "collapsed": false, "pycharm": { "name": "#%%\n" } } }, { "cell_type": "code", "execution_count": 28, "outputs": [], "source": [], "metadata": { "collapsed": false, "pycharm": { "name": "#%%\n" } } } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.6" } }, "nbformat": 4, "nbformat_minor": 0 }