The world’s leading publication for data science, AI, and ML professionals.

🎨 Art & Science with GPT-3 persona chatbot.

In this Art&Science project, we wanted to show non-human human interactions throw cutting-edge technologies.

Humans and nature have always existed together, but it is difficult to say that they often communicate with each other. In this Art&Science project, we wanted to show non-human <–> human interactions throw cutting-edge technologies.

Verbal communication builds most human relationships, and we developed the personality chatbot with unusual inputs. Instead of a typical "artificial" keyboard, we utilised one of our primary human senses – the touch 👈 .

Photo by Amit Lahav on Unsplash
Photo by Amit Lahav on Unsplash

Concept of the Project

Our fundamental goal was to build and reshape the relationships between interconnected entities that rarely interact with each other. Seeking interaction partners that humans often overlook, this project connects exhibition visitors with an apple called Mx. Apple.

The overall concept is a platform with an apple and a screen. A person communicates with apple trow touches and receives answers on the screen. Here, natural and artificial communication channels are merged into a hybrid one.

Hardware back-end

Image by the Author | Schematic of the project's hardware structure
Image by the Author | Schematic of the project’s hardware structure

To communicate between humans and non-humans, we choose touches as input and text on the screen as output. To make it happen, we used conductive paint on the apple. It connects touch zones with Arduino underneath the hidden box. Each touch-zone is dedicated to a particular question category, like Personal details, Mood, Life goals, etc. The signal triggers the question to the chatbot and outputs the conversation to the screen.

Development of personality

Apples are one of the most common fruits in the world. Although they are considered very ordinary, many myths and stories from human culture revolve around apples. The duality of an apple as an entity is reflected in this project by the gender-neutral title of the character. We thereby gave it the title ‘Mx’, as the apple fruit doesn’t have any sex or gender, implying the notion of blurred borders.

Image by the Author | Abstract representation of the apple personality
Image by the Author | Abstract representation of the apple personality

To inject more "liveliness" and make Mx. Apple more interesting to communicate with, we developed the origin of the persona. This is not something that can be used by the chatbot directly but helps to set the path and overall tonality of the narration.

Building the chatbot

Since we needed to fully demonstrate the personality of Mx. Apple and had limitations in terms of information output, we decided to make a Question-Answering chatbot. Touch inputs generate the question that is addressed to the chatbot and show this conversation on display.

Utilising GPT-3

There are lots of approaches to developing such a system. Still, we need something that overcome usual techniques and make the conversation creative and unpredictable to humans. That is why we chose the Official Q/A example as a basis and slightly changed the approach. Basically, we are sending the brief personality description and example of QA conversation as a prompt to fine-tune the model. We utilised this repository which helps with connection and prompts to the GPT-3 API.

At the start, a small sample Q/A conversation is ended to the API for tuning the model. After that, we can send question requests to the tuned model through the API in the same format and get generated answers.

Image by the Author | Example of the QA conversation with a bot using CLI
Image by the Author | Example of the QA conversation with a bot using CLI

Injecting personality

We developed a QA example conversation based on the previously defined personality. It is crucial to set the constraints for the bot and prevent it from going "crazy". For example, you can mark responses to sensitive questions or unknown requests. A sample of QA conversation is written in the JSON format with tuning parameters.

Compared to personalities inside the gpt3-persona-bot repo, ours has the intro question – "Who are you?". It sets the overall description of the personality and helps the model to work more consistent. For example, in the answer, you will already find the first constraint: "If you ask me a question that is nonsense, trickery or has no clear answer, I will respond with: Sorry, I am just an apple."

Connection with hardware

Since touch zones on the apple are connected to Arduino, we needed to react to this hardware input. We did that in the way of connecting hardware to a computer and sending input messages through a serial port. To read serial messages in the chatbot backend, we used the pySerial library and utilised Server Sent Events (SSE) to propagate data to the frontend.

Backend based on Flask gets the id of the input zone, recognises the question type, randomly selects and sends a request to the model via the API. The answer will be displayed on the front-end.

GIF by the Author | Front-end part of the chatbot
GIF by the Author | Front-end part of the chatbot

Results

Finally, assembled all together project will be demonstrated at the exhibition at Le SAS. Still, for now, you can observe the work of the prototype 🏗 .

GIF by the Author | Interacting with the prototype
GIF by the Author | Interacting with the prototype

Full implementation and instructions to run you can find in this repo. Hence, you can utilise just a plain keyboard for chatting. Happy conversation with Mx. Apple! 😎

[GitHub – kinivi/art-science-saclay: [Art&Science 🎨 ] GPT-3 based chatbot that imitates apple…_Art&Science 🎨 ] GPT-3 based chatbot that imitates apple personality. Each response is triggered by input sensors o_n…github.com](https://github.com/kinivi/art-science-saclay)

Acknowledgement

Special thanks to my team: Join LIM, Elena RANKOVA, Aslan HALIMI and Alexis PISTER.


Related Articles