讲解 program编程、辅导 c/c++,Python程序
A Blogging Platform
For Your School/Department
Using React Material UI
With Generative AI & Prompt Engineering
Zero-Shot, Few-Shot, and CoT
Requirements Specification
Author: Atef Bader
Last Edit: 1/17/2024
▪ In programming, we write pseudocode in NL to describe the steps in an algorithm.
▪ In Generative AI, we engineer prompts in NL to describe the steps in an algorithm.
Learning Objectives:
▪ Use Generative AI model, gpt-3.5-turbo, to create benchmarking
metrics for the selection and evaluation for the design and
architecture of a blogging platform.
▪ Analyze and synthesize queries written in natural language to
identify candidate architectures and design models.
▪ Compare and contrast the effectiveness of Zero-Shot, Few-Shot,
and Chain of Thought (CoT) prompt engineering techniques to
generate design/architecture candidates and code for queries
targeting the development of a blogging platform.
Learning Outcomes:
▪ Develop a Blogging Platform for your school/department.
▪ Identify and select a design model using the benchmarking metrics
created by the generative AI model, gpt-3.5-turbo.
▪ Utilize the Chain of Thought (CoT) prompt engineering technique to
evaluate the suitability of a design model and generate code for
queries written in natural language, textual format.
Resources:
▪ Material UI Blog Template:
• https://mui.com/material-ui/gettingstarted/templates/blog/#
• https://github.com/mui/materialui/tree/v5.15.5/docs/data/material/gettingstarted/templates/blog
▪ React Key Concepts By Maximilian Schwarzmüller
• Blog/Posts App - Chapters: 8, 10, 11, 12, 13
▪ https://github.com/mschwarzmueller/book-react-keyconcepts/blob/08-effects/activities/practice-1/startingcode/src/App.js
1. Overview
There are several design models, architectures, patterns, and technologies
that are used for different purposes; the choice is always dependent on the
nature of the application requirements/queries and nature of data.
For this project, you will work on the design and development of a Blogging
Platform for your school/department.
Your tasks for this research and development project are:
1. Develop a Blogging Platform for your school/department.
2. Identify and document the list of actors/users/personas for the
requested Blogging Platform.
1. Student
2. Faculty
3. Staff
4. Moderator
5. Guest
6. Etc.
3. Identify and document the list use-cases/user-stories for every
actor/user/persona for the requested Blogging Platform.
1. Create a post
2. Reply to a post
3. Like a post
4. Share a post
5. Moderate a topic-blog
6. Etc.
4. Identify and document the architecture, design, and screen-layout
of the requested Blogging Platform.
5. Identify and document the list of topics for bloggers. Topics like
Culture, Social, Sports, Technology, Travel, etc.
6. Identify and document the usage scenarios for exact search, fuzzy
search, semantic search, and hybrid search.
7. Use OpenAI/ChatGPT to create the list of candidate solutions.
8. Use OpenAI/ChatGPT to create a research report that documents
the recommended database of choice.
1. Vector Database
2. Relational Database (SQL)
3. Document Database (NoSQL)
9. Get real-time internet search results using SerpAPI (
https://serpapi.com/ ) for real-time internet search results.
10.Get the current position/geolocation of the blogger using the
navigator navigator.geolocation.getCurrentPosition.
11.Show Bloggers Near-Me on a real-world map using
(https://www.openstreetmap.org ) and Leaflet JavaScript library
(https://leafletjs.com/index.html )
12.Get current weather conditions to help blogger
sharing/recommending events based on the current weather
conditions and the blogger’s current position ( https://api.openmeteo.com )
1.1 Background Knowledge
To evaluate different discussion design models of their suitability for our
intended blogging applications, we would need to identify the list of
metrics that could be used for benchmarking and evaluation. The following
is an example of a Blogging template developed in React Material UI:
Let’s create the context and examples to our conversation with
OpenAI/gpt-3.5-turbo model in an attempt to get more accurate results
from OpenAI rather than general answers.
Enter the following text into ChatGPT prompt:
Answer in a consistent style and provide me with examples from the real-world.
Teach me about blogs.
Teach me about discussion forums.
Teach me about community forums.
Teach me about Q&A.
Teach me about community in social network.
The following is a reply we got back from OpenAI/gpt-3.5-turbo model, and
it looks plausible (almost perfect) along with the explanation provided for
every discussion choice.
Please make a note that OpenAI/gpt-3.5-turbo model recognized
StackOverflow as a Q&A platform; well-done job by the OpenAI/gpt-3.5-
turbo model.
Now that OpenAI/gpt-3.5-turbo model knows the context of our
conversation, let’s ask it about the benchmarking metrics that we should
use in our evaluation for the different discussion platform:
Enter the following text into ChatGPT prompt:
What are the benchmarking metrics for the selection and evaluation of blog,
discussion forum, community forum, Q&A, and community in social network?
1.2 Analysis of OpenAI Generated Content
After we analyze and synthesize the output, we got from OpenAI, we will
observe the following:
▪ The discussion context was established and maintained in our
conversation with OpenAI.
▪ The answers we got back from OpenAI were written in a consistent
format.
▪ For every discussion type we provided, OpenAI highlighted the
primary metrics to consider in benchmarking.
▪ OpenAI provided us with plausible and accurate examples for the
different discussion types.
2. Designing a Blogging Platform
Let’s ask OpenAI/ChatGPT for recommendations to consider when
designing our blogging platform.
Enter the following text into ChatGPT prompt:
Answer in a consistent style and provide me with examples from the real-world.
I have a research and development project to create a blogging
platform for my school/university. Answer the following questions in a
consistent way:
- Which content I should consider for my platform?
- What user roles I should consider for my platform?
- What industry standard I should consider for user interaction in my
platform?
- What software frameworks I should consider for the UI/UX for my
platform?
- What laws, policies, regulations I should consider in my design and
development of my platform?
3. Generative AI/ChatGPT – (Zero-Shot)
Let’s ask OpenAI for its recommendation about the list of uses cases and
actors that we should consider in our design without providing example.
Enter the following text into ChatGPT prompt:
I have a research and development project to create a blogging
platform for my school/university.
Answer the following questions in a consistent way:
- What are the actors I should consider in my design?
- What are the use cases for every actor identified above?
- Create a table that has a list of actors and their associated use
cases.
Let’s ask OpenAI for its recommendation about the layout and design of
the UI/UX to be used without providing example.
Enter the following text into ChatGPT prompt:
I have a research and development project to create a blogging
platform for my school/university. Answer the following questions in a
consistent way:
- What is the screen layout I should use?
- What software design patterns I should consider to reuse in my
design?
- What UX design patterns I should consider to reuse in my design?
- What software frameworks I should consider for the UI/UX for my
platform that supports the recommended screen layout and utilizes
design patterns?
The following is a reply we got from ChatGPT, and it looks plausible (not
perfect) along with the explanation provided for every question:
4. Generative AI/ChatGPT – (Few-Shot)
Let’s add more context and examples to the conversation in an attempt
to get more accurate results from OpenAI rather than general answers.
Enter the following text into ChatGPT prompt:
I have a research and development project to create a blogging
platform for my school/university.
Answer the following in a consistent way:
- Teach me about Design Patterns.
- Teach me about UI/UX Patterns.
- Teach me about Architectural Patterns.
You could ask OpenAI/ChatGPT not to use your examples and to start
over, by entering the following prompt:
do not use my examples. start fresh
Enter the following text into ChatGPT prompt:
I have a research and development project to create a blogging
platform for my school/university.
The following are examples of users/actors/personas and their use cases for the
blogging platform:
- A student can create a post
- A teacher can create a post
- There are different topics that users can post blogs on.
- Examples of topics: social, Sports, Technology, Travel, etc.
- Every topic has a moderator that can review and delete a post if it has
content that could be perceived offensive by other users.
Answer the following questions in a consistent way:
- What is the complete list of actors I need in my design?
- What is the complete list of use cases for every actor identified
above?
- What is the complete list of the topics I need in my design?
- Create a table for every actor and their associated use cases.
Notice the results below that you might get back occasionally, part of the
conversation; OpenAI made a mistake and listed “(Topic)” under the
actor column for the moderator.
(Topic) is an actor??
5. Generative AI/ChatGPT – (CoT: Chain of Thought)
We did improve the accuracy of the results we got from OpenAI when
using Few-Shot, however it failed to deliver good results consistentlys.
Let’s use the chain of thought (CoT) and see if we get good
recommendations for all types of queries.
Enter the following text into ChatGPT prompt:
You are a software developer and UI/UX designer.
Follow these steps to answer the user questions regarding the requested
software application:
Step 1. Identify the different personas.
Step 2. Identify the features and functionality expected for every
persona.
Step 3. Identify the best architectural design pattern.
Step 4. Identify the programming language, the software
framework, and library to be used in the implementation.
Step 5. Identify the best screen layout for the requested application.
Step 6. What patterns should be used for the information
architecture?
Step 7. What patterns should be used for navigation and
wayfinding?
Step 8. What patterns should be used for the UI/UX?
Step 9. Create a table of the material design/UI component(s) that
is/are needed for every pattern identified in the prior steps?
Step 10. List the names of the software components that are
needed for the development of the requested applications.
Step 11. Generate complete code for my application based on the
results of the prior steps.
I have a project to develop a Blogging software application for my
school/university. What is the architecture, persona, features, and patterns
I should consider in my design and development of this project?
From the reply we got back from OpenAI, it looks OpenAI provided us
with somewhat good results for all steps except the last step.
Can’t Generate
Complete Code