Month: May 2021

  • What’s the best platform to promote a fullpage chatbot

    I don’t have a website, however I have the tools necessary to create a full page chatbot that can collect emails. What would be the best social media platform to use to promote the bots. Reddit for the content marketing, or Pinterest for the more visual approach?

    submitted by /u/WilliamsBunker
    [link] [comments]

  • How we made an award-winning Google Assistant App

    TRT World News Quiz Logo
    News Quiz for TRT World have combined the human voice with intelligent voice assistant technology to create the best user experience.

    News Quiz from TRT World has recently won awards in two separate categories in Google Actions Challenge. Our quiz tests user knowledge about the current events with new questions every day and exist both on Google Home and Amazon Alexa.

    It took a lot of iterations to get there. We were faced with unexpected challenges as developing an app for a voice interface requires a different mindset. This article will detail our process of getting to the end product and the lessons we learned. As one of the first comers to the voice assistant platform in the media industry, we’d like to share some of the practices we developed along the way.

    Conception of the idea

    After receiving our first Google Home around the end of 2016, we started thinking of ideas unique to this new platform. Our first step was to investigate what our competitors were doing. Interestingly, we only saw 30 apps on the platforms excluding the news briefs. One category that caught our interest was the quizzes. As an age-old concept, quizzes managed to stay relevant and it seemed one of the simplest and most engaging experiences we can provide on the voice-activated devices.

    Another advantage of the quiz was the ability it would give us to repackage and distribute the same content in other domains like smart TVs, website, mobile apps. The quiz could also be used to redirect the users to the relevant content on our site. This thinking had a great influence in the way we planned for our news quiz as we had to make the interactions smooth enough to keep the user retention high.

    Throughout this planning process, we tested all of the apps made by news organizations for Google Home and Amazon Alexa. Our takeaway was that at the start, almost none of the apps made my media companies seemed to grasp the new type of interactions required for the voice-assisted platforms. We will go into the detail of our analysis in another article.

    Designing the MVP

    For the MVP, we decided to go with a fixed number of questions. The number of questions in the quizzes made for voice-assisted platforms ranged from 4 to 10. However, voice is unique in terms of the user attention and we decided to keep it short and decided to keep the question number at 3.

    Since our focus was to make this app a weekly news quiz, we had to make sure that the architecture would support the weekly updates to the product. The other design consideration we had was the support for linking each question to a news story.

    In order to quickly get a prototype out, we used API.ai or also known as Dialogflow. The system allowed us to map certain words to certain actions, but there was a problem. We wanted the quiz to progress as the user answers. So we had to call a webhook each time the user started the quiz and responded as to what the user sent to the server. The interface API.AI provided helped us to match what user said to the corresponding action in the webhook.

    Trending Bot Articles:

    1. Chatbot Trends Report 2021

    2. 4 DO’s and 3 DON’Ts for Training a Chatbot NLP Model

    3. Concierge Bot: Handle Multiple Chatbots from One Chat Screen

    4. An expert system: Conversational AI Vs Chatbots

    Technical and UX Challenges

    The initial challenge

    While building the prototype, we encountered a problem regarding the answers. As the questions were to change every week and the answers could be in any form, we quickly realized having the user utter every answer would be very difficult. There were cases where we couldn’t pronounce our own answers correctly or where we did pronounce correctly, Google Assistant wouldn’t understand and throw an error.

    The solution we came up for this problem was having the user say the number of the answer instead of the text. However, we made sure that if the user says both the number and the answer itself, we’d still pick it up.

    Before launching the product, we compiled a list of speakers with various accents to understand whether our number approach is ideal. One immediate problem we noticed was the user onboarding. Without a proper onboarding, most of the users did not speak the number of the answer and got confused. Also, some people had a problem saying two and three. So we mapped “do” to two and “tree” to three. Thankfully, Google Assistant allowed us to see every word user said in order to invoke an action. This showed us where the users had the most problem. For instance, we realized that some users were asking the question to be repeated or just generally asking for help. Upon seeing this, we quickly implemented these functions.

    News Quiz v2.0

    Although we were one of the first-comers to the voice assistant space in our industry, our app lacked a special ingredient that would make the users talk to their friends about it. One thing that most apps failed to do was change the default voice of the device and make it feel more human. Some even argued that the TTS is better as the users’ expectations are lowered due to the robotic voice. We decided to change that entirely and make the app completely human narrated.

    Another critical thing we implemented to help the game feel more playful was custom responses to right or wrong answers to a question. We wrote and did the voice-over for over 40 responses. The response would come randomly from the pool. These responses took almost all the users who tested it by surprise. If you got the question wrong, our app would say congratulations in a jovial tone only to be followed by that’s wrong. In fact, one of the user testing participants wanted to take the quiz again so that she’d hear the other responses we had. This style later on was awarded by Google as the best persona in apps on Google Assistant among thousands of applicants.

    Despite our foray into the weekly human narrated quiz, we believed we could do better and increased the frequency from weekly to daily. This forced us to rethink our ad-hoc approach to publishing new questions every week to Google Home and Alexa. We sat down with the product manager of our CMS in order to automate the process as the actions require a specific file format for the audio files and the text should match the audio exactly for it to be on Google Assistant. We managed to build a quiz publishing platform inside our CMS. This platform allowed us to publish the quiz with full editorial workflow integrated and the audio and image option presented. The quiz can now be sent to the website, smart TVs, Google Home, Amazon Alexa and the other platforms our quiz is present through our CMS.

    On the content side, we faced a backlash from the content team due the lack of resources on their side. Producing questions and voicing them over on a daily basis caused heated discussions. Firstly, they proposed preparing a batch of questions beforehand and do the voiceover daily. This approach worked for a while, but then we noticed the change in voice-over person every day didn’t sound right as the intro, outro and responses had our original entertaining voice while the questions were voiced by someone else. We changed tactics and got all the questions rewritten to fit our persona and goal of having a proper news quiz. All the questions had been voiced-over at once to be uploaded on a daily basis.

    Don’t forget to give us your 👏 !


    How we made an award-winning Google Assistant App was originally published in Chatbots Life on Medium, where people are continuing the conversation by highlighting and responding to this story.

  • Primary reasons — Why every Lawyer needs a Virtual Assistant?

    Primary reasons — Why every Lawyer needs a Virtual Assistant?

    Virtual Assistants — Next-gen solution to mitigate administrative challenges

    Law firms and lawyers managing business in a digitally tech-savvy environment, need to consciously capitalize on emerging automation technologies to better manage their workflow and client experience. Typically, lawyers spend about 40% of their time in scheduling meetings, searching for relevant documents and managing volumes of case history databases. These challenges become exacerbated when handling multiple clients and varying client matters, leading to reduced focus on core business activities. A high level of administrative support needed for the seamless functioning of law firms as well as solo practitioners has made Virtual Assistants a perfect solution for the legal industry. In addition to increased staffing costs, difficulties in acquiring skilled talent and communication channels have left little room for law firms and lawyers to find a cost-effective way to stay ahead of competition. In such challenging scenarios, integrating virtual assistants is the most valuable proposition to gain operational efficiencies and provide best-in-class customer experience.

    Virtual assistants facilitate lawyers to perform routine legal tasks more quickly, accurately, and in a cost-effective way. In the absence of relevant security solutions in place, accessing legal documents as well as file sharing have become increasingly challenging for lawyers especially outside the office network, considering privacy and compliance concerns. Virtual assistants built with text and voice capabilities play an influential role in boosting the productivity of lawyers, by providing secure access to client documents from anywhere and on-the-go, substantially improving mobility. These solutions offer attorneys instant and efficient administrative support by providing access to the right information at the right time and allowing them to focus more on critical work. Virtual assistants also provide additional insights to lawyers in formulating their cases and establishing a strong relationship between the lawyer and the client.

    To summarize, Virtual assistants have a huge potential to radically change the legal industry by supporting lawyers in delivering better and personalized legal services to their clients. Intelligent virtual assistants are disrupting the traditional legal practice and are aiding lawyers in streamlining operations and helping them remain competitive by minimizing their time spent on monotonous tasks.

    Challenges Faced by Lawyers

    challenges faced by lawyers without KLoBot

    Domain-specific Virtual Assistants — “Simplifying Matters” for Lawyers

    While intelligent assistants in smart devices (smart speakers, smartphones) are gaining popularity and gradually being adopted by lawyers, they still need to deal with a variety of challenges and associated risks. These devices integrated with AI assistants pose numerous Security & Privacy issues for lawyers. The key functionality of these devices is to capture and store all transcripts and data on external servers or cloud, resulting in Loss of privacy as well as Loss of control for lawyers. These smart devices are not built with enterprise-grade security and have weak authentication, making them easier to hack allowing access to client data and other sensitive legal information.

    Lawyers using smart devices for voice search queries must deal with issues of general-purpose assistants, which are typically non-domain specific, resulting in poor user experience. These voice assistants in smart devices often skip interpreting legal-domain specific words that restrict the search results to be more precise.

    Trending Bot Articles:

    1. Chatbot Trends Report 2021

    2. 4 DO’s and 3 DON’Ts for Training a Chatbot NLP Model

    3. Concierge Bot: Handle Multiple Chatbots from One Chat Screen

    4. An expert system: Conversational AI Vs Chatbots

    Major Reasons Why Lawyers Should Integrate KLoBot’s Virtual Assistants

    More Secure and Compliant

    Privacy and data security are major concerns for lawyers, especially with reference to confidential data of clients. KLoBot’s virtual assistant is compliant with data privacy regulations, offering secure transcription services and feature-rich admin console, which strengthen the document security as well as secure access for lawyers. KLoBot’s virtual assistant understands the legal industry contextually, reducing complexity in accessing the relevant information securely as well as enabling on-the-go agility. The enhanced mobility also helps while sharing documents with other colleagues across different channels.

    Automated meeting coordination

    KLoBot’s virtual assistant supports lawyers in managing their day to day activities, including scheduling appointments, setting reminders, and other basic tasks. Coordinating calendars and organizing meetings are time-consuming as well as cumbersome for lawyers as they are often reliant on other junior professionals for scheduling important meetings. In addition, KLoBot’s virtual assistant provides automated meeting coordination, resulting in reduced scheduling time and efficiently organized calendars.

    Handling customer interactions

    KLoBot’s intelligent virtual assistant can handle client interactions by “humanizing” communication through text and voice. The solution can connect with clients, personalizing their experience and provide reminders related to case hearings, meetings, and other case details. Lawyers handle repeated client queries and provide legal advice for the same issues to different clients, which hampers their productivity. KLoBot’s virtual assistant handles FAQs and manages client queries, which reduce the workload of lawyers. KLoBot’s “People Search” helps prospective clients to quickly and efficiently check the lawyer’s or law firm’s expertise. This enables faster access to right the lawyer with the necessary capability and expertise as well as helps in generating targeted leads.

    Legal Search

    KLoBot’s virtual assistant is helping lawyers to search for important documents, contracts, and other materials of specific cases on-the-go using text as well as voice.

    The intelligent virtual assistant can sort through legal documents from voluminous records, allowing lawyers to retrieve old case information. For Instance, KLoBot’s solution “netDocShare” a cloud-based document management service, provides lawyers with access to NetDocuments content on SharePoint by using KLoBot’s text and voice-enabled virtual assistant.

    Enabling Smart Offices

    Other than FAQs, every client has unique legal requirements that need to be addressed. KLoBot’s virtual assistant is enabling smart law firms that provide lawyers ease of usability, better control over resources, streamlining their practice and promptly assisting clients in resolving their legal issues. KLoBot’s virtual assistant ensures the security of confidential files even in external environments, which makes sharing documents significantly easier. By supporting lawyers in efficiently carrying out basic tasks, KLoBot’s virtual assistant augments operational capabilities resulting in improved productivity.

    Benefits of using KLoBot Virtual Assistant

    Legal chatbot software KLoBot

    KLoBot-enabled chatbots empower law firms to keep their day-to-day operations on track, resulting in efficient remote working. KLoBot, leveraging the power of voice and text, offers organizational intelligence to its users, and assists law firms in delivering economically valuable work output. For deploying chatbots within minutes and effectively serving remote workers check out this customizable platform. For more details visit https://www.klobot.ai/

    Don’t forget to give us your 👏 !


    Primary reasons — Why every Lawyer needs a Virtual Assistant? was originally published in Chatbots Life on Medium, where people are continuing the conversation by highlighting and responding to this story.

  • Chatbots As Medical Assistants In COVID-19 Pandemic

    All healthcare workers are on the frontline during the covid pandemic. They face an overwhelming workload and risk their health and wellbeing every day. Moreover, doctors and nurses still have patients with other diseases and must take care of them on a high level nevertheless. So, healthcare providers are looking for the opportunity to turn from classical consultation treatment and look for new solutions. One of these solutions is a chatbot.

    Chatbots — the future of medicine?

    According to Juniper Research, the healthcare system will become a major user of chatbots in areas such as patient diagnosis, patient information, and voice-capable digital assistants to support healthcare providers. The increased introduction of chatbots will free up medical staff time and save countries’ healthcare systems around $3.7 billion by 2023, and the number of chatbot interactions will reach 2.8 billion per year by this time.

    Why the chatbots?

    Chatbots are a piece of software that conducts conversation on a determined topic automatically.

    Their benefits are:

    • simplified communication with users of the medical information system,
    • saved time and financial resources for medical personnel,
    • convenient for users and improved patient satisfaction,
    • fast respond to FAQ-type queries (contact details, directions, opening hours, and service details),
    • 24/7 availability.

    Of course, one should understand that chatbots can’t replace doctors. Their task is to be the first point of contact before any human involvement is needed. Thus, chatbots reduce the number of time doctors spend on initial diagnosis, general questions, appointment scheduling.

    Trending Bot Articles:

    1. Chatbot Trends Report 2021

    2. 4 DO’s and 3 DON’Ts for Training a Chatbot NLP Model

    3. Concierge Bot: Handle Multiple Chatbots from One Chat Screen

    4. An expert system: Conversational AI Vs Chatbots

    Intellexer Chatbot helps during the COVID-19 pandemic

    Intellexer COVID-19 chatbot powered by AI gives solutions that help both patients and healthcare providers. The chatbot’s name is DIVOC and it offers to talk about questions about one’s health. It allows chatting in a natural language about COVID-19 and healthcare-related topics.

    The COVID-bot uses a proprietary linguistic platform Intellexer to analyze entered data. Intellexer chatbot does not wait for predefined queries, it extracts the main focus of the question, and gives the corresponding answer.

    Intellexer chatbot does not wait for predefined queries, it extracts the main focus of the question, and gives the corresponding answer.

    If the chatbot sees the mentions of some potential COVID-19 symptoms, it offers to take a COVID-symptoms test — “COVID Checklist”. Its content is built according to clinical protocols and best practices. The test lets you know if you need an appointment with your healthcare provider and gives information about your risks of getting infected or possible complications. The chatbot does not collect the data of the test, so all provided information is strictly confidential.

    If the chatbot sees the mentions of some potential COVID-19 symptoms, it offers to take a COVID-symptoms test — “COVID Checklist”.

    Moreover, Intellexer COVID-19 chatbot helps to stay informed about the risks of COVID-19 infection in the USA. “USA Risk Assessment” provides up-to-date information for every state from the official websites.

    Chatbots share the latest information, such as:

    · total COVID-19 cases;

    · daily growth;

    · cases per 100,000 people;

    · case fatality rate.

    Intellexer COVID-19 chatbot helps to stay informed about the risks of COVID-19 infection in the USA.

    Chatbot DIVOC is also equipped with a news tracker on COVID-19, lockdown and other related issues. News tracker is based on Intellexer NewsMonitoring.

    This chatbot can be customized to any disease and have much bigger functionality like automatic appointment scheduling with physicians, remote consultations, video-controlled treatment, etc. If you think of improving your service, business, a website with an AI chatbot, Intellexer is a good place to start.

    Summary

    We are concerned about the challenge that the world community is facing right now, and consider it our duty to help fight the COVID-19 pandemic. Intellexer COVID chatbot is an accessible health service that includes a symptoms checklist, USA risks assessment, and answers to any questions about the coronavirus.

    We hope that this chatbot will be useful to everyone but soon will become just a part of the history together with covid pandemic and lockdowns.

    Stay healthy!

    Don’t forget to give us your 👏 !


    Chatbots As Medical Assistants In COVID-19 Pandemic was originally published in Chatbots Life on Medium, where people are continuing the conversation by highlighting and responding to this story.

  • Revolutionize Healthcare With AI-Driven Chatbots!

    Today we are on the cusp of a revolution in the healthcare industry. As Covid-19 grips the world and communities become increasingly affected, healthcare communications have been pushed to its limits. With the majority of healthcare workers dedicating their time to Covid- vulnerable patients, there is an acute shortage of medical professionals.

    According to the estimates of the World Health Organization (WHO), we need over 4 million health professionals in addition to the current workforce worldwide, to be able to offer quality healthcare to the entire population.

    Today, healthcare consumers are taking a more assertive role in their healthcare journey, expecting immediate high-quality, and accurate information that is smart and cost-effective.

    AI-driven healthcare chatbots by ‘Botspice’ can provide digital health solutions to tackle the global health challenges we face today, providing information, care, and support at the click of a button. With a combination of NLP and machine learning technologies, chatbots can understand a patient’s intent and answer questions effectively without frequently following up. As such, they can manage the overwhelming demand for healthcare.

    Information through Conversations

    Conversational AI tools make conversations with patients more personalized, thus increasing overall customer satisfaction and improving the quality of service provided. Healthcare chatbots can help in providing authentic and reliable information and be a patient’s guide through conversations.

    Trending Bot Articles:

    1. Chatbot Trends Report 2021

    2. 4 DO’s and 3 DON’Ts for Training a Chatbot NLP Model

    3. Concierge Bot: Handle Multiple Chatbots from One Chat Screen

    4. An expert system: Conversational AI Vs Chatbots

    Round the clock availability

    The pandemic has opened our eyes to the need of the hour: To create a better healthcare ecosystem that provides ready access to healthcare information. And that could be achieved by healthcare bots that provide round-the-clock availability. Patients can get answers to queries round the clock without any downtime: discussing symptoms, accessing existing prescriptions, or even getting answers to follow-up questions, all delivered with ease.

    Booking appointments

    Booking appointments with doctors get easier with chatbots streamlining patient workflow, directing them based on expressed symptoms. Tasks like confirmation of appointments, rescheduling, termination can be done by bots speeding up transactional patient queries.

    Resolving FAQ’s

    Many of the patients have a lot of queries about Covid-19 these questions are mostly repetitive like:

    ● What are the symptoms?

    ● Is it air-borne?

    ● What are the vaccines available?

    Many of these questions have standardized answers. The availability of answers to FAQs and guidelines about the virus can be accessible to patients via a conversational interface. They no longer have to waste time scrolling through websites only to be swarmed with information from a wide range of sources, some of which may not be reliable.

    Screening on a massive scale

    Healthcare chatbots can screen patients on a massive scale via analytic insights. A healthcare bot can simultaneously have conversations with thousands of people anytime, freeing up healthcare professionals to concentrate on providing first-hand access to care. No matter the magnitude of questions, healthcare bots can provide answers immediately.

    Future of Conversational Healthcare Chatbots beyond the pandemic.

    Conversational AI Chatbot is not expected to replace a doctor in any way. However, they can be relied upon to improve care and drive down costs across the healthcare industry.

    The Global Healthcare Chatbots Market is expected to rise from its initial estimated value of USD 122.0 million in 2018 to an estimated value of USD 542.3 Million by 2026 registering a CAGR of 20.5% in the forecast period of 2019–2026.

    By design, Healthcare Bot will continuously learn, adapt and improve, further optimizing the user experience with each subsequent interaction thus revolutionizing patient engagement.

    Don’t forget to give us your 👏 !


    Revolutionize Healthcare With AI-Driven Chatbots! was originally published in Chatbots Life on Medium, where people are continuing the conversation by highlighting and responding to this story.

  • Certified Workshops

    Get Certified in Conversational UX & NLP/NLU Development from Top Industry Experts

    Certified Conversational Design / NLP Workshop

    We have both Live and On-Demand Certified Workshops

    Upcoming Live Workshops

    • Dates: May 25–27, 2021
    • Taught By: Conversational Design Institute, CoCoHub, BotCopy & Google
    • Project: Design, Develop & Launch an FAQ bot that can interact with a database.

    Conversational UX Certified Workshop

    Dialogflow/NLP Certified Workshop

    Agenda

    • Overview, what makes a great enterprise chatbot?
    • Intro to NLU frameworks (Google Dialogflow) and Botcopy
    • Establishing an ROI / data-driven mindset before you build!

    Build Your Enterprise Chatbot

    • Intro to Dialogflow/Botcopy stack: Response types & components
    • Writing & Design: Fine-tuning your bot’s style to boost engagement
    • Coding and Webhooks: Backend fulfillment in Dialogflow
    • Conversational Websites: Window triggers, ref parameters and more
    • Authentication: Passing JWTs for personalized & secure tasks
    • Data collection Deep Dive

    On-Demand Certified Workshops

    Save 25% by using discount code: 2021

    Save 25% Use Discount Code: 2021


    Certified Workshops was originally published in Chatbots Life on Medium, where people are continuing the conversation by highlighting and responding to this story.

  • Only 2 Weeks to Go!

    We only have a few seats available!

    Chatbot Conference Online

    The Chatbot Conference Online is now less than 2 weeks away!

    In this year’s event, we are featuring the Top Industry speakers in Conversational AI.

    So what’s new?

    We’ve taken our certified workshops to the next level!

    We partnered up with the best teachers, so our workshops are now taught by Google, CoCoHub, Conversational Design Institute and BotCopy!

    If you haven’t registered, this is the perfect time to sign up and save your spot.

    3 Day Agenda

    • On-Demand: Available Now
    • May 25th: Chatbot Conference Online. Network with the top industry speakers and leaders.
    • May 26th: Certified Conversational UX Workshop with Conversational Design Institute & CoCoHub
    • May 27th: Certified Dialogflow NLP Workshop with Google & Botcopy.

    Looking forward to seeing you at the Conference.

    See What Past Attendees are Saying

    3 Reasons you need to Attend:

    1. Save Time: Discover how Enterprises are using Chatbots, AI and Voice from Top Industry Experts. Attending our events puts you in touch with Top Experts in AI, Bots , Voice and saves you a lot of time and trial and error.
    2. Certified Workshops taught by Google, Conversational Design Institute, CoCoHub & Botcopy: Learn how to Design and Develop Chatbots and Voice Apps in our full day workshops. Workshops like this typically cost between $2,000 — $5,000. Workshop details below.
    3. Networking & Virtual Happy Hour: We have digitized the networking experience! In our upcoming event, you will be able to virtually network with speakers, attendees, vendors and exchange contact information with the click of a button.

    More Reviews


    Only 2 Weeks to Go! was originally published in Chatbots Life on Medium, where people are continuing the conversation by highlighting and responding to this story.

  • How to code a cryptocurrency trading bot to buy Bitcoin when Musk Tweets about it

    Why would someone do this?

    The answer is a simple one — the Techno King of Tesla has a history of influencing crypto markets whenever he tweets about them, to the point where a movement in the market is almost expected when he picks up is phone and starts expressing his opinions on the blockchain technology over twitter.

    By creating a crypto trading bot that buys bitcoin every time the Tesla boss tweets about it you can rest assured that you are going to catch a VIP seat on the rocket that will slingshot right past the moon and make its way directly to Mars, where Elon spends most of the summer months due to its cold weather and dry climate.

    Will this actually work?

    The quick answer is “not sure” — as no one tested this strategy before. The longer answer is probably — as long as we’re talking about Bitcoin. Statistically speaking, regardless of the time you bought your bitcoin, you are most likely in profit (excluding the recent all time high around the time of writing).

    So if nothing else, you will at least spice up your BTC HODLing strategy with a bit of help from Elon. This article won’t go into a detailed analysis to show whether this strategy actually works or not. This article is about building it for fun, but it does have serve as a powerful reminder of just how many resources we have at our disposal and that you can build just about any crypto trading bot you can think of.

    You will also be able to see and use the code so you can test it or improve it.

    How to set your bitcoin bot up

    What this article is focused on is the actual technical building of the bitcoin trading bot, and how to set it up in a safe test environment, so let’s get to it.

    You will need the following resources:

    • A MetaTrader5 account
    • A demo account with XBTFX so you can safely test your strategy
    • A Twitter Dev Account
    • A Tweepy API account

    Setting up MetaTrader5 and XBTFX

    As the name suggests, MT5 is a platform which supports multiple brokers along with detailed technical analysis — the main reason to start your crypto bot building journey with MT5 is due to it’s easy integration with Python and out-of-the-box support for a demo or virtual account so that you can test in a safe demo environment.

    There are detailed instructions on how to install and configure MetaTrader5 as well as the XBTFX crypto broker in the previous post that covers how to build a crypto trading bot in python, so we’ll only briefly going over these steps in this article. If you need more information on how to do it, as well as why those two platforms were chosen, please refer back to the linked article above.

    Start by downloading and installing MetaTrader5 and create an account on their platform. The next thing you need is a broker that you can place your trades with — I recommend XBTFX as they offer the most crypto-pairs of all brokers that work with the MT5 terminal. Register with XBTFX and create a demo account.

    You can now connect to your demo account via MT5 by navigating over to File > Open an Account and searching for XBTFX. If you have registered using the referral link above you will need to select “Connect to Existing Account”, otherwise proceed to create a new account.

    Trending Bot Articles:

    1. Chatbot Trends Report 2021

    2. 4 DO’s and 3 DON’Ts for Training a Chatbot NLP Model

    3. Concierge Bot: Handle Multiple Chatbots from One Chat Screen

    4. An expert system: Conversational AI Vs Chatbots

    Apply for a Dev Account with Twitter

    Before you can use Twitter’s API or the Tweepy Python module, you need a developer account with Twitter. Luckily the application process is quick and easy, and you will probably be accepted as long as you describe why you need the access to the Twitter API.

    Nativate over to twitter’s dev platform and click Apply in the top right corner of the navigation menu.

    On the next page click Apply for a Developer account and you will be prompted to sign in with your twitter account.

    Follow the registration process and explain your intentions with the API

    After you have completed all the necessary information, it may take anywhere between a couple of hours to a couple of days before you can get access to the platform. In my experience it was only a few hours.

    Once your dev account is ready navigate over to the Projects & Apps tab open Project 1, if this is not available go ahead and create one. Under your project go to Keys and Tokens and generate the following (make sure to save them or you will need to regenerate the keys!):

    Defining bot parameters

    • The bot will open a buy position on bitcoin every time Elon mentions bitcoin in his tweet
    • Take profit is set to 10% and stop loss to 5%
    • The bitcoin bot will not place another trade if there is already an active trade (can be adjusted)

    Coding for your bitcoin trading bot

    Preliminary set-up

    First off you need to import the MetaTrader5 and Tweepy modules using PyPi.

    pip install tweepy
    pip install MetaTrader5
    pip install — upgrade MetaTrader5

    The next step is to import these modules along with a few others into your Python interpreter.

    #Twitter Scraper module
    import tweepy
    from tweepy import OAuthHandler
    #dates module
    from datetime import datetime, date
    from itertools import count
    import timeimport re
    #trading terminal
    import MetaTrader5 as mt5

    We now need to store the secret keys and tokens that you generated using the Twitter Dev platform in order to use them with Tweepy.

    # Store Twitter credentials from dev account
    consumer_key = “CONSUMER_KEY”
    consumer_secret = “CONSUMER_SECRET”
    access_key = “API_KEY”
    access_secret = “API_SECRET”
    # Pass twitter credentials to tweepy via its OAuthHandler
    auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
    auth.set_access_token(access_key, access_secret)
    api = tweepy.API(auth)

    In the last part of the preliminary set up you need to connect to the MT5 terminal, store your account’s equity and define the trading instrument that we will be working with — in this case it’s Bitcoin. We will also create a short list of keywords to query Elon’s last tweet against.

    # connect to the trade account without specifying a password and a server
    mt5.initialize()
    # account number in the top left corner of the MT5 terminal window
    # the terminal database password is applied if connection data is set to be remembered
    account_number = 555
    authorized = mt5.login(account_number)
    if authorized:
    print(f’connected to account #{account_number}’)
    else:
    print(f’failed to connect at account #{account_number}, error code: {mt5.last_error()}’)
    # store the equity of your account
    account_info = mt5.account_info()
    if account_info is None:
    raise RuntimeError(‘Could not load the account equity level.’)
    else:
    equity = float(account_info[10])

    Now let’s define the coin that we’ll be placing trades on and the keywords that we’ll be searching for.

    #crypto sign and keywords
    CRYPTO = ‘BTCUSD’
    keywords = [‘Bitcoin’, ‘bitcoin’, ‘BITCOIN’, ‘btc’, ‘BTC’]

    Getting Elon’s latest tweet

    With all the preliminary stuff out of the way, it’s time to focus on the cool parts of this bot. Let’s start by getting Elon’s last tweet with Tweepy as shown below in the get_elons_tweet() function.

    During testing, emojis and other invalid characters would break the script, so each tweet is re formatted to only contain alpha-numeric characters.

    #Get Technoking’s latest tweet
    def get_elons_tweet():
    “””Get Elon’s last tweet by user ID — retry until tweepy returns tweet”””
    tweets = tweepy.Cursor(api.user_timeline,id=”44196397", since=date.today(), tweet_mode=’extended’).items(1)
    #remove all invalid characters
    elons_last_tweet = [re.sub(‘[^A-Za-z0–9]+’, ‘ ‘, tweet.full_text) for tweet in tweets]
    #re-try until it returns a value — tweepy API fails to return the tweet sometimes
    while not elons_last_tweet:
    tweets = tweepy.Cursor(api.user_timeline,id=”44196397", since=date.today(), tweet_mode=’extended’).items(1)
    elons_last_tweet = [re.sub(‘[^A-Za-z0–9]+’, ‘ ‘, tweet.full_text) for tweet in tweets]
    return elons_last_tweet[0]

    Logic check and preparing the trading request

    Now that we have Elon’s last tweet we can start preparing the logic and the trading request in function trade(). For more information regarding the format of the trade request, have a look at the MT 5 documentation.

    what_musk_said contains the last tweet and the logic will check whether any of the keywords defined in our keywords variable above are present in Elon’s tweet. If that is true, the bitcoin trading bot will place a buy order on bitcoin with instant execution. In case it’s false it will simply return to us the tweet.

    #buy bitcoin
    def trade():
    “””Check if Musk mentioned bitcoin and open a buy position if so”””
    what_musk_said = get_elons_tweet()
    # used to check if a position has already been placed
    positions = mt5.positions_get(symbol=CRYPTO)
    orders = mt5.orders_get(symbol=CRYPTO)
    symbol_info = mt5.symbol_info(CRYPTO)
    price = mt5.symbol_info_tick(CRYPTO).bid
    # perform logic check
    if any(keyword in what_musk_said for keyword in keywords):
    print(f’the madlad said it — buying some!’)
    # prepare the trade request
    if not mt5.initialize():
    raise RuntimeError(f’MT5 initialize() failed with error code {mt5.last_error()}’)
    # check that there are no open positions or orders
    if len(positions) == 0 and len(orders) < 1:
    if symbol_info is None:
    print(f’{CRYPTO} not found, can not call order_check()’)
    mt5.shutdown()
    # if the symbol is unavailable in MarketWatch, add it
    if not symbol_info.visible:
    print(f’{CRYPTO} is not visible, trying to switch on’)
    if not mt5.symbol_select(CRYPTO, True):
    print(‘symbol_select({}}) failed, exit’, CRYPTO)
    #this represents 5% Equity. Minimum order is 0.01 BTC. Increase equity share if retcode = 10014
    lot = float(round(((equity / 5) / price), 2))
    # define stop loss and take profit
    sl = price — (price * 5) / 100
    tp = price + (price * 10) / 100
    request = {
    ‘action’: mt5.TRADE_ACTION_DEAL,
    ‘symbol’: CRYPTO,
    ‘volume’: lot,
    ‘type’: mt5.ORDER_TYPE_BUY,
    ‘price’: price,
    ‘sl’: sl,
    ‘tp’: tp,
    ‘magic’: 66,
    ‘comment’: ‘python-buy’,
    ‘type_time’: mt5.ORDER_TIME_GTC,
    ‘type_filling’: mt5.ORDER_FILLING_IOC,
    }
    # send a trading request
    result = mt5.order_send(request)
    # check the execution result
    print(f’1. order_send(): by {CRYPTO} {lot} lots at {price}’)
    if result.retcode != mt5.TRADE_RETCODE_DONE:
    print(f’2. order_send failed, retcode={result.retcode}’)
    #print the order result — anything else than retcode=10009 is an error in the trading request.
    print(f’2. order_send done, {result}’)
    print(f’ opened position with POSITION_TICKET={result.order}’)
    else:
    print(f’BUY signal detected, but {CRYPTO} has {len(positions)} active trade’)
    else:
    print(f’He did not say it, he said: {what_musk_said}’)

    Putting it all together

    We now need to decide how often we should be iterating through the code below. By default, it pull and analyse Elon’s last tweet once every 5 seconds, but this can be adjusted in the time.sleep function below.

    #execute code every 5 seconds
    if __name__ == ‘__main__’:
    print(‘Press Ctrl-C / Ctrl-Q to stop.’)
    for i in count():
    trade()
    print(f’Iteration {i}’)
    time.sleep(5)

    Additional Resources:

    It was a fun project work on and I hope that you enjoyed this article. Please follow me if you enjoyed this article. For more crypto bot projects, check out my blog for more cryptocurrency trading bots in Python

    Don’t forget to give us your 👏 !


    How to code a cryptocurrency trading bot to buy Bitcoin when Musk Tweets about it was originally published in Chatbots Life on Medium, where people are continuing the conversation by highlighting and responding to this story.

  • How to build your own chatbot

    With a touch of Huggingface and Cloud run

    The use of chatbots has increased drastically in recent years and almost all major companies use some form of chatbot in their business, and it is not hard to understand why this is the case. Since BERT was delivered by google, the performance of NLP models has seen impressive progress. The latest state-of-the-art model GPT-3 has a breathtaking 175 billion parameters in its model, which makes interactions with the model almost indistinguishable from a human being.

    So in this article I would like to demonstrate how to build your own chatbot and have it wrapped as an API service.

    The project is divided into two parts. First we need to have a trained chat model that can make predictions, then a server that can handle requests to our model.

    There are several models available that can be used to build a chatbot. We will use blenderbot, created by facebook’s research team in 2019. The model is an open ended chatbot, which means that it is not created to handle certain given actions in the backend, which is the more common use case for businesses. Instead this model is only focused on imitating human communication.

    We will use a small implementation of the model with no additional fine tuning. However this is heavily desirable for a more sophisticated chatbot.

    We start by creating a file that we will use to download the model. To help us, we use Huggingface, a python library that provides various high quality NLP models.

    Then we create a python class that we will use to handle the logic from converting our english text to create our word tokens that we will use as inputs for our model.

    We then build a Flask API with two endpoints, one for checking if the service is working and one for integrating with our chatbot.

    Finally we generate a Dockerfile that when being built will pre-download the chat model so that when we send request to our API it can make quick responses, instead of reloading the model every single time. This will drastically improve the performance of our bot. To host the API we use gunicorn as our wsgi server with no additional web server framework.

    From our local machine to production

    The steps from running your model on your local machine to have it running in production can see daunting. However several services have done this step a lot easier in recent years.

    We are going to work with google cloud run for this project. Googles “serverless” platform, I don’t like the word serverless since of course there has to be a server running the code, but it is serverless in the sense that it doesn’t save any client data from session to another session and that we get whatever server is available at any given time.

    Trending Bot Articles:

    1. Chatbot Trends Report 2021

    2. 4 DO’s and 3 DON’Ts for Training a Chatbot NLP Model

    3. Concierge Bot: Handle Multiple Chatbots from One Chat Screen

    4. An expert system: Conversational AI Vs Chatbots

    In order to run our code on google cloud run we have to provide it with our docker image that we will create with the build command. Make sure to execute the command in the same folder where the Dockerfile is located.

    docker build -t <docker_name> .

    Next we need to push our image to google container registry. This could be done directly in the web GUI or as we will do here, via the gcloud SDK.

    gcloud builds submit --tag gcr.io/<PROJECT-ID>/<docker_name>

    Now, we are almost ready to go. The last step is to create our cloud run service, which again could be done with either the GUI or the cloud SDK. Here we specify that we want two cpu with 4G ram in each container running our docker image.

    cloudrun_example$ gcloud run deploy chatbot 
    --image=gcr.io/$PROJECT_ID/chatbot:latest
    --platform=managed
    --concurrency=1
    --set-env-vars=MKL_NUM_THREADS=2,OMP_NUM_THREADS=2,NUMEXPR_NUM_THREADS=2
    --cpu=2
    --memory=4G
    --allow-unauthenticated

    If you set it up correctly you will receive an URL with the address to your service. Like the one below for our chatbot.

    https://chatbot-5vvmts3sdf-lz.a.run.app/

    Now, let’s try sending a CURL request to our chatbot.

    Hi, how are you?

    curl --location --request POST 'https://chatbot-5vvmts3sdf-lz.a.run.app/query' 
    -H 'Content-Type: application/json' 
    --data-raw '{"lastConversations": ["Hi, how are you?"]}'

    {“botResponse”: “i’m good. just got back from a long day at work. how are you?”}

    There we go!

    We managed to create a high performance general purpose chatbot with an associated API.

    Full code can be found here:

    Resources:

    https://huggingface.co/transformers/model_doc/blenderbot.html

    A state-of-the-art open source chatbot

    Don’t forget to give us your 👏 !


    How to build your own chatbot was originally published in Chatbots Life on Medium, where people are continuing the conversation by highlighting and responding to this story.