Skip to content

Text Generation Software Which Creates Story Based On User Input

Notifications You must be signed in to change notification settings

Misterius-code/StoryGenerator

Repository files navigation

AI Story Generator


Final year project for the university which uses all my knowledge I learned on studies. The project is a quite interesting research question, which is:

“Can machine learning be used to modernize electronic books by connecting text generation and user interactions?”.

This project focuses on the implementation of machine learning transformers algorithms to generate a new text from the original source. The project use machine learning models such as GTP-2 and T5 to generate a book like tales/stories. The main objective of the software is to generate new text which would be a continuation of the previous text. Purpose of it, is to create a book like resemblance from couple texts.

image

Technologies used:

Python-All the backend and generation functions were writen in Python.

Flask-A framework used as a server to send and revice neccesary data from website to model.

GPT-2 - Main text generation model in project , responsible for creating new lines of text based of orginal story.

T5 -Machine learning model used to summarize stories which were to big to load into GPT-2 model.

JavaScript -Mainly responisble for user ineracation and sending data to backend.

Features:

Title Generation

Title generation is simplest process of text generation in the whole project therefore a smallest available model from GPT-2 series was assigned for this task. Assigning the GPT-2 Small (117M) model gave a better flexibility and outcomes because model is lighter and quicker than other GPT-2 versions. This model was finte-tuned in order create a accurate title based on the story.

ezgif com-gif-maker (1)

Text Generation

Program initaly takes a story from the website and depending of the size of the text it either summarize it or place is straight to model. Model generate a new text based on the input and it is capable of generating 250 words every minute. Generated text is mostly coherent and contains a continuation of the previous story.

Screenshot 2022-08-24 210044

Influance options

Influence options are one of the most interesting features which generates 2 continuations of story. User needs to select which story line would like to continue. Based on user input a story will go into the one of 2 directions. The only problem is that user would need to wait a little bit longer for story to appear as it needs to generate 2 stories instead of one.

Screenshot 2022-08-24 203217

Addational project features which are not descirbed in this file:

Main character customization

Fine-tuning

Advanced Settings

Live text edit

Summarization

Instalation Instrunctions

Please install all requirements from requirements.txt As well please make sure to allocate enough space for the project as is quite heavy. Please make sure you have enough comupting power (GPU and RAM) to run the project. Recomened resources: Intel i5 10th generation RTX 3060 GPU with 6GB or memory 16 GB of RAM

Project might not or run much slower if user do not meet those requirments.

Please make sure CUDA is installed properly of your device.

Open terminal and move to root of project then use this command:

pip install -r ./requirements.txt

If you encounter any problem with the project, please contanct me on: [email protected] or [email protected]

About

Text Generation Software Which Creates Story Based On User Input

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published