Rude or offensive comments can run rampant in today's online communication landscape; however with the power of machine learning, we can start to combat this.
This blog post will show how to classify text as obscene or toxic on the client-side using a pre-trained TensorFlow model and TensorFlow.js. We'll then apply this classification to messages sent in a chat room using Twilio Programmable Chat.
Google provides a number of pre-trained TensorFlow models which we can use in our applications. One of those models was trained on a labeled dataset of Wikipedia comments available on Kaggle. Google has a live demo of the pre-trained TensorFlow.js toxicity model on which you can test phrases.
Before reading ahead you can also see 10 Things You Need to Know before Getting Started with TensorFlow on the Twilio blog.
1. Before you get started, you'll first need to clone the …
Though I took two college electives related to artificial intelligence (AI) and have used quite a few machine learning (ML) libraries, I am by no means a ML developer. However, like many developers nowadays, I am extremely curious about ML and TensorFlow, a popular library brought up in many conversations surrounding ML. What exactly is it?
What is TensorFlow?
TensorFlow is an open source library released by Google Brain (now Google AI) in 2015 to make it easier for developers to build, train, and generally work with deep learning models and data to make different types of predictions. You can solve tasks like image classification, natural language processing, generate music as in this Twilio post, and more.
I began playing around with TensorFlow a few weeks ago and though it's been fun and I've learned a lot, here are ten things I wish I'd known before using it.
There's a lot of conflicting information on best practices when building bots, so we set out to make your chatbot-building life easier in our new comprehensive guide to Intelligent Chatbots.
That massive resource provides developers, builders, and DOers with an intelligent bot guide, covering bot use cases, descriptions of how bots work, instructions on building and deploying bots, intelligent bot best practices, and more.
In this post, I’ll summarize some of that guide and tell you what you need to consider to build better bots.
1. Pick your use case and type of chatbots
The purpose of most bots is often to automate tasks, save time, or just to generally make life easier – just like with most other tools and automation. So first, you’ll need to consider your bot’s use case.
Various industries use chatbots in different ways. Here’s a list …
This step-by-step tutorial will go over how to build a Slackbot using Twilio Autopilot and Twilio Functions, saving the user's answers to a MongoDB Atlas database. If you haven't seen part one of this two-part blog series yet, check it out here and make sure you have your Autopilot Slackbot and Function set up before continuing below.
Let's receive and save the data the user gave us. On the MongoDB Cloud Atlas homepage, make a free account. Once logged in, make a new cluster.
Under Cloud Provider & Region, select a cloud provider. For this post, I decided to use Azure. Then select a region (one with a free tier may be preferable.)
For Cluster Tier, you can then select "M0 Sandbox"--your account will only be able to have one cluster at this level. Now you can scroll to the bottom and click the green …
There are many things you can do from iOS but sometimes, for example, you may need to make a web request to fetch information. With Twilio Functions you can focus on writing the code that matters without having to maintain a server. This tutorial will show you how to set up a Twilio Function that returns a Pokemon joke or two and then call that Function from an iOS application.
Before you get started, you'll need
- a Twilio account to create a Twilio Function
- Xcode installed to make a rudimentary iOS app to call the Function
Make a Twilio Function
The Twilio Function in this tutorial will return a simple hard-coded Pikachu joke. To make that Function, from your Functions page, click the red "+" button to make a new Function.
If this is your first Function, you'll click …
1. Go to the Autopilot Console and click "Create a new Assistant."
2. Give it a name and click "Create". In this case, I wanted to make a Slackbot to handle event sponsorships so I put "Dev-conf-bot".
To make your Autopilot Assistant a Slackbot, you must do three things.
1. Make a new public Slack channel. First click the plus button next to Channels on the left-hand side bar of your Slack client.
Then, name the channel. Make sure it is public as shown below, and click "Create Channel".2. Create a new outgoing webhook integration in Slack to send a POST request containing message details to a URL …
For event-organizers and business-owners, providing quick 24/7 customer service can be tough. I help run a hackathon for women and non-binary people and our Facebook page has to respond to so many questions, like when the event is happening, if we're looking for new organizing team members, when hacker applications open, and more! Answering these can get repetitive and tedious--if only there was a way for us developers to automate the process!
Never fear, this step-by-step tutorial will show you how to build an intelligent Facebook Messenger bot with Twilio Autopilot, Functions, and SendGrid in Node.js. If the Autopilot assistant gets stuck and the user wants to speak to a human, the assistant will hand off the conversation to the business, connecting them with a human via Email for a seamless customer experience.
Before you get started, you will need to have a Facebook Page for your brand or …
I like music and coding and one way to make music with code is by predicting words and generating a new song. You can do this with Markov models, as introduced in this last Twilio blog post. Now let's learn how to train a model on a .txt file to generate a song and then generate another song or text via Twilio SMS with server-side Swift and Perfect.
To code along with this post you should have the following:
- A Twilio account to buy a phone number
- ngrok, a tool for putting the app running on your local machine on the web
First, make a new Single View project in Xcode and run
pod init on the command line in the directory where your Xcode project exists to create a Podfile in order to install the Markov Model library via CocoaPods, as further …
Perfect is a versatile open source server-side Swift framework and toolset that makes it easy for developers to quickly create server- and client-side apps. Let's see how easy it is to send SMS with Twilio and Perfect.
To follow along with this post we'll need
Install Perfect using the Swift Package Manager. Create a new project directory called
PerfectSMS and then on the command line in your project directory, run
swift package init --type executable swift package generate-xcodeproj
This generates a package with the same name as your current directory.
- Package.swift at the top-level of your project contains your package description and your package’s dependencies.
- Sources/ is home to all your Swift source files, including main.swift, which will be the entry point for your project. It currently prints hello, world to the Terminal.
- Tests/ will contain unit tests you …
Did you know PageRank, the algorithm Google uses to determine the order of search results, is a type of Markov chain? I first learned about Markov chains and Markov models in my Speech Synthesis and Recognition elective and was amazed at how they are used in speech recognition, music generation, and modeling sequential data to predict the outcome of a basketball game (or almost any competition.)
What are Markov Chains and Markov Models?
The most basic type of Markov model is a Markov chain, a model whose next state is only selected based on its current state. Markov chains are used in genetics, finance, economics, game theory, and other fields. An example of one would be predicting tomorrow's weather by looking only at today's weather, not yesterday's.
Wikipedia defines a Markov model like so:
In probability theory, a Markov model is a stochastic model used to model randomly changing …