50
Smarter & Cuter Bots

Smarter & Cuter Bots

  • Upload
    fitc

  • View
    223

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Smarter & Cuter Bots

Smarter & Cuter Bots

Page 2: Smarter & Cuter Bots

About Me!Rachel White

@ohhoeTechnical Evangelist @ Microsoft

I love catsI love cute thingsI love twitter bots!

Smarter & Cuter Bots -@ohhoe

Page 3: Smarter & Cuter Bots

About Me!RoboKitty – Automated Cat Feeder

https://github.com/rachelnicole/robokitty

Smarter & Cuter Bots -@ohhoe

Page 4: Smarter & Cuter Bots

About Me!Glitch Art!

Smarter & Cuter Bots -@ohhoe

Page 5: Smarter & Cuter Bots

About Me!Artist Residency @ Pioneer Works

Smarter & Cuter Bots -@ohhoe

Page 6: Smarter & Cuter Bots

About Me!Video Games

Smarter & Cuter Bots -@ohhoe

Page 7: Smarter & Cuter Bots

About Me!Cute Twitter Bots

Smarter & Cuter Bots -@ohhoe

Page 8: Smarter & Cuter Bots

Notable Bot Types

Machine LearningMarkov Chain

Corpus FedGenerative Image Bots

Just Plain ~ Weird ~

Smarter & Cuter Bots -@ohhoe

Page 9: Smarter & Cuter Bots

Machine LearningWhat is it?

Smarter & Cuter Bots -@ohhoe

“Machine learning is the subfield of computer science that gives computers the ability to learn without being explicitly programmed .”

Arthur Samuel, 1959

Page 10: Smarter & Cuter Bots

Machine LearningWhat is it?

Smarter & Cuter Bots -@ohhoe

Page 11: Smarter & Cuter Bots
Page 12: Smarter & Cuter Bots

Machine Learning

Smarter & Cuter Bots -@ohhoe

Within the field of data analytics, machine learning is a method used to devise complex models and algorithms that lend themselves to prediction; in commercial use, this is known as predictive analytics.

Source: https://en.wikipedia.org/wiki/Machine_learning

Page 13: Smarter & Cuter Bots

Machine Learning

Smarter & Cuter Bots -@ohhoe

These analytical models allow researchers, data scientists, engineers, and analysts to "produce reliable, repeatable decisions and results" and uncover "hidden insights" through learning from historical relationships and trends in the data.

Source: https://en.wikipedia.org/wiki/Machine_learning

Page 14: Smarter & Cuter Bots

Source: http://freakonometrics.hypotheses.org/20274

Page 15: Smarter & Cuter Bots

Machine Learning

Smarter & Cuter Bots -@ohhoe

Computer Vision, Predictive Text, Emotional Analysis, Facial Detection, Deep Learning, Neural Networks, etc etc etc etc and so on

Page 16: Smarter & Cuter Bots

Machine Learning

Smarter & Cuter Bots -@ohhoe

There’s a lot.But they’re still trained models, they still require some sort of input from a human being.

Page 17: Smarter & Cuter Bots

Natural Language Processing

Smarter & Cuter Bots -@ohhoe

Modern NLP algorithms are based on machine learning, especially statistical machine learning. The paradigm of machine learning is different from that of most prior attempts at language processing. Prior implementations of language-processing tasks typically involved the direct hand coding of large sets of rules.

Source: https://en.wikipedia.org/wiki/Natural_language_processing#Using_machine_learning

Page 18: Smarter & Cuter Bots

Natural Language Processing

Smarter & Cuter Bots -@ohhoe

The machine-learning paradigm calls instead for using general learning algorithms — often, although not always, grounded in statistical inference — to automatically learn such rules through the analysis of large corpora of typical real-world examples. A corpus (plural, "corpora") is a set of documents (or sometimes, individual sentences) that have been hand-annotated with the correct values to be learned.

Source: https://en.wikipedia.org/wiki/Natural_language_processing#Using_machine_learning

Page 19: Smarter & Cuter Bots

Natural Language Processing

Smarter & Cuter Bots -@ohhoe

Types of NLP:Linguistic AnalysisLanguage UnderstandingText AnalyticsAnalyzing Tone

Page 20: Smarter & Cuter Bots

Markov ChainWhat is it?

Smarter & Cuter Bots -@ohhoe

“a stochastic model describing a sequence of possible events in which the probability of each event depends only on the state attained in the previous event.”

Page 21: Smarter & Cuter Bots

Markov ChainOh.

Smarter & Cuter Bots -@ohhoe

Source: http://setosa.io/ev/markov-chains/

With two states (A and B) in our state space, there are 4 possible transitions (not 2, because a state can transition back into itself). If we're at 'A' we could transition to 'B' or stay at 'A'. If we're at 'B' we could transition to 'A' or stay at 'B'.

Page 22: Smarter & Cuter Bots

Markov Chain

Smarter & Cuter Bots -@ohhoe

Source: http://setosa.io/ev/markov-chains/

Page 23: Smarter & Cuter Bots

Corpus FedWhat is it?

Smarter & Cuter Bots -@ohhoe

“In linguistics, a corpus (plural corpora) or text corpus is a large and structured set of texts (nowadays usually electronically stored and processed). They are used to do statistical analysis and hypothesis testing, checking occurrences or validating linguistic rules within a specific language territory.”

Source: https://en.wikipedia.org/wiki/Text_corpus

Page 24: Smarter & Cuter Bots

Corpus FedWhat is it?

Smarter & Cuter Bots -@ohhoe

Often used in Natural Language Processing, but more often used with generic twitter bots that combine or utilize text snippets in a more generalized way.

Page 25: Smarter & Cuter Bots

