-
Front End Website: Introduction Page. This page is coded in HTML and CSS. It includes a button which redirects to the main page.
-
Main Page. This page is coded in HTML and CSS. The main function is designed for user input, and sends information to the backend code.
-
This is the first half of the classify file. Function one is called introduction, and it turns the input from the user into an age range.
-
The second function is called categorize. It uses the Example section of the classify model to figure out what type of question is asked.
-
The main file get the input, both the age and the question, and calls the appropiate methods to create a response.
-
The generate class uses a custom model made thru co:here to create a response that is acceptable to the question
-
The possible questions text file is what was used to create the custom model, so it knew what type of answers went with different questions.
-
These are more examples of what was fed to the co:here generator.
-
Inspiration
While brainstorming ideas about the theme "sandbox," we became hyper-fixated on something for kids. When we think of sandboxes, we envision kids playing at a beach. We came to a bit of a standstill but eventually went back to the technical meaning of sandbox, which was a safe space for experimentation. And so, our inspiration was found.
What it does
Sandbox takes questions that a user (a child) asks and based on the info and examples it was given, generates some type of advice or comfort.
How we built it
Front End We started our code using "Visual Studio Code" as well as downloading the extensions "React." Google was our bestfriend as we are beginners in coding with HTML and CSS. With a lot of trial and error, we finished our website.
Back End I started making the back end by practicing the three models co:here showed me: generate, classify, and embed. I decided I would use a combination of generate and classify. After familiarizing myself with the way both models worked, I imported co:here into my Pycharm and got started. I made the classify file and changed the examples to show different types of questions. The categories are spiritual, emotional, romantic, and physical. I got my own API key through the co:here playground and everything started to connect.
I then made the generate file, which was super easy since I used a custom model. To make the custom model, I created 32 different question-answer examples for the AI to read. I put this into co:here, and it gave me a model id. Using the model id, I finished the generate file, and it worked.
I then decided to make classify and generate classes with methods, so that I could make a main file, and connect what I created. In the main file, I import both classify and generate, and open the space for user input, assuming it would come from the Front End. I created a classify object and a generate object and called the appropriate methods in order to categorize the type of question the user put in, and the age range of the user. With the return I got from calling the classify methods, I called the generate method and created a variable called "finale" that held the response.
Challenges we ran into
Front End Because of our lack of experience, we were unable to connect the backend code with our front end code, but hopefully, you are able to see the vision of our project When using the Cohere AI, and asking it a question, it would respond rudely. Our goal is for the AI to respond in the nicest way possible.
Back End I struggled initially with importing co:here into my Pycharm, but with the help of a mentor from co:here, that was solved. Everything else just took a lot of thinking and visually explaining my ideas in my head.
Accomplishments that we're proud of
We are proud of learning to use co:here as a tool for predicting language. We are very proud of our website, since we are first year students with minimal experience.
What we learned
We had to learn to not be too ambitious, but also challenge ourselves. We learned to take things step by step. We learned how to code in HTML and CSS and further our knowledge with API and AI.
What's next for Sandbox
To have our back end and front end connected, and work as a seamless website. We also hope for more data to work on the responses, and train the AI to be nicer and seem much more human.
Log in or sign up for Devpost to join the conversation.