Skip to content

๐ŸŒธ A Haiku generator using Project Gutenberg and AI ๐Ÿ—ป

License

Notifications You must be signed in to change notification settings

heristop/gutenku

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

GutenKu

๐ŸŒธ Daily Haiku Card ๐Ÿ—ป

Daily Haiku Card

Last Snapshot: Tue, 30 Jul 2024 00:00:01 +0000

๐Ÿ‘ฉโ€๐Ÿซ โ€œThis haiku captures a poignant moment of vulnerability and beauty. The 'glorious eyes' suggest a sense of admiration and allure, yet they are 'bedewed' with a tear, indicating sorrow or distress. The phrase 'a helpless captive' evokes a sense of entrapment, perhaps emotional or situational, highlighting the contrast between the subject's inherent beauty and their current state of helplessness. The imagery is powerful, conveying deep emotion in just a few words.โ€

๐Ÿค–โœ’๏ธ Analysis Written by BotenKu, Your devoted Bot Literature Teacher

Want more? Visit ๐Ÿ”—gutenku.xyz or come back tomorrow ๐Ÿ˜‰


Description

GutenKu is a creative, literature-inspired project that uses Natural Language Processing (NLP), Markov Chain algorithms, Vue.js, and MongoDB to generate haiku poetry. The project scrapes selected text data from Project Gutenberg, a vast online library of free eBooks. This data is then processed to extract quotes, generate unique haiku, and offer sentiment analysis of the created poems. Furthermore, GutenKu employs OpenAI to improve selection and provide descriptions for each haiku. Ultimately, the application generates images of the haikus.

Preview

How it works

GutenKu operates by leveraging Python to scrape textual data from a curated whitelist of eBooks on Project Gutenberg. This gathered data is then processed through a Markov Chain, a probabilistic model that transitions from one state to another based on defined rules. The model is employed to identify and sequence sentences with the highest transition probabilities.

Once sentences are generated, Natural Language Processing (NLP) techniques come into play. These techniques disassemble sentences into words, conduct sentiment analysis, and enforce the traditional 5-7-5 syllable structure of a haiku. The syllable counting is facilitated by the syllable library.

The processed chapters are stored in a MongoDB database, along with the generated haikus, improving the application's performance with a cache system based on TTL principles. GutenKu also incorporates OpenAI api to enhance haiku selection and to generate descriptive narratives for each haiku. In the final stage, the application creates ready-to-post images of the haikus.

The user-facing side of the application is powered by Vue.js 3, providing an interactive interface that not only displays the generated haikus. It also offers an advanced mode for more personalized and unique results.

API Endpoint

GutenKu provides a GraphQL API for interacting with the service. The server is built using Apollo Server, a community-driven, open-source GraphQL server that works with any GraphQL schema.

Ecosystem

Api Vue

Application Env
Api TypeScript, GraphQL / Apollo Server, MongoDB, Python, OpenAI 4
Front TypeScript, GraphQL / Apollo Client, Vue 3 / Vuetify 3 / Pinia, Cypress.io

Acknowledgments

Thanks to the creators and maintainers of Project Gutenberg for providing the texts


GutenKu Logo

ยฉ 2023 heristop / @gutenku.poem. All rights reserved.