Corpus Fed

Smarter & Cuter Bots -@ohhoe

Source: https://github.com/dariusk/corpora

Page 26: Smarter & Cuter Bots

Corpus Fed

Smarter & Cuter Bots -@ohhoe

Source: https://github.com/rachelnicole/isReallyCute-bot

Page 27: Smarter & Cuter Bots

Generative ImagesWhat is it?

Smarter & Cuter Bots -@ohhoe

SVG generative through traceryCompiled through Image Magick / Graphics MagickAltering raw image binaries

Page 28: Smarter & Cuter Bots

Generative Images

Smarter & Cuter Bots -@ohhoe

Source: @amandaglosson made @tinyneighbor

Page 29: Smarter & Cuter Bots

Generative Images

Smarter & Cuter Bots -@ohhoe

Source: @v21 made @softlandscapes

Page 30: Smarter & Cuter Bots

Smarter & Cuter Bots -@ohhoe

Source: http://cheapbotsdonequick.com/source/softlandscapes

Page 31: Smarter & Cuter Bots

WeirdWhat is it?

Smarter & Cuter Bots -@ohhoe

Idk. Just weird stuff

Seriously though, a lot of corpus fed text, random images, and general nonsensical markov chains for the purpose of being weird and fun.

Page 32: Smarter & Cuter Bots

Smarter & Cuter Bots -@ohhoe

Source: @deathmtn made @cleromancer

Page 33: Smarter & Cuter Bots

Weird

Smarter & Cuter Bots -@ohhoe

Source: @ckolderup made @OminousZoom

Page 34: Smarter & Cuter Bots

So What Are We Making?

Smarter & Cuter Bots -@ohhoe

Twitter Bot! ( obviously )Utilizing Twitter Streaming APIsGraphicsMagickMicrosoft’s Cognitive Services – specifically the Face API

Page 35: Smarter & Cuter Bots

Twit

Smarter & Cuter Bots -@ohhoe

Make sure you have node & npm installedhttps://github.com/ttezel/twitSign up for twitter app for auth tokens

Page 36: Smarter & Cuter Bots

Graphics Magick

Smarter & Cuter Bots -@ohhoe

GraphicsMagick is a tool to create, edit, and compose / composite images. It’s super versatile, you can access it from the cli or C, C++, Lua, Perl, PHP, Python, Tcl, Ruby, Windows .NET, or Windows COM programming interfaces.There’s a node port of it you can use via npm install gm.ButIt’s kind of a pain in the ass

Source: http://www.graphicsmagick.org/

Page 37: Smarter & Cuter Bots

Graphics Magick

Smarter & Cuter Bots -@ohhoe

Down / Up Sampling of images are kind of poor qualityIt requires some hacky workaroundsIn node, you’ve got to use a ton of callbacks to do multiple compositing.To host it on a server you have to be able to install some binaries L

Source: http://www.graphicsmagick.org/

Page 38: Smarter & Cuter Bots

Microsoft Cognitive Services

Smarter & Cuter Bots -@ohhoe

It’s rad.Whole suite of Machine Learning REST APIsComputer Vision, Content Moderator, Emotion, Face, Video, Bing Speech, Custom Recognition, Speaker Recognition, Bing Spell Check, Language Understanding, Linguistic Analysis, Text Analytics, Translator, WebLM, Academic, Entity Linking, Knowledge Exploration, Recommendations, Lots of Bing things.

Source: https://www.microsoft.com/cognitive-services/

Page 39: Smarter & Cuter Bots

Microsoft Cognitive Services

Smarter & Cuter Bots -@ohhoe

It’s super easy to useIf you know how to hit an endpoint, you can use everything.We’re going to use the Face API

Source: https://www.microsoft.com/cognitive-services/

Page 40: Smarter & Cuter Bots

Microsoft Face API

Smarter & Cuter Bots -@ohhoe

Detect one or more human faces in an image and get back face rectangles for where in the image the faces are, along with face attributes which contain machine learning-based predictions of facial features.The face attribute features available are: Age, Gender, Pose, Smile, and Facial Hair along with 27 landmarks for each face in the image.

Source: https://www.microsoft.com/cognitive-services/en-us/face-api

Page 41: Smarter & Cuter Bots

Microsoft Face API

Smarter & Cuter Bots -@ohhoe

Let’s try it out.

Source: https://www.microsoft.com/cognitive-services/en-us/face-api

Page 42: Smarter & Cuter Bots

Okay, but Rachel….

Smarter & Cuter Bots -@ohhoe

What exactly are we making?

Page 43: Smarter & Cuter Bots
Page 44: Smarter & Cuter Bots

Magical and Cute Image Bot!!!

Smarter & Cuter Bots -@ohhoe

Page 45: Smarter & Cuter Bots

Smarter & Cuter Bots -@ohhoe

Page 46: Smarter & Cuter Bots

~ Code Demo Time ~

Smarter & Cuter Bots -@ohhoe

Page 47: Smarter & Cuter Bots

Magical and Cute Image Bot

Smarter & Cuter Bots -@ohhoe

Page 48: Smarter & Cuter Bots

I Launched it in November!

Smarter & Cuter Bots -@ohhoe

People immediately tried to break it!

Sometimes it glitched out

Page 49: Smarter & Cuter Bots

I’m Launching it Right NOW!!!!!!!!

Smarter & Cuter Bots -@ohhoe

Page 50: Smarter & Cuter Bots

Thank You!

Smarter & Cuter Bots -@ohhoe

Follow me on twitter: @ohhoehttp://rachelisaweso.mehttp://imcool.onlineGithub Source: https://github.com/rachelnicole/magicalncutehttp://aka.ms/smarterandcuter