Last active
November 11, 2018 03:35
-
-
Save jamesonthecrow/7ae83cbd758bffd5a7a559ee51561a49 to your computer and use it in GitHub Desktop.
Test the subreddit suggester on some custom titles.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Test the model on some titles I wrote with specific subreddits in mind. | |
sample_titles = [ | |
'Saw this good boy at the park today.', | |
'Latest NIPS submission from OpenAI', | |
'TIL you can use Core ML to suggest subreddits to users', | |
'I made a tutorial using CreateML AMA', | |
'Westworld and Game of Thrones coming to netflix', | |
'We park in driveways, but drive on parkways', | |
'From the top of Mt. Fuji, Japan', | |
"What's the first thing you do every morning?", | |
'Taylor Swift announces additional Reputation tour dates' | |
] | |
for title in sample_titles: | |
result = mlmodel.predict({'text': title}) | |
print(title, ' | ', result['label']) | |
# Saw this good boy at the park today. | aww | |
# Latest NIPS submission from OpenAI | MachineLearning | |
# TIL you can use Core ML to suggest subreddits to users | todayilearned | |
# I made a tutorial using CreateML AMA | IAmA | |
# Westworld and Game of Thrones coming to netflix | television | |
# We park in driveways, but drive on parkways | Showerthoughts | |
# From the top of Mt. Fuji, Japan | EarthPorn | |
# What's the first thing you do every morning? | AskReddit | |
# Taylor Swift announces additional Reputation tour dates | iOSProgramming |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment