#13 Fake News Detection with Data Science (with Mike Tamir)

Mike Tamir built a fake-news detector that classifies articles by journalism, opinion, satire, and credibility using word embeddings and LSTMs, then deployed it as a browser extension called Walt. He also discusses using deep learning for recommendation systems at companies like Starbucks and CVS, and the ethical risks of filter bubbles and bias in personalization.
Chapters
In this episode of Data Framed, a Data Camp podcast, I'll be speaking with Mike Tamir, head of Data science at Uber atg, Uber Self Driving, a machine learning specialist and data science faculty at UC Berkeley. Mike and I will be talking about how he's leveraging data science and deep learning to build fake news detection algorithms, along with his work in building data science workflows for Fortune 500 companies. I'm Hugo Bown Anderson, a data scientist, Datacamp and this is Data Framed. Welcome to Data Framed, a weekly datacamp podcast exploring what data science looks like on the ground for working data scientists and what problems it can solve. I'm your host, Hugo Bown Anderson. You can follow me on Twitter hugobown and datacamp@datacamp. You can find all our episodes and show notes@datacamp.com community podcast. Hey there, Mike, and welcome to Data Framed.
Hi. Good to speak with you.
Such a pleasure to have you on the show. I'm really excited to be talking with you today about data science, about fake news, and how data science can also impact the Fortune 500 companies. But before we get into all of this stuff, I'd like to know a bit about you. So can you tell me what you're known for in the data science community?
Sure. So I guess what I'm probably still best known for is the work I did with Galvanize. I was involved in some of the early days of creating some of those early master's programs, in particular the one at Galvanize and also with the early data science immersive programs through Galvanize. Last couple years I've been attacked working with Fortune 500 companies, helping them to use use their data at a large scale. And then very recently I actually switched over to Uber ATG helping. I'm heading up the data science teams here, helping to build self driving cars.
That's incredible. Mike. Congratulations on the new position.
Thank you.
And so today we're here to talk about a fake news detector app that you're building and the work that you just Talked about at TACT. What? Working with Fortune 500 companies to use their data to improve their businesses. Of course, we're going to have to have you back on the show after you've settled at Uber to talk about all the self driving stuff you'll be doing there.
Of course, we'll be happy to.
So let's talk about fake news. You're about to release an app that detects fake news. To my mind at least, fake news sounds like a fact checking challenge. How can data Science help us to detect fake news?
Yeah, that's a good question. Truth is a hard thing. Humans have been trying to capture truth, at least capture truth in writing for the last 10,000 years. And I think that it's maybe a little bit too ambitious for a first project to create a fake news detector that is just a magic knows the truth AI we sort of decided to approach it from a different angle. If you think about it, the gold standard for knowledge is direct observation, right? There's this sort of like seeing is believing. Though evidently video clips and images can be doctored. Seeing firsthand is maybe the best way that you can gain knowledge about something, at least if you see it enough. The problem is that that doesn't scale and most of human knowledge, in fact I would say the majority of human knowledge is really because of secondhand knowledge. And if, if you don't believe yourself, just think about some of the things, some of the things that, that you take for granted, scientific claims about, about things like, like the earth going around the sun and really ask yourself, why do I know that? And for the most part it is going to be secondhand knowledge.
Or the earth being round. Right?
Or the earth being round. Yeah, exactly. And there's a whole, whole, whole laundry list of claims like this that we take for granted that we do believe because, you know, and we take them as scientific claims. But if you really kick the tires, it's it, it's not because we've done the experiments ourself, it's because of credibility. And now that we have so many other ways of sharing information really easily, which is fantastic. It's fantastic for science, it's fantastic for data science, for sharing results, technical results and for sharing open source code. It's also subject to a lot of abuse when it comes to news and articles can prey on very natural human reactions and manipulate interpretation instead of just giving the facts. I remember in grad school there was this anecdote of, to sort of punctuate this point of how humans naturally react. And you can imagine you have two candidate ancestors. So one of them walks into this cave and sees something dark and a little bear shaped moving in the corner and stops and thinks, I'm going to really investigate this, I'm going to use scientific method, I'm going to get more information before I come to a conclusion about what this is. And the other one runs away. Which one do you think survived and ended up being your ancestor? And the answer is.
You want me to answer that?
Yeah. Which do you think you got so.
The one, there are two, there are two options to my mind. One, there is actually a bear there. So the one that survives is the one that runs away. But I think maybe the point of the thought experiment is that they saw their own shadow and the one that pursues the scientific method understands the world better, can shelter themselves, can feed themselves and their society better.
Your response is actually a lot less cynical than I think that. Than is suggested. What's suggested is that, you know, if we, if we think about this at large scale, the human ancestors or the Neanderthals, whatever it was that ended up just getting out of there and reacting maybe with less rational scrutiny when it came to things that were threats and things that they might be afraid of were probably the ones that survived on average, more. And then, you know, evolve to become. To become.
I would believe that in my eternal optimism.
And, and that's, that's a. And I believe this is, this is pretty well studied by psychologists. That's something that exists that humans do today. They, when certain fear and other kinds of emotional triggers are pulled, they stop being as rationally capable as they are usually day to day. And unfortunately, probably a lot of what we read is preying on that is preying on this ability that with the right words and with the right fear tactics, you can turn off the cognitive and the scrutiny that most knowledge sharing should have if you're really going to start believing stuff. And so the point of this app or these algorithms, it's a deep learning algorithm, really a suite of them, is to help detect that, help raise the flag of, hey, is this something that is trying to be journalism? Is this something that is trying to just tell us the facts and try to engage us on a, on a, on a cognitive level, engage us on a knowledge level? Or is this something that's maybe doing something else? Maybe, or at least maybe, you know, maybe it is journalism. But, but they're straying too far out of what's just the facts, and they're really straying into more, more of a editorial or opinion or sensationalism consp. And we also want to flag hate speech, of course.
And what about satire? So I will. There are a lot of publications around that. When I see the Onion, I know that it's going to be satire, but there are a whole bunch of media outlets out there which are similar to the Onion, and I haven't heard of them. And I read an article, I'm like, was that, is that the world being crazy or is this a joke?
Yeah. So as part of you know, we've been scraping data for, for over a year now and there are, yeah, there are several satire sites out there. The Onion is a really good examp and it's remarkable how it's not as obvious as you think to detect the difference between what is satire, what is the Onion, and what is maybe just an everyday description of the facts. And in fact, depending on political leaning, you might think of all sorts of different websites that are maybe a little bit biased against whichever part of the spectrum that you come from. But if you actually read the articles, and believe me, I've done this quite a bit over the last year, a lot of it's written as journalism. These subtle parts where you stray out of that journalism zone and you're maybe giving a little bit more opinion, maybe you're trying to influence more than share knowledge. That's something that really does take another level of sophistication in your algorithms.
So what will the experience of the app be like? What would the UI or UX be like?
Sure. So we're still in the process of beta testing. The idea is that you either go directly to the website or there's going to be some web browser extensions on Chrome, Safari and Firefox where you can actually just put the button in your web browser. You're reading an article, you say, is this really true? Or wondering if this is something that is credible, and then you can just press that button in your browser and Walt, who's what we're calling the AI, will give you a readout along those various dimensions.
Great. So along those dimensions of is it journalism, is it opinion, is it hate speech, editorial sensationalism, these types of things.
Exactly, exactly.
So I just want to delve a bit deeper into what's happening in the back end. You mentioned that there's some sort of deep learning at play. Could you just tell us a bit about what deep learning is and how it can be used to analyze text?
In this case, absolutely. So deep learning very generally, I think has come to mean any sort of neural net algorithm, largely or broadly construed, that has several different layers. And this is in just the past few years, gone from when I, when I first started. If I, if I had suggested to, to my boss in industry, hey, let's, let's. The deep learning algorithm, I would have been reprimanded and told to go back to academia. Now, if you're not using deep learning hours and not least considering them for task, then you're probably not doing your job. If you're someone in A position like mine. And so this has been a dramatic change because of attention, because of algorithmic technology improvements, and also because of the ability, in terms of hardware and an open source tooling that we can now create neural networks with several layers of processing, several layers of hidden neurons that will take in that raw data and take in maybe minimally prepared data, and then manipulate it and transform it and reshape it into a way that an algorithm can now tell the difference between a data point that is of one type, for instance, or a data point that is of another type of. So let me maybe be a little bit more concrete about this. Imagine you have an article which is essentially a list of words, a list of words in order. The first thing you want to do is when you're talking about a machine learning algorithm, you need to represent those words not as necessarily as strings of letters, but as numbers, and in particular as a vector or an ordered list of numbers, each of which sort of locates that word in a certain space that the algorithm can interpret. So you can think about that like the x axis and the Y axis, those would be a two dimensional vector. And so you need to, as a first step, process these words and put them into this vector shape, into this mathematical representation. And then you need an algorithm, a deep learning algorithm, typically to actually read those words represented mathematically. The best algorithms will now be able to do it in order and then answer questions about if I see this sequence of vector words in order, what does that mean? Is it a text? Is this text about opinion? Or does this text look more like examples you've seen that are more fact based?
That's awesome. That's a great explanation. So the basic idea is to take a text, turn it into its words in order. And because machine learning algorithms, such as neural nets, deep learning algorithms, are good at taking in numbers. You convert them into vectors, put them through, and then the neural network will output, after putting it through these layers, which may reshape, extract certain features, these types of things output, whether it thinks it's with some sort of probability, opinion or editorial or journalism. That type of stuff.
Yes, exactly. And then all the fun comes in with figuring out different ways that different kinds of neural nets that are going to read that text mathematically processed into vectors and figure out how to answer those questions. And we found that all sorts of different strategies work for different kinds of questions.
So where are people going to be able to get this app when it's.
Launched in the Chrome Web Extensions or Firefox Web Extensions? They should be able to do that. Or they can just go to the website, which is fakerfacts is the actual.
Name and we'll include that in the show notes as well. We'll jump right back into our interview with Mike after a short segment. Let's now dive into a segment called the Double Edged Sword of Impact with Frederica Shure, Research Engineer at Cloudera Fast Forward Labs. Hi Frederica, tell us what is the double edged sword of impact?
Hi Hugo. Data scientists and machine learning engineers build solutions that scale. We have the privilege to touch many people's lives with our work. With scale comes impact and with impact come thorny questions. Our work can be used for the good and the bad. That is the double edged sword of impact. While we may not be trained ethicists at Cloudera Fast Forward Labs, we believe that engineers too carry responsibility to think about how their work may be or abuse Today I would like to talk about the data ethics of recommender systems.
Great. So we all interact with recommender systems on a daily basis, whether it be Netflix telling me what to watch or Amazon suggesting products to me. Before we dive into the associated ethical challenges, can you tell me a bit about why recommender systems exist and what problems they Solve?
As of January 2018, according to Scrapeo, Amazon had over 500 million products on sale. The amount of physical and digital goods as well as news and entertainment media content available to us has increased greatly with the popularity of online retailers, websites and social media platforms. With greater variety comes the problem of discoverability. The sheer volume of distinct products makes it hard for us to find the ones we may like or want. Recommenders help us navigate a world full of variety, novelty and choices.
So what are potential ethical challenges associated with recommender systems?
Recommenders are powerful. They guide what products we buy and what content we consume. For example, an informed citizenry is a crucial component of a well functioning democracy. Society relies on the news media for information. Increasingly, recommendation systems guide the news we consume. So the design and deployment of recommended systems requires thought to ensure that they are actually helpful, not harmful, that they inform, not misinform, or even in the extreme, isolate us. For example, in 2010, Internet activist Eli Parise coined the term filter bubble to describe the personalized ecosystem of information delivered to a user by search and recommendation systems that filter the content through the lens of past behavior. A related concept is that of the echo chamber where people with similar viewpoints share and discuss informational ideas in a self reinforcing manner leading to the exclusion of other perspectives.
Okay, so why should we be concerned about filter bubbles and echo chambers Concepts.
Like filter bubbles and echo chambers highlight a growing concern that algorithms could contribute to a world in which people are exposed to less diverse viewpoints over time. In 2013, the EU High Level Group of Media Freedom and Pluralism noted that, I quote, increasing filtering mechanisms make it more likely for people to only get news on the subjects they're interested in and with the perspective they identify with. Recommender systems may create, contribute to, or even seal filter bubbles or ecochambers, especially new embedding based recommender systems that solve.
The cold start problem and what's the cold start Problem?
The cold start problem refers to the particular challenge of recommending new items. Traditionally, recommender systems make use of how others like you have interacted with items to determine which one you may like and want to see. With new items, there is no history of interactions and consequently they were hard to recommend. To establish user history, developers would expose users to new items randomly. Embedding based recommender systems take into account not just behavior but also aspects of the to be recommended item, for example the content of a book. By doing so, they solve the cold start problem and remove the possibility of a chance encounter. They can potentially further decrease the diversity in our news diet, for example.
So what are ways we can then combat the potentially harmful effects of personalized search and recommendation systems?
One way is to include exposure diversity as a design principle for these systems. That means the diversity of items in the set of recommended items becomes one of the aspects a recommender system learns to optimize. Exposure diversity may help foster our collective ability to digest diverse viewpoints for civil discourse, for example, and even reduce confirmation bias. The human tendency to search for, interpret, favor, and recall information in a way that confirms one's pre existing beliefs or hypotheses. To be fair to algorithms, individual choices about what content to consume, especially when it comes to news media, have always been subject to factors such as confirmation bias. What really excites me is the use of technology to reduce, not foster, such biases. Exposure diversity may serve as preference inconsistent recommendations that are known to trigger critical thinking patterns that can help overcome such bias.
Thanks Federica for that introduction to the ethical considerations surrounding recommender systems. We'll be back later in the episode to dive deeper into this. After that interlude, it's time to jump back into our chat with Mike Tamir. So I'd like to talk about some of the work you've done at takt, because I think TAKT does something incredibly interesting in that when people think about Data science, people think about tech companies such as Facebook and Airbnb and Google, and how they use a lot of data to make business decisions. But of course, there are lots of businesses that have been around since before the tech boom, since before the Internet existed, actually, that can be fundamentally changed using data science with all the data they have, and to influence business decisions in their companies. And your tax flagship company is Starbucks, for example. So I'm wondering what type of questions can data science answer for these companies?
Yeah, and that's very well put. So when you have a company like Starbucks, who's been around for even before the Internet, they do have a lot of data about their users. In particular, they have a lot of touch points with a lot of different users. In digital, you might call them users, these are customers, these are people that are walking in and buying cups of coffee and other stuff. If you're a company like Starbucks, what you want to do is change that level of engagement. And I think one of the things that maybe is a little bit different from what people think about when they think about the space of recommendations, they might think about the Netflix prize, which is now a 10 year old paradigm where you have a static set of items like movies and a set of users who have given you explicit feedback about those movies. I like it, I like them, I don't like them. 5 stars or 0 stars or somewhere in between. And then the job of recommendations is kind of to figure out how they would explicitly rate other items, other products, other movies. In practice, for a situation like Starbucks or some of the other clients that Takti works with, it's very different. And it's very different for a number of reasons. Number one, you usually don't get this explicit feedback. You usually don't get people star rating their cups of coffee or their sandwiches. What you get is what's called the implicit data. And that's data that they either bought it or they didn't buy it. And it could be very dangerous thinking about, well, if they didn't buy it, does that mean they don't like it, or does that mean that you haven't recommended it to them and they would really would like it. So that's one of the big changes between what is the traditional Netflix prize recommender paradigm and what you actually see in practice.
I just have a quick question with respect to this. With Netflix, it's clear to me how companies such as Netflix or digital companies track their users or customers. How do companies such as Starbucks, you don't have to speak specifically at a Starbucks, if that, you know, I don't want you to reveal any, any strategy necessarily, but how would a company that sells things track its customers?
Yeah, so, so, and this is pretty common across, you know, across most businesses, even businesses that, that didn't start out weren't born as digital businesses like, like Netflix or Go Google or Amazon is loyalty programs. If you go to your local grocer, you probably use a loyalty card. Most people do. At least CVS and Rite Aid have loyalty programs. Your airlines have loyalty programs. And so any of those companies are the kinds of companies that have a lot of data and have been tracking, maybe even before the pre Internet days, been tracking data about individual customers and what their patterns are. And now in an age where machine learning is fast becoming the standard, not the exception, they need to, and there's a lot of opportunity to really monetize that and not in a mischievous way, but in a way that's probably better for the customers too.
So what type of recommendations could Starbucks or CVS or whatever it may be make? Or what type of, of how could they improve the experience for the customer or the business for themselves using this type of data?
Right. So one thing that is pretty natural is just surfacing. What else would this person like? What else would be of interest to them? What else would they want to put in their shopping cart? If you're a grocer and you figure out what the kinds of, for instance, tastes are of a shopper, you might be able to recommend whole recipes or you might be able to recommend how to round out a diet because they tend to like these tastes and they ate this and this and this earlier in the week. And maybe that, maybe that means they'll also want to add this, maybe be able to complete a shopping cart or even detect when something's forgotten off of a shopping cart. All of those different things are well within the capabilities once you have this data through something like a loyalty program Starbucks is really interested in, much like frequent flyer programs and other loyalty programs having, developing these positive relationships that are pretty regular, pretty habitual, not necessarily in the bad way, but in the way that most of what we do is out of habit. And if you are used to going to get your cup of coffee at the corner Starbucks, say, and you go every day, then you're going to continue to go to make those choices every day. And so that's something else that when you move from maybe this artificial, say, historical Netflix prize paradigm to what happens in practice when you're starting to recommend things to customers, is Thinking about it not just in a static or stationary moment of time, but thinking about sequences of interactions over time. And so with Starbucks, you might come in once a week, every week, that we would generate their star games and their recommendations, and when you open up the Starbucks app, and we would put in and configure those interactions in a way that over time, algorithms, like reinforcement learning algorithms learn what will tend to develop those kinds of relationships.
Cool. So do you use reinforcement learning in particular for these types of questions?
So I cannot speak specifically about what we use for Starbucks.
Sure.
Of course, I can't say that this sort of paradigm is pretty ripe for reinforcement learning. And just for, for people who are not familiar with reinforcement learning, the whole idea of that genre of machine learning is that you aren't necessarily thinking about immediate rewards. So if I was just doing supervised learning, I might say which ads got most clicks right then and there. And then that's going to be my target function. That's what I'm going to train my algorithm to try to optimize for. Reinforcement learning is a little bit longer term in terms of scope. So go is or AlphaGo. And winning a game with an opponent falls a little bit more into that kind of genre where you might take a move on step three and you don't know, or at least the algorithm does not know if that's the winning move. They don't know if they won until the end of the game. And so the whole idea is to come up with different policies and to tune those policies and also to estimate if they're on the right track for winning or not. A function called the value function, and to make decisions and tweak the value function and the policy in order to get to that point. So you might think if you're doing data science for a loyalty program, maybe it's trying to get a customer to one of these frequent flyer type engagements or to be an everyday user of a certain form. And that's, that's what the value function is trying to target. And that's what this policy engine that the machine learning algorithm is using is going to keep trying to optimize towards, rather than just selling one more cup of coffee.
That was a great description of reinforcement learning. And that coupled with your great description of deep learning, I think leads me to ask you about deep reinforcement learning as a burgeoning field. And it's a slight detour from our discussion about Starbucks and Fortune 500. But what are your views on the current state of deep reinforcement learning, which is a combination of deep learning and reinforcement learning, right?
Yeah. And it's terribly popular in all the good senses. It's more and more a very, it's a very active area of research. It's also as well as self learning, self architecting, deep learning algorithms. And the whole idea there is, I think maybe the most popular version version of this is what's called Q learning. And so remember I mentioned what you want to do, say if you're the AlphaGo algorithm, is figure out am I on track now, do I have and am I making the right decisions now that keep me on a steady trajectory towards winning the game at the end of the game? And so what you do for that is you have this very deep and sophisticated neural network that's looking at all sorts of different things and going through all sorts of transformations and processing of that data from one time step to another time step. And if you are making a good estimate at time one or time five, then in the next time step, your estimate, your view of whether you're on track should be the same. Right. At every time step from your first time step to your last time step, your estimate of am I on track for winning the game, for instance, should be steady. At least that's the goal. That's what you want to get out of value function. So you use this value function Q and you have a deep learning net that's going to kind of estimate that Q. And then Q learning is really just a process of have a deep learning algorithm, it estimates Q. You look at the next step, it estimates Q again. And what it's trying to learn is not just if it's making good estimates, but also is it keeping things steady? Does Q stay the same over time? And that's one of the ways where you kind of merge this reinforcement learning looking for a value function function with deep learning, which is really, in the end, a way of. Because we have so much more data and so much more time, we can have so many more parameters, so many more hidden neurons, so many more layers in our neural net to really capture those different parameter values or the different nuances in the data.
And I think speaking to this idea of the amount of data we now have and the amount of computational power we now have, have is incredibly interesting, as we were saying before, for the tech space. But is this something that is really impacting the companies that you've been working with?
So certainly there is one thing that you definitely need, along with plenty of compute power infrastructure and good data scientists who can actually build the algorithms, is you need a lot of data. If you don't have a lot of data, then you're just not going to be able to support. You're not going to be able to give enough examples that for all those different degrees of freedom that your neural network can take for all those different parameter values, picking which one's the right one, the more you have, the more decisions that the algorithm has to make when you're training it, when you're configuring it, the more examples it needs in order to make those right decisions reliably again and again, especially on data it's never seen before. And so this is just to say that the bigger your neural network that the more data you need.
And so I'm aware you can't necessarily speak to what actual companies you've worked with attct, but what types of companies are we talking about and what type of impact do we see on the ground for consumers and civilians?
Yeah, so there's quite a bit. ATTCT in particular is not a very old company, but has the good fortune of being able to operate as a slightly less close to start startup because you can really gain a lot of traction and make a lot of quite measurable changes when you start doing these algorithms. Especially when you start doing these algorithms from a place where maybe you weren't using them or using something similar to them in the past. That first step is always, you always are pleasantly surprised by how much change in performance you can get get.
So let's drill down a bit without getting too technical, into the types of algorithms and technologies that you like and use. What's one of your. I hesitate to ask what's one of your favorite things, but what do you really enjoy getting into the weeds with?
I think there are two different neural net strategies, or I even hesitate to say if one of them is not, strictly speaking, neural nets is lstms, which is a kind of recurrent neural network, stands for lstm. Long Short Term Memory is a very, very popular one. There's some great articles out there that are referenced all the time. One of them is, I believe, Karpathy's blog where he says that the unreasonable effectiveness of LSTMs. And in a lot of ways that's right.
And Karpathi is now a Tesla. Right. For those that don't know, know Andrej Karpathy.
Yeah, yeah. And has an absolutely phenomenal blog. And so a recurrent neural network is a kind of deep learning network where it's sort of like an infinitely deep neural network in a way. That you have this recurrent unit that processes something in sequence, so like a time series or a string of words. And LSTMS is a specific kind of recurrent neural network that is, is able to keep track of things like when it needs to keep paying attention to what's been happening and when it can reset or maybe pay less attention, maybe not remember as much long, short term memory about what's been happening. And one text is actually one of the greatest, one of the best examples for why that can be effective. If you think about a sentence, the way our grammar works is we speak in terms of sentences and those are sort of like complete thoughts with a period at the end. And at the end of a period, while you might continue with another sentence that is relevant to the context, something has changed from one sentence to another. And LSTMs, because of the way that they're designed, are able to kind of reset in the right way, in the way that at least something similar to the way that we reset when we think about, oh, this is a new sentence, it's going to have a new subject, it's going to have a new verb. Now, LSTMS don't think in terms of subjects and verbs, but they are able to pick up those patterns of when's the right time to forget and when's the right time to remember.
If someone was just starting out to try to build some LSTMs or with deep learning or neural network architectures, how would you suggest they approach this?
Well, there is a wealth truly of different resources out there for getting started on your first lstm. Certainly one of the most popular ways right now is with Keras front end. And now it's typically a TensorFlow backend, although there's bindings for a lot of the other open source ones, including Theano, which is no longer under active development. DL4J has a backend to backend bindings for Keras, but Keras, if you're just getting started and you want to use Python, is a really easy way of building up your neural network on that quickly and playing around with it, getting your hands dirty. So you get to start getting, developing your intuitions about what works and what doesn't work.
And a bit of shameless self promotion. We actually have a deep learning course which teaches the fundamentals of Keras. And I'm not doing this only for shameless self promotion, but we have a course on Data Camp, but the course is taught by Dan Becker, who's now at Kaggle and Google, who introduced me to you originally Mike. So it comes full circle.
Circle, yeah, yeah, yeah. Dan and I had a chance to work closely back in Galvanize, actually. Yeah.
So were the LSTMs, are these the types of things you. If it's great for text data, is this the type of thing you thought about when developing the fake news detector?
Absolutely. And if the. So one of the algorithms that really has really changed the game as far as text. Text is concerned. Now, one way to think about it is if pre 2015, 2013 was. It was called natural language processing. Now you see the phrase natural language understanding, and I think that that kind of captures that there's been a dramatic shift in our ability to work with text. And it's because of what are called. Of these algorithms that embed words as vectors. The most popular one, or the most well known one, is called Word2Vec. That lets you represent a word word as a vector, as a sequence of numbers where the order matters. And then you can do mathematical operations on those sequences of numbers. LSTMs are one of the better ways of actually doing that. Not on the word level, but on the sentence level, on the sequence of words level. And it's not just doing something like taking the average, where if you take an average of two vectors, then order doesn't matter because you're summing things up. And I can add A to B or I can add B to A and the sum is the same. LSTMs are able to do it in order.
Yeah. And the example I always give of that is you want to remember order a lot of the time. I mean, bag of words only gets you so far. But the example I give is build bridges, not walls contains the same words as build walls, not bridges. Right. And the meaning example.
Yeah.
Is entirely good. Opposite.
Another good example of that is the difference between a question and an answer. So Jack and Jill are going up the hill. And are Jack and Jill going up the hill If. Especially if you don't help yourself to punctuation. Those are the same words, just in different orders. But in English in particular, the order matters a lot.
That's a great example. So what we're actually talking about there is not quite word to vec, but maybe even sentence to vec, sentence to vec.
And while that particular there is, to my knowledge, no sentence defect, there probably is, once again.
No, no, I don't think there is.
But LSTMS is a way of embedding sentences and turning vectors into sentences. What they can do is encode the different words in order. Look at them in that order, because they're good at remembering the order and keeping track of that and then outputting a vector representation that is sort of the, that entire sequence. And actually you tended to do that. They tend to work best when they read it forward to backwards and backwards forwards. And you call those bidirectional lcms. And the result of that is actually one double long vector that captures the meaning of the sentence in very effective ways. And then you can keep going. So now that you have, once you have a process that can turn vectors into lots of vectors in order into another vector that can captures what all those vectors in order mean, you can keep going. So you can turn words into sentences, sentences into a paragraph vector, paragraphs into an article vector, and then pretty soon you've got one sequence of numbers that represents what an entire piece of text, an entire body of text, like an article that you might find on the New York Times or on Fox News is saying. And you can start detecting the subtleties between those kinds of kinds of texts. Now there are all sorts of other kind of really brilliant architectural changes and improvements that you can make to that general framework. You can build in things that will tell you, well, which words matter most, which ones should you pay most attention to? These called attention mechanisms, which sentences are most important, but they really do. Once you start having this general technique, you can do things that honestly I didn't think we'd be able to do.
We'll jump right back into our interview with Mike. After a short segment. I'm back here with Frederica Schur to talk more about the ethical considerations surrounding recommender systems in our segment, the Double edged sword of Impact. Frederica, you mentioned confirmation bias, a human bias bias. Algorithms can be biased too. Does this apply to recommender systems?
Yes. Recommenders can encode biases and perpetuate unwanted or harmful behavior. For example, generally recommenders are evaluated with a focus on the system's overall effectiveness. Larger subgroups tend to dominate overall statistics. So the satisfaction of a dominant user group is weighted more heavily than that of minority groups, which can lead to inferior recommendations for select groups. This is a form of discrimination. What's more, with recommender systems we have to think about fair treatment of multiple stakeholders, producers of items and consumers of recommendations. And ideally, we'd achieve fair treatment for all.
And how can we combat recommender system bias?
Removing bias is hard because it forces us to tackle some hard questions. What is fairness? For example, earlier this month at a conference on fairness, accountability and transparency in socio technical systems, I learned about 21 different notions of fairness. And even if we could agree on one definition, how can we measure fairness quantitatively? How could we incorporate fairness into the loss function of an algorithm to ensure it learns to be accurate and fair? Fair but hard questions should not deter us from attempting to find solutions. Any improvement on the status quo is a win, even if it falls short of perfection. The 21 different notions of fairness offer us a catalogue of ideas that inform us about all the ways a system can be unfair. It can help reason through and detect unwanted system behavior. Ongoing and exciting work on quantitative measures of fairness and fair loss functions Engines promise Real Progress we recommend the use and development of tools to audit and test recommendation engines for bias, both during development and once deployed. Imagine unit tests, a testing framework for computer code, but for the fairness of algorithms. Carnegie Mellon, for example, developed Ad Fisher, a tool that runs automated experiments on personalized ad settings, to surface bias in how Google serves ads. To use one of their discoveries, gender Based Discrimination in Job Related ads I've.
Also heard about the ability to game the algorithm. Can you tell me what this means?
Rigomender systems can be designed or gamed for economic benefit rather than for best serving the needs, wants and interests of producers and consumers. For example, retailers and content producers selling their wares on aggregator websites or through social media platforms where they compete with others can game recommenders to recommend their products and their content over others. Shilling attacks, for example, are malicious attempts to change recommendations by inserting fake user profiles into user item matrices that are at the heart of many recommenders. Imagine lots of fake users with a strong liking of the attacker's product. It'll increase the ranking of the product in behavior based recommendation systems. Recently we've seen another kind of gaming content expressly designed to be favored by recommendation engines. I highly recommend James Brindle's blog post Something is Wrong on the Internet, a post about odd kids videos on YouTube with ever faster and more inexpensive forms of content generation, from cheap 3D animation to fully algorithmically generated content. Videos designed to be favored by recommender systems may crowd out real, often more appropriate or informative content, yet prove lucrative to their creative creators because of the high ranking by YouTube's recommender. Recommendation engines, of course, can and are gamed for ideological reasons too. For more on this topic, I recommend the work by Data and Society on media manipulation and disinformation in the online world.
And what more can we do?
While we may not all be developers of recommender systems, we certainly are users of recommenders and consumers. Consumers of recommendations. We can challenge ourselves to overcome confirmation bias and consciously adopt a more balanced news diet. We can read across partisan lines. We can use incognito browsers and search engines like DuckDuckGo that do not store personal information and do not trick users as we interact with content on media platforms. We can report fraud and abuse to companies to help reduce malicious activity on their site and products, and perhaps more importantly, contribute to public pressure in case companies fail to act on this information. Finally, we can take part in the public debate on what is and what isn't fair and what is and what isn't appropriate content. We should not shy away from difficult questions. We should share our perspectives and help elevate voices that may struggle to make themselves heard on what is plainly a complex issue. Solutions will require diverse perspectives, perspectives and collective effort.
Thanks Frederica, for that valuable introduction to the ethical considerations of modern recommender systems.
It's a pleasure. Speak Next time.
Time to get straight back into our chat with Mike. I'd like to step back a bit and go to more general data science projects. And I'd like to ask you what what data science projects have you been involved in in that you consider the most impactful on society or telling about society?
Sure. And definitely my mind immediately goes to this fake news project that we've been working on for the past year. So there are a lot of subtleties to processing text and being able to detect fake news. Remarkably, and this is something that I think is interesting about society in general is one of the categories that I mentioned. There's opinion and there's editorial and sensationalism, things like that. And there's also detecting hate speech. And one of the things that we found that you can do, you can make marginal improvements. I've gone through a lot of very sophisticated, very cutting edge algorithms that you can try in building a fake news detector like this in order to detect hate speech. You don't need that. You actually can use technology that existed five years ago become and get results that are almost as good and that sort of says something about hate speech that these that the kind of things that distinguish hate speech from non hate speeches is in a way cut and dry. Now you need to do other things because where you can get caught up is if you're quoting somebody. So if a real journalism article is trying to to is trying to report on something that is that is hateful that then it's you do need to put in a lot of work to make sure that you're not accidentally seeing the things that they're reporting on and tacking that as that hate as part of the journalism.
And what are the traditional approaches for identifying hate speech?
Pre Word2vec the way that you would, you would represent words is maybe one of the most baseline ways you would represent words is just by having every word gets its own number, right, or gets its own position in a list of numbers. So you might think, well, there's about a million words in the English vocabulary or at least that order of magnitude words in the English vocabulary. So you might think, oh, I've got a list of a million words. And the first word, we can order them alphabetically. The first number in that list corresponds to the word A and the second number of that list corresponds to the word an and so forth. And the problem is that when you represent all of those words in that very, very, very long list of numbers at the very, very high dimensional vector, you end up losing a lot of the information. You're sort of like spreading it out over too many dimensions, over too finely for the amount of data that you have. And a lot of ways of dealing with that. Some are just to drop some of the information, drop some of the words that you never really use that often, or to maybe count certain spots for more than one word with certain hashing tricks. But it turns out that what does happen when you use even those traditional ones where you're really not processing significance of that mathematical representation, you're really just counting how many occurrences of a different kind of word there are, just the presence of the, of the frequency of that count of that word, that, that hateful word in particular is enough to, to, to clearly indicate if it's, if it's hate speech or not.
Right. So this is essentially a bag of words model, right?
That's right, yeah.
And so we're just taking frequencies of, of words and then I presume some sort of. Do you, can you cluster a lot of the hate speech together in whatever space that's created there?
It's not as much clustering because clustering really has to do with relative position of all those other words which, you know, the non hate speech words, there might be a lot of them, there might be a few of them, but there are some very specific kinds of words that if they occur, then it's a very strong signal. And if they don't occur, then it's probably not going to capture it might be there are all sorts of subtleties, but it's probably not going to be classified, strictly speaking as hate speech. And at least in the examples that we've detected from the sites that we've been scraping. And you can still process that through all these very sophisticated Word2VEC and LSTMS and start to see more sophisticated patterns of the entire article. But it turns out that there are some very strong signals that are both necessary and sufficient.
So essentially the traditional approach, would it be bag of words followed by some sort of naive bayes or.
Yeah, bag of words followed by naive bayes or bag of words. Then you represent it as this long vector. There are all sorts of frequency patterns that you see about words. So the most used words get used way more than all the other words by many multiple times. So you have to kind of turn down the volume there. And you want to turn up the volume a little bit on the less frequent words. And so there's all sorts of ways that you can, you can process that. Often you'll hear tf, idf, term, frequency, inverse, document frequency. That is a nice strategy for manipulating those the way we numerically represent gross counts of words.
Yeah.
And then you can feed those into algorithms, although you still run into this high dimensionality problem. And that's what word two vec is. So, so much better in so many other examples.
So we've discussed a lot about modern data science and how the landscape of data science looks today. What does the future of data science look like to you, Mike?
Well, as you can tell from some of the things I've been focusing on, text is, I believe, going to continue to grow by least amounts. 2015 is now the olden days in terms of text. And in 2013 when some of these embedding algorithms came down, that's almost like a turning point in our ability as a profession to deal with text. And on almost a quarterly basis, new really awesome algorithms and techniques that I'm excited to try are coming out. And I have no doubt that that's going to continue to improve. So things like Google Translate and different fake news detector technologies, that sorts of things that, that we'll be able to counteract all of the different mischievous behaviors that bad actors can do if we focus our efforts and call to any students who are looking to become data scientists to learn machine learning or putting our best minds empowering that effort versus maybe focusing our best lines on, on which ads people are going to click on in text is a great opportunity. And then of course, very top of mind for me is now cars. And I guess we'll talk about that at another time.
That's very exciting. So I'd love to hear a Final call to action from you. And what I mean by that is you just mentioned people aspiring data scientists, people wanting to get into machine learning, learning, deep learning. What would you suggest they do as a path forward?
Yeah, so learning step one, I think, making sure that you have that mathematical literacy, making sure that you understand what's going on underneath your algorithms and that you're not just kind of throwing algorithms that you heard work on the wall. That makes a lot of difference, especially it makes the difference between. Between when you're really solving a problem that nobody else can solve and when you're trying to do or trying to recreate something that's been done before. And I would not hesitate. Sorry. I would not be hesitant about getting into this world of deep learning, of using all of these new algorithms. They're fast becoming the rule, as I mentioned earlier. And so the students that are intellectually curious about messing around with these algorithms and figuring out which ones work are the ones that really end up standing out when you, when you're breaking into the industry.
Fantastic. Mike, it's been such a pleasure having you on the show.
My pleasure. Thank you. Hugo.
Thanks for joining our conversation with Mike about data science, fake News, and Fortune 500 companies. We saw how Mike is leveraging state of the art deep learning architectures to build out a data science product that classifies text as news, editorial, satire, hate speech, and fake news, among others. We also saw what type of unique challenges Mike faced in his work at TACT, servicing the needs of Fortune 500 companies such as Starbucks. Make sure to check out our next episode, a conversation with Julia Silgi, a data scientist that stack Overflow. With a PhD in astrophysics and an abiotic love for Jane Austen, Julia and I will be taking a deep dive into data science, the written word, text mining and natural language processing. How can data science be leveraged to inform business decisions around the written word? And what can it tell us about society? Join us next week to find out. I'm your host, Hugo Bown Anderson. You can follow me on Twitter hugobown and datacampattacamp. You can find all our episodes and show notes at data camp cap.com community podcast.
More from Richie

#359 My Best Friend is AI with Valerie Tiberius, Professor of Philosophy at University of Minnesota

How AI Agents Will Work While You Sleep | Ruslan Salakhutdinov, Professor at Carnegie Mellon

#358 How AI Agents Will Work While You Sleep | Ruslan Salakhutdinov, Professor at Carnegie Mellon







