project showcase

Poem Mechanic

GPT-3
Notion API
Three.js

The Why. 

This project is a way to fastrack my discovery of new Amharic words so that it is not left to chance encounters through music, podcasts, or conversations. Every week, I aim to pipe 70 new words (10 per day) into a digital flashcard app conveniently ready for me to study.

The Backstory

In my writing, I rotate around the same words and my heavy-hitters have become mere. A writer’s armor are words and to be under equipped means being distraught. I want to recline in a literary armchair, my poems, a generous helping of refined diction comfortably sat in a calculated meter, neither strained nor obtrusive. The reader, as if they have encountered a fountain, will not know from where the surplus emanates but also won’t have the opportunity to wonder.

Simple enough.

The How

Two Notes:

  1. Tools: Although I want to use Mochi, a digital flashcard app, I would need to purchase access to their API so I thought to first try compiling words in a Notion Database.
  2. Phases: Additionally, this project thus far is phase 1 of a multi-phase project. In this phase I solve the following problem:

My current discovery of words relies on chance encounters.

I do not have the time to manually enter words I encounter into a digital storage I can revisit routinely.

Some words are more potent than others making them a better fit for a poem than other words. I want to devise a sort of filter that can expedite not just my word search in general but these more potent words.

The solution makes use of two APIs:

  1. OpenAI’s API
  2. Notion’s API 

  1. Steps:
  1. I issued a prompt to OpenAI’s ChatGPT requesting 70 words widely used in Ethiopian poetry. 
  2. Upon receiving the text completions from OpenAI, I do the necessary operations to clean up the response. The responses from GPT come in one long array and need to be parsed and separated so they can be entered as distinct entries to the database. 
  3. The file runs once a day to gather 10 words, scheduled using cron expressions.

First Light: first successful response from OpenAI after many errors

Response cleaned by separating words, now it is ready for Notion's API

Entry added to a Notion DB

Three.Js Integration

Additionally, as a three.js enthusiast, I took this project as an opportunity to implement a front-facing facet by creating a quirky landing page with the help of a tutorial. As someone who wants to transition into creative development, It was thrilling to finally create a relatively complex animation that introduced me to boilerplate Three.js code and principal understandings about how to integrate Three.js into code. The construction of the page left me wide-eyed about the endless animation possibilities I can toy around with as I continue working on Three.js projects.

The Learning Point

  1. How can my technical skill set be used to tie up loose ends or to automate my daily routine and make me more efficient as I embark on different projects? One of the biggest regions of app development that I had yet to embark on is synthesizing my technical skills to engineer a solution that can be applied to my daily life. Working on this project, I knew a working amount about the tools I would be using and the main value of this is that it produced confidence in my ability to learn the necessary details of each tool to execute the task.
  2. A few months ago, I saw so many people online creating personal projects using OpenAI’s products. I wondered if I too would ever have the courage to look squarely at emerging, cutting edge technologies and be unafraid to just try. I have some working knowledge of its building blocks and with dedicated time and focus, I, too, can make sense of it. In this scenario, while it isn’t directly related to artificial intelligence, I was getting quite comfortable working with APIs due to my job at Civilience. This was enough to eclipse my self-doubts, to just try.

A few months ago, I saw so many people online creating personal projects using OpenAI’s products. I was astonished by how they let their curiosity lead the way, unhindered by questions of self-efficacy. I wondered if I too would ever have the courage to look squarely at emerging, cutting edge technologies and be unafraid to just try. In fact, be unafraid to realize that I have some working knowledge of its building blocks and with dedicated time and focus, I can make sense of it too. In this scenario, while it isn’t directly related to artificial intelligence, I was getting quite comfortable working with APIs due to work at Civilience. This was enough to eclipse my self-doubts, to just try.

Moving Forward - The Loose ends

I do think asking for a list of words is quite a simplistic ask for such a powerful tool like OpenAI's GPT. The interactions with the two apis, and cleaning the data to be placed into the notion database constitutes phase 1 having a foundational workflow that will then allow me to fine-tune different aspects of the solution for the most optimal final result. The follows are areas for improvement:

Prompt Design

One of the areas where it needs fine-tuning is the prompt itself. A recurring note I hear about working with GPT is that the quality of the answer is dictated by the prompt supplied, prompt design. The prompt I write needs to possess the nuances of what I am looking for. My next steps include consulting resources for prompt design.

Poetry Structures and Literary Devices

A more intensive use case I have for GPT is to help me explicate the way in which the structure of the poems as well as the literary devices employed carry the message being communicated. As a student of poetry, at this phase in my writing career, I want to dedicate my time towards learning the granularities of poem writing so that I may grow more knowledgeable in my own work.

A screenshot of web page