Prompt Story Generator is an interactive storytelling system designed to generate and evaluate creative stories using advanced prompting techniques, including zero-shot, few-shot, and reflexion prompting. This system allows users to select a story title and genre or provide custom prompts, leveraging a fine-tuned GPT model to create tailored stories. It evaluates generated stories using robust metrics like ROUGE, BLEU, METEOR, and coherence, providing insights into the effectiveness of different prompting strategies.
- Story Generation: Supports zero-shot, few-shot, and reflexion prompting techniques for diverse story outputs.
- Evaluation Metrics: Analyzes generated stories using ROUGE, BLEU, METEOR, and coherence metrics.
- Visualization: Graphically compares prompting strategies and their effectiveness.
- Interactive Interface: Simple web interface to select titles, genres, or provide custom prompts.
- Install Anaconda
- Clone this repository:
git clone https://github.com/srinivas-badiga/Story_Generation_and_Prompt_Evaluation.git
To use this project, you will need Anaconda or Miniconda installed on your system. Follow these steps:
-
Download the installer:
-
Install Conda:
- For Windows:
- Double-click the downloaded installer and follow the on-screen instructions.
- For macOS/Linux:
- Open a terminal and run the following command (replace the filename with the actual downloaded file):
bash Miniconda3-latest-Linux-x86_64.sh
- Follow the prompts to complete the installation.
- Open a terminal and run the following command (replace the filename with the actual downloaded file):
- For Windows:
-
Verify the installation:
conda --version
-
Navigate to the project directory:
cd Story_Generation_and_Prompt_Evaluation
-
Create a virtual environment using
conda
:conda create -n test python=3.10 conda activate test
-
Install
pip
and the required dependencies:conda install pip pip install -r requirements.txt
-
Download the necessary NLP model:
python -m spacy download en_core_web_md
-
Run the Flask application:
python app.py
-
Open your web browser and go to:
http://127.0.0.1:5000
- User Input: Users can select a story title and genre or provide custom prompts through the web interface.
- Story Generation: The backend processes the input and generates stories using the selected prompting technique.
- Evaluation: The system evaluates the generated stories using metrics such as ROUGE, BLEU, METEOR, coherence and confidence scores to measure quality and relevance.
- Visualization: Results are presented through comparative graphs and scores for user review.
Additionally, the system includes two distinct modules:
- Default Prompt Module: Generates stories using predefined prompts.
- Custom Prompt Module: Allows users to craft and generate stories based on their custom inputs.
app.py
: Main Flask application.templates/
: HTML templates for the web interface.static/
: CSS and JavaScript files for styling and interactivity.data.csv
: Dataset containing story titles and reference stories.requirements.txt
: List of dependencies for the project.System Diagram.png
: System Architecture.
- Python 3.10
- Flask
- OpenAI GPT API
- spaCy
- Matplotlib
This project is open-source and available under the MIT License.
- Dataset: ROCStories-MOD
- LLM: Fine-tuned GPT model for storytelling.