| | |
| | """gradio-demo |
| | Automatically generated by Colaboratory. |
| | Original file is located at |
| | https://colab.research.google.com/drive/1-iBNAt-l2MLx1trpU5geyHS8RVyrMM5I |
| | """ |
| |
|
| | import gradio as gr |
| | import ideaGen_youtube_insight |
| | import strategyGen |
| | import ideaGen |
| | import ideaGen_Followup |
| | import FiveWhy |
| |
|
| | css_1 = """ |
| | #warning {background-color: #FFCCCB} |
| | .feedback textarea {font-size: 240px !important} |
| | .container { |
| | width: 80%; |
| | margin: 0 auto; |
| | } |
| | |
| | .title { |
| | font-size: 40px !important; |
| | font-weight: 600 !important; |
| | line-height: 50px !important; |
| | letter-spacing: 0em; |
| | text-align: center; |
| | color: #374159 !important; |
| | } |
| | |
| | .subtitle { |
| | font-size: 2em !important; |
| | font-style: italic; |
| | font-weight: 400 !important; |
| | line-height: 40px !important; |
| | letter-spacing: 0em; |
| | text-align: center; |
| | color: #1d652a !important; |
| | |
| | } |
| | """ |
| |
|
| | ideaGen_demo = gr.Interface(fn=ideaGen.ideagen, |
| | description="靈感生成器(Idea Generator),先選擇想要生成的Idea種類,輸入品牌/產品/目標對象...相關資訊,讓AI產出相應的Idea。\n將產出的結果貼到靈感生成器(下一步)獲得細節的規劃。", |
| | inputs=[ |
| | gr.Dropdown( |
| | label = "生成內容", |
| | info = "請選擇要生成的Idea種類", |
| | choices = ["YouTube 創意影片", "線下體驗 / 店頭活動", "數位 / 手機 / 線上互動","TikTok 趣味短片" ,"Instagram UGC 活動","Social 貼文 / 網頁或廣告標題"], |
| | type = "index", |
| | value = 0 |
| | ), |
| | gr.Textbox( |
| | label = "品牌名稱", |
| | value = "Toyota" |
| | ), |
| | gr.Textbox( |
| | label = "產品名稱", |
| | value = "電動車" |
| | ), |
| | gr.Dropdown( |
| | label = "目標對象", |
| | info = "請選擇針對的年齡區間", |
| | choices = ["Z世代(1997-2012)", "千禧世代(1981-1996)", "X世代(1965-1980)", "嬰兒潮世代(1955-1964)"], |
| | ), |
| | gr.Textbox( |
| | label = "核心精神", |
| | value = "先進數位娛樂空間,可以在車上玩Steam" |
| | )], |
| | outputs =[gr.Textbox(lines=30)], |
| | allow_flagging="never", ) |
| |
|
| | ideaGen_Followup_demo = gr.Interface(fn=ideaGen_Followup.ideagen, |
| | description="貼上靈感生成器產出的內容,選擇正確Idea種類,獲得進一步細節的規劃。", |
| | inputs=[ |
| | gr.Dropdown( |
| | label = "生成內容", |
| | choices = ["YouTube 創意影片", "線下體驗 / 店頭活動", "數位 / 手機 / 線上互動","TikTok 趣味短片" ,"Instagram UGC 活動","Social 貼文 / 網頁或廣告標題"], |
| | type = "index", |
| | value = 0), |
| | gr.Textbox( |
| | label = "前述內容", |
| | value = "", |
| | lines = 15 |
| | )] , |
| | outputs =[gr.Textbox(lines=10)], |
| | allow_flagging="never", ) |
| |
|
| | youtube_insight_demo = gr.Interface(fn=ideaGen_youtube_insight.parallel_function, |
| | description="提供格式和範例,測試Idea的品質是否提升。", |
| | inputs=[ |
| | gr.Dropdown( |
| | label = "生成內容", |
| | choices = ["YouTube 創意影片"], |
| | type = "index", |
| | value = 0), |
| | gr.Textbox( |
| | label = "品牌名稱", |
| | value = "Toyota" |
| | ), |
| | gr.Textbox( |
| | label = "產品名稱", |
| | value = "電動車" |
| | ), |
| | gr.Textbox( |
| | label = "核心精神", |
| | value = "先進數位娛樂空間,可以在車上玩Steam" |
| | ), |
| | gr.Textbox( |
| | label = "補充資料", |
| | lines = 5, |
| | value = "希望主打年輕客群,可以利用各種車上時間" |
| | ) ] , |
| | outputs =[gr.Textbox(label = "提案內容",lines=10),gr.Textbox(label = "實現步驟",lines=10),gr.Textbox(label = "token花費",lines=2)], |
| | allow_flagging="never", ) |
| |
|
| | strategy_demo = gr.Interface(fn=strategyGen.ideagen, |
| | description="選擇要使用的分析模型,提供品牌/產品相關資料,讓AI生成各種分析的初稿。(沒有聯網、沒有使用外部資料)", |
| | inputs=[ |
| | gr.Dropdown( |
| | label = "分析方式", |
| | |
| | choices = ["SWOT分析", "五力分析", "PESTEL分析" ,"商業模式畫布 / Business Model Canvas","STP分析","4P分析"], |
| | type = "index", |
| | value = 0), |
| | gr.Textbox( |
| | label = "品牌名稱", |
| | |
| | value = "星巴克(Starbucks)", |
| | ), |
| | gr.Textbox( |
| | label = "產品列表", |
| | lines = 5, |
| | |
| | value = "飲品:令人驚豔的精選咖啡風味與各式手調飲品,期待你親自來探索與享受。\n糕點:高品質食材製成豐富的蛋糕、三明治和輕食餐點,每一口都能品嘗到食物的原味,回味無窮。\n咖啡用品及設備:挑選最適合你的咖啡用品與設備,與好友家人一起共創居家迷人咖啡時光。\n星巴克隨行卡:隨行卡是星巴克最具有收藏價值的商品之一,不同時節推出專屬特色卡面設計,感謝每個咖啡時光有你與我們一同隨行!" |
| | ), |
| | gr.Textbox( |
| | label = "品牌理念", |
| | lines = 3, |
| | |
| | value = "星巴克的企業使命:啟發並滋潤人們的心靈,在每個人、每一杯、每個社區中皆能體現。秉持續追求卓越以及實踐企業使命與價值觀,我們透過每一杯咖啡的傳遞,將獨特的星巴克體驗帶入每位顧客的生活中。" |
| | ), |
| | gr.Textbox( |
| | label = "品牌目標", |
| | lines = 3, |
| | |
| | value = "面對相對低價位或超商等連鎖咖啡的競爭,創造無法被超越的優勢,維持領先的市占率,成為消費者心中精品咖啡第一品牌。" |
| | ), |
| | gr.Textbox( |
| | label = "目標客群", |
| | lines = 5, |
| | |
| | value = "星巴克目標客群是相當廣泛的,但主要以商務人士、年輕人和女性為主要目標。商務人士的消費需求主要是方便、高效、舒適的空間和品質高、口感好的咖啡。年輕人對時尚、音樂和文化有著較高的追求,尤其是咖啡文化,星巴克的裝修風格、音樂、咖啡文化以及社交媒體等都為年輕人提供了一個非常好的聚集場所。星巴克還特別關注女性客群,在星巴克的店內,不僅可以品嚐優質的咖啡,還可以體驗到一種寧靜、舒適、溫馨的氛圍。星巴克也會推出許多專門為女性設計的產品和服務,如限量版的星巴克紅色聖誕杯等。" |
| | ), |
| | gr.Textbox( |
| | label = "補充資料", |
| | lines = 2, |
| | value = "" |
| | ) ] , |
| | outputs =[gr.Textbox(lines=25)], |
| | allow_flagging="never", ) |
| |
|
| |
|
| | strategy_adv_demo = gr.Interface(fn=strategyGen.ideagen_adv, |
| | description="選擇要使用的分析模型,提供品牌/產品相關資料,讓AI生成各種分析的初稿。(沒有聯網、沒有使用外部資料)", |
| | inputs=[ |
| | gr.Dropdown( |
| | label = "分析方式", |
| | |
| | choices = ["SWOT分析"], |
| | type = "index", |
| | value = 0), |
| | gr.Textbox( |
| | label = "品牌名稱", |
| | value = "星巴克(Starbucks)", |
| | ), |
| | gr.Textbox( |
| | label = "產品列表", |
| | lines = 5, |
| | value = "飲品:令人驚豔的精選咖啡風味與各式手調飲品,期待你親自來探索與享受。\n糕點:高品質食材製成豐富的蛋糕、三明治和輕食餐點,每一口都能品嘗到食物的原味,回味無窮。\n咖啡用品及設備:挑選最適合你的咖啡用品與設備,與好友家人一起共創居家迷人咖啡時光。\n星巴克隨行卡:隨行卡是星巴克最具有收藏價值的商品之一,不同時節推出專屬特色卡面設計,感謝每個咖啡時光有你與我們一同隨行!" |
| | ), |
| | gr.Textbox( |
| | label = "品牌理念", |
| | lines = 3, |
| | value = "星巴克的企業使命:啟發並滋潤人們的心靈,在每個人、每一杯、每個社區中皆能體現。秉持續追求卓越以及實踐企業使命與價值觀,我們透過每一杯咖啡的傳遞,將獨特的星巴克體驗帶入每位顧客的生活中。" |
| | ), |
| | gr.Textbox( |
| | label = "品牌目標", |
| | lines = 3, |
| | value = "面對相對低價位或超商等連鎖咖啡的競爭,創造無法被超越的優勢,維持領先的市占率,成為消費者心中精品咖啡第一品牌。" |
| | ), |
| | gr.Textbox( |
| | label = "目標客群", |
| | lines = 5, |
| | value = "星巴克目標客群是相當廣泛的,但主要以商務人士、年輕人和女性為主要目標。商務人士的消費需求主要是方便、高效、舒適的空間和品質高、口感好的咖啡。年輕人對時尚、音樂和文化有著較高的追求,尤其是咖啡文化,星巴克的裝修風格、音樂、咖啡文化以及社交媒體等都為年輕人提供了一個非常好的聚集場所。星巴克還特別關注女性客群,在星巴克的店內,不僅可以品嚐優質的咖啡,還可以體驗到一種寧靜、舒適、溫馨的氛圍。星巴克也會推出許多專門為女性設計的產品和服務,如限量版的星巴克紅色聖誕杯等。" |
| | ), |
| | gr.Textbox( |
| | label = "Strength問題", |
| | lines = 3, |
| | value = "自己與主要競爭對手相比有哪些地方是我們表現好的?原因是什麼?\n自己與主要競爭對手相比有哪些獨特之處?" |
| | ), |
| | gr.Textbox( |
| | label = "Weakness問題", |
| | lines = 3, |
| | value = "自己與主要競爭對手相比有哪些地方是我們表現不好的?原因是什麼?\n表現不好之處該如何改進?" |
| | ), |
| | gr.Textbox( |
| | label = "Opportunities問題", |
| | lines = 3, |
| | value = "此產業存在那些未滿足的需求?\n此產業有哪些趨勢可以幫助我們鞏固獨特之處?\n此產業有哪些趨勢可以幫助我們改進表現不好之處?" |
| | ), |
| | gr.Textbox( |
| | label = "Threats問題", |
| | lines = 3, |
| | value = "此產業有哪些趨勢可能會對我們的績效造成風險?\n此產業可能有哪些潛在競爭對手?" |
| | ), |
| | gr.Textbox( |
| | label = "補充資料", |
| | lines = 2, |
| | value = "" |
| | ) ] , |
| | outputs =[gr.Textbox(lines=40)], |
| | allow_flagging="never", ) |
| |
|
| |
|
| | FiveWhy_demo = gr.Interface(fn=FiveWhy.ideagen, |
| | description="描述你所面對的問題/挑戰,產出5 Whys分析的結果。", |
| | inputs=[ |
| | gr.Textbox( |
| | label = "問題描述", |
| | value = "", |
| | lines = 3 |
| | )] , |
| | outputs =[gr.Textbox(lines=10)], |
| | allow_flagging="never", ) |
| |
|
| | demo = gr.TabbedInterface([ideaGen_demo , ideaGen_Followup_demo , strategy_demo, strategy_adv_demo, youtube_insight_demo, FiveWhy_demo], ["靈感生成器" , "靈感生成器(下一步)" , "策略生成器", "策略生成器 Advanced", "靈感生成器(Youtube+insight版)", "5 Whys分析"],theme='bethecloud/storj_theme') |
| | demo.launch(debug=True) |