Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Beam me up Botti

Beam me up Botti

Hendrik Ebbers

September 17, 2021
Tweet

More Decks by Hendrik Ebbers

Other Decks in Technology

Transcript

  1. Beam me up, Botti!

    View full-size slide

  2. This is a very very very long gag
    @hendrikEbbers
    Hendrik Ebbers
    • Karakun Co-Founder


    • Founder of JUG Dortmund


    • JSR EG member


    • JavaOne Rockstar, Java Champion


    • AdoptOpenJDK / Adoptium TSC member

    View full-size slide

  3. This is a very very very long gag
    @hendrikEbbers
    Hendrik Ebbers
    • I (and collect) boardgames


    • I STARWARS


    • I Hardrock


    • I Dogs

    View full-size slide

  4. This is a very very very long gag
    @hendrikEbbers
    Content
    • About (chat)bots


    • How to code a chatbot


    • About user data


    • Rise of the machines


    • How to survive the robot uprising
    Fundamentals of 'Natural
    Language Processing'

    View full-size slide

  5. About (Chat)Bots

    View full-size slide

  6. This is a very very very long gag
    • Today many companies run chatbots as
    messaging apps or simply via SMS


    • Maybe you do not want to buy your new
    shoes by using a chatbot...


    • ... but maybe you want to contact your
    insurance with the help of a bot
    @hendrikEbbers
    About Chatbots
    Botti

    View full-size slide

  7. This is a very very very long gag
    @hendrikEbbers
    About Chatbots
    • Chatbots can bet very helpful when


    • you want to break down a complexe
    work
    fl
    ow to an enduser


    • the given functionality is not joyful
    for the user (like shopping would be
    for example)

    View full-size slide

  8. This is a very very very long gag
    @hendrikEbbers
    About Chatbots
    • The quality and functionality between

    chatbots differs a lot


    • Most simple chatbots are just based

    on work
    fl
    ow with multiple choice


    • In general we can differ between

    rule based and AI based bots

    View full-size slide

  9. This is a very very very long gag
    @hendrikEbbers
    Rule Based Chatbots
    "Hello, how can I help you?"
    "I want to rent a car"
    "I want to report an accident"
    "I want to search for a shop"
    start end

    View full-size slide

  10. This is a very very very long gag
    • Already several chatbot products on the market


    • "Simple to con
    fi
    gure"


    • "Ready for your enterprise"
    @hendrikEbbers
    Chatbots in Enterprise

    View full-size slide

  11. This is a very very very long gag
    • Simple visual editors to de
    fi
    ne
    fl
    ows


    @hendrikEbbers
    Chatbots in Enterprise

    View full-size slide

  12. This is a very very very long gag
    @hendrikEbbers
    Chatbots in Enterprise
    Let's start a
    conversation...

    View full-size slide

  13. This is a very very very long gag
    @hendrikEbbers
    Chatbots in Enterprise
    Let's start a
    conversation...
    Looks like the bot is busy
    doing important stuff


    It took around 20 sec for
    the first answer

    View full-size slide

  14. This is a very very very long gag
    @hendrikEbbers
    Chatbots in Enterprise
    Let's start a
    conversation...
    Looks like the bot is busy
    doing important stuff


    It took around 20 sec for
    the first answer
    Let's start with an
    easy answer

    View full-size slide

  15. This is a very very very long gag
    @hendrikEbbers
    Chatbots in Enterprise
    ... I'm with stupid
    I'm here to talk. Let's
    start a conversation

    View full-size slide

  16. This is a very very very long gag
    @hendrikEbbers
    Chatbots in Enterprise
    ... I'm with stupid
    I'm here to talk. Let's
    start a conversation
    ... with the meaningful message '5'

    View full-size slide

  17. This is a very very very long gag
    @hendrikEbbers
    Chatbots in Enterprise
    REALLY???

    View full-size slide

  18. This is a very very very long gag
    @hendrikEbbers
    Chatbots in Enterprise
    REALLY???
    Let's try it again
    ...And Again
    ...And Again

    View full-size slide

  19. This is a very very very long gag
    @hendrikEbbers
    Chatbots in Enterprise
    REALLY???
    Let's try it again
    ...And Again
    ...And Again
    ... I really waited several
    seconds after each message
    but nothing happened

    View full-size slide

  20. This is a very very very long gag
    @hendrikEbbers
    Chatbots in Enterprise

    View full-size slide

  21. This is a very very very long gag
    @hendrikEbbers
    Chatbots in Enterprise
    HA! Looks like I
    found a bug .

    View full-size slide

  22. This is a very very very long gag
    @hendrikEbbers
    Chatbots in Enterprise
    ... ok, now I really
    need some strong
    coffee

    View full-size slide

  23. This is a very very very long gag
    @hendrikEbbers
    Chatbots in Enterprise

    View full-size slide

  24. This is a very very very long gag
    @hendrikEbbers
    Best Practices for Chat-Bots
    • Make sure your chatbot has (a voice and) a
    character


    • Use buttons that eases navigation and
    improve UX (when possible)


    • Provide users an easy exit

    View full-size slide

  25. This is a very very very long gag
    @hendrikEbbers
    Best Practices for Chat-Bots
    • Make sure your chatbot has (a voice and) a
    character


    • Use buttons that eases navigation and
    improve UX (when possible) Great example
    for a dynamic
    selection list
    Much better than
    typing numbers
    https://research.aimultiple.com/chatbot-best-practices/

    View full-size slide

  26. This is a very very very long gag
    @hendrikEbbers
    Best Practices for Chat-Bots
    • Use creative fallback responses



    • Always have a button that directs user to a human


    • Work with experts and test, test, test
    Is your friend
    java.util.Random

    View full-size slide

  27. Let's build a ChatBot

    View full-size slide

  28. This is a very very very long gag
    @hendrikEbbers
    Let's build a Chatbot
    • Several services / apps / tools provide interfaces for
    custom chatbots




    • Next to this chatbots can be created as stand alone
    software / custom integration in software

    View full-size slide

  29. This is a very very very long gag
    @hendrikEbbers
    Chatbots in Discord
    Hendrik
    Hallo ist hier jemand?
    Bot
    Hallo neuer User 'Hendrik'. Ich bin der Bot dieses Forums
    und begrüße alle neuen Benutzer :)

    View full-size slide

  30. This is a very very very long gag
    @hendrikEbbers
    Let's build a Chatbot
    • In general each chatbot is a simple observer


    • If you understand the observer / listener pattern you
    can create a chatbot


    • Let's have a look at a sample
    I can hear
    you

    View full-size slide

  31. This is a very very very long gag
    @hendrikEbbers
    Let's build a Chatbot
    final API api = API.create(CONNECTION_TOKEN);


    final Channel channel = api.getChannel("general");


    channel.observe(EventType.NEW_MESSAGE, event -> {


    channel.sendMessage("Hi " + event.getAuthor());


    });


    Connection to service
    (like Discord)
    Listen & react to new
    messages

    View full-size slide

  32. This is a very very very long gag
    @hendrikEbbers
    Let's build a Chatbot
    final API api = API.create(CONNECTION_TOKEN);


    final Channel channel = api.getChannel("random");


    Executors.newSingleThreadExecutor().execute(() -> {


    while(true) {


    sleepTillMorning();


    var m = "Today I try to take over the world!";


    channel.sendMessage(message);


    }


    });


    Interact directly with
    Service

    View full-size slide

  33. This is a very very very long gag
    @hendrikEbbers
    Let's build a Chatbot
    channel.observe(EventType.NEW_MESSAGE, event -> {


    if(event.getMessage().startsWith("!help")) {


    channel.sendMessage(HELP_TEXT);


    } else if(event.getMessage().startsWith("!hi")) {


    channel.sendMessage("Hi " + event.getAuthor());


    } else if(event.getMessage().startsWith("!dice6")) {


    channel.sendMessage(randomInt(6));


    }


    });


    This is how most Discord
    Bots work

    View full-size slide

  34. This is a very very very long gag
    @hendrikEbbers
    Let's build a Chatbot

    View full-size slide

  35. This is a very very very long gag
    @hendrikEbbers
    Register your Chatbot in Discord
    • Discord (and others) provides an easy way to register
    bots to servers (BUILD-A-BOT)
    https://discordpy.readthedocs.io/en/stable/discord.html

    View full-size slide

  36. Rise of the machines

    View full-size slide

  37. This is a very very very long gag
    @hendrikEbbers
    Collecting Data
    • A (chat)bot needs data to
    react on events and
    interact with users


    • The more data a bot has
    the better it can react

    View full-size slide

  38. This is a very very very long gag
    @hendrikEbbers
    Collecting Data
    • Even with the given trivial
    examples a lot of data
    can be collected ...


    • ... and stored ...


    • ... and used to
    fi
    nd out
    more information about
    the users

    View full-size slide

  39. This is a very very very long gag
    @hendrikEbbers
    Let's build a Chatbot
    channel.observe(EventType.USER_ENTERS_CHANNEL, event -> {


    DbService.storeLogin(LocalDateTime.now(), event.getUser());


    });


    channel.observe(EventType.USER_LEAVE_CHANNEL, event -> {


    DbService.storeLogout(LocalDateTime.now(), event.getUser());


    });


    View full-size slide

  40. This is a very very very long gag
    @hendrikEbbers
    Let's build a Chatbot
    channel.observe(EventType.NEW_MESSAGE, event -> {


    DbService.storeMessage(LocalDateTime.now(),


    event.getUser(),


    event.getMessage());


    });


    View full-size slide

  41. This is a very very very long gag
    @hendrikEbbers
    Collecting Data
    • Now we can easily
    estimate / calculate when
    a user is normally online /
    at home


    • Now we can calculate
    relations between users


    • Now we can extract
    interests of users

    View full-size slide

  42. This is a very very very long gag
    @hendrikEbbers
    Spread the word
    • People that are much smarter than
    me can no extract individual &
    private information


    • ... and create an individual user
    pro
    fi
    le


    • ... and let the bot interact in a
    speci
    fi
    c way based on pro
    fi
    le
    More diabolic

    View full-size slide

  43. This is a very very very long gag
    @hendrikEbbers
    Spread the word
    • To create really good fake news a
    rule based bot is not enough!


    • For world domination we need an AI
    based bot


    View full-size slide

  44. This is a very very very long gag
    @hendrikEbbers
    Intelligent ChatBots
    • More and more ChatBots after based
    on AI


    • AI allows more complexe work
    fl
    ows


    • Until now we looked at simple rule

    based chatbots


    • Let's imagine what a AI based bot can
    do...

    View full-size slide

  45. This is a very very very long gag
    @hendrikEbbers
    Intelligent ChatBotISM

    View full-size slide

  46. This is a very very very long gag
    @hendrikEbbers
    Intelligent ChatBotISM

    View full-size slide

  47. This is a very very very long gag
    @hendrikEbbers
    Intelligent ChatBotISM

    View full-size slide

  48. This is a very very very long gag
    @hendrikEbbers
    Neural Network Models
    • Several companies and communities worked on AI
    models
    values that a neural
    network tries to
    optimize during
    training

    View full-size slide

  49. This is a very very very long gag
    @hendrikEbbers
    Neural Network Models
    • OpenAI is a non pro
    fi
    t research organisation for AI

    View full-size slide

  50. This is a very very very long gag
    @hendrikEbbers
    Neural Network Models
    "Generative Pre-trained Transformer (GPT) are a series of deep
    learning based language models built by the OpenAI team. These
    models are known for producing human-like text in numerous
    situations."
    https://research.aimultiple.com/gpt/

    View full-size slide

  51. This is a very very very long gag
    @hendrikEbbers
    Neural Network Models
    • OpenAI is mostly
    fi
    nanced by Elon Musk and Microsoft

    View full-size slide

  52. This is a very very very long gag
    @hendrikEbbers
    Neural Network Models
    • Generative Pre-trained Transformer 3 (GPT-3) from
    OpenAI is the most complexe model that is known
    today
    Section shown on
    previous slides
    GPT-3
    trained on 40GB
    of text

    View full-size slide

  53. This is a very very very long gag
    @hendrikEbbers
    GPT-3 Model
    • 75 billions of parameters (T-NLG-Modell from
    Microsoft has 17 billions)


    • The model worked so well that the creators
    themselves became afraid of it.

    View full-size slide

  54. This is a very very very long gag
    @hendrikEbbers
    Headline
    "The latest GPT model, GPT-3, is closed source as Microsoft
    has licensed its exclusive use. This was widely criticized in the
    tech community as OpenAI with its mission to bene
    fi
    t all
    humanity, has chosen to work exclusively for the bene
    fi
    t of
    one of the largest tech companies."
    https://research.aimultiple.com/gpt/

    View full-size slide

  55. This is a very very very long gag
    @hendrikEbbers
    GPT Samples
    https://app.inferkit.com/demo
    https://gpt3demo.com

    View full-size slide

  56. This is a very very very long gag
    @hendrikEbbers
    GPT-3 Sample
    two GPT-3 AIs having a conversation
    https://youtu.be/jz78fSnBG0s

    View full-size slide

  57. This is a very very very long gag
    @hendrikEbbers
    AI based Chatsbots
    Natural Language
    Processing
    Bot Logic
    Machine Learning Information Sources Actions
    Message

    View full-size slide

  58. This is a very very very long gag
    @hendrikEbbers
    Machine Learning
    • Machine learning (ML) is the generic term
    for computer algorithms that can improve
    automatically through experience and by
    the use of data.


    Art
    Deep Learning
    Machine Learning
    Arti
    fi
    cial Intelligence

    View full-size slide

  59. This is a very very very long gag
    • Deep learning de
    fi
    nes machine learning methods that are
    based on arti
    fi
    cial neural networks


    • Uses multiple layers to progressively extract higher-level
    features from the raw input
    @hendrikEbbers
    Deep Learning

    View full-size slide

  60. This is a very very very long gag
    @hendrikEbbers
    TensorFlow
    • TensorFlow is a free and open-source library for
    machine learning and arti
    fi
    cial intelligence.


    • TensorFlow provides APIs for Python, C, C++, Go,
    Java, JavaScript and Swift


    • Third-party packages are available for C#,
    Haskell, Julia, MATLAB, R, Scala, Rust, OCaml,
    and Crystal
    Developed by
    Google
    https://github.com/tensorflow/tensorflow

    View full-size slide

  61. This is a very very very long gag
    @hendrikEbbers
    Natural Language Processing
    • Natural language processing (NLP) is a sub
    fi
    eld of
    linguistics, computer science, and arti
    fi
    cial intelligence


    • Research on how natural language can be processed


    • Can be used for text & speech Now I can
    even shout
    at you !

    View full-size slide

  62. This is a very very very long gag
    @hendrikEbbers
    Natural Language Processing
    • Example use cases for NLP:


    • Google Translate


    • Siri / Alexa


    • Autocorrection in word
    processing tools


    • The Star Trek computer (voice)

    View full-size slide

  63. This is a very very very long gag
    @hendrikEbbers
    Hibu Platform
    • Platform based on enterprise search, language
    analytics and arti
    fi
    cial intelligence


    • Rule-based, statistical and neural AI tools are
    available for the implementation of customer
    requirements

    View full-size slide

  64. This is a very very very long gag
    @hendrikEbbers
    Hibu Platform
    Namenserkennung Themenerkennung Textklassifikation Informationsextraktion
    Sentimentanalyse Annotation Recommender-Systeme Ähnlichkeitsbestimmung
    Intelligente Suche Kombination von Komponenten
    Tabellenextraktion
    OCR

    View full-size slide

  65. This is a very very very long gag
    @hendrikEbbers
    Turing Test
    • Originally called the imitation game
    by Alan Turing in 1950


    • Test a machine to exhibit intelligent
    behaviour equivalent to a human.


    • If a human does not notice that a chat
    partner is a machine the test is
    passed

    View full-size slide

  66. This is a very very very long gag
    @hendrikEbbers
    Turing Test
    • In 2014, chat-bot named Eugene Goostman passed the
    Turing test when it received votes from 33% of the
    judges who believed that the chat-bot was human.


    • The chat-bot mimicked the personality of a 13-year-old
    boy.


    • Thoughts regarding GPT-3: https://bit.ly/2XjRvY6

    View full-size slide

  67. How to survive the
    ROBOT UPRISING

    View full-size slide

  68. This is a very very very long gag
    @hendrikEbbers
    The Robot Uprising
    • Arti
    fi
    cial intelligence becomes more
    mainstream every day


    • Already today we need to think

    about AI and ethics


    Racist robots - How do we eliminate AI bias?

    View full-size slide

  69. This is a very very very long gag
    @hendrikEbbers
    The Robot Uprising
    • We need rules and list about ethic
    assessment for AIs


    • The European Union already

    published guides and list
    https://bit.ly/3hDIUqt

    View full-size slide

  70. This is a very very very long gag
    @hendrikEbbers
    The Robot Uprising
    • We as developers should check what
    kind of data is stored by applications
    and services


    • Everyone of us needs to be

    aware of problems and

    issues that we will be

    confronted with in near

    future

    View full-size slide

  71. Stay safe & healthy

    View full-size slide

  72. @hendrikEbbers
    dev.karakun.com

    View full-size slide