Skip to content

Instantly share code, notes, and snippets.

@jamesonthecrow
Last active November 11, 2018 03:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamesonthecrow/7ae83cbd758bffd5a7a559ee51561a49 to your computer and use it in GitHub Desktop.
Save jamesonthecrow/7ae83cbd758bffd5a7a559ee51561a49 to your computer and use it in GitHub Desktop.
Test the subreddit suggester on some custom titles.
# 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