Hey everyone! I’m Nataraj, and just like you, I’ve been fascinated with the recent progress of artificial intelligence. Realizing that I needed to stay abreast with all the developments happening, I decided to embark on a personal journey of learning, thus 100 days of AI was born! With this series, I will be learning about LLMs and share ideas, experiments, opinions, trends & learnings through my blog posts. You can follow along the journey on HackerNoon here or my personal website here. In today’s article, we’ll be looking to build a Semantic Kernel with the help of GPT-4.
In this post we will look at how to create a swot analysis for any business. If you are not familiar with SWOT analysis here is a quick intro.
SWOT stands for Strengths, Weaknesses, Opportunities & Threats. Its a simple way of evaluating any business and get ideas about how to improve it. Once you have done a SWOT analysis of a business, you can choose to compound on the strengths and create more differentiation from your competitor. You can find the weaknesses and create an action plan to fix them. You can find new areas to expand into using the opportunities as a starting point. It is essentially one of the many mental models used by business owners.
Here is an example of SWOT analysis for a pizza business.
Strengths |
Weaknesses |
---|---|
Unique garlic pizza recipe that wins top awards |
High staff turnover |
Owner trained in Sicily at some of the best pizzerias |
Floods in the area damaged the seating areas that are in need of repair |
Strong local reputation |
Absence of popular calzones from menu |
Prime location on university campus |
Negative reviews from younger demographic for lack of hip ingredients |
Opportunities |
Threats |
---|---|
Untapped catering potential |
Rising competition from cheaper pizza businesses nearby |
Growing local tech startup community |
There’s nearby street construction that will impact foot traffic |
Unexplored online presence and order capabilities |
Rising cost of cheese |
Upcoming annual food fair |
No immediate local regulatory changes but it’s election season |
To generate above SWOT, we are essentially answering questions in the following template.
Our goal is to use Open AI & Semantic Kernel and be able to generate SWOT analysis for any given business. Why use Semantic Kernel? Part of the goal of this post is also to explore more functionality of Semantic Kernel. We could also achieve the same end goal using Langchain. If you like Langchain over Semantic Kernel feel free to use that.
For this step you will need Open AI secret key. Note that Semantic Kernel can work with other LLMs and their corresponding chat completion APIs. See the documentation to find out what they support.
Semantic functions are a way to leverage custom prompts in the Kernel world. More about it here. We will create a semantic function that takes a custom prompt for SWOT analysis of a Pizza business, give an instruction in the prompt to convert the analysis to the a given domain that is given as an input to the prompt. Here’s how it looks.
To call the semantic function that is registered with the Kernel, we need to create a context and pass it. The context also includes the new domain we want the SWOT analysis to be applied to, in this case I am using Newsletter. Since every one is starting a newsletter lets try to get a SWOT analysis template for starting a newsletter. Here’s the code for step 3.
Not bad, the out put generated gives a great SWOT template for whether or not you should start a newsletter.
You can expand this experiment further and generate a 2*2 matrix like the pizza example I shared above as well.
AI PRODUCT IDEA ALERT: A website where a user can enter their idea and get an output for all the business mental models that exist including SWOT.
That’s it for Day 9 of 100 Days of AI.
I write a newsletter called Above Average where I talk about the second order insights behind everything that is happening in big tech. If you are in tech and don’t want to be average, subscribe to it.
Follow me on Twitter, LinkedIn or **HackerNoon **for latest updates on 100 days of AI. If you are in tech you might be interested in joining my community of tech professionals here.
Previous Day 8: Experimenting With Microsoft's Semantic Kernel Using GPT-4