2023年12月19日 星期二

運用AI探索「推論」的技巧 12/26

讓我們一同運用AI探索「推論」的世界!在接下來的12/26課程中,我們將探索從課程例題中得出結論的藝術,以及將調查報告翻譯成繁體中文。通過評估回饋感受、分析情感色彩和辨識任務中的關鍵要素,深入理解推論的精髓。加入我們,體驗引人入勝的推論技巧,將語言能力與批判性思維融合,開啟一場充滿探索與驚艷的旅程!

學習單元 AI Workshop: Inferring 1

學習單元 AI  Workshop: Inferring 2

 請攜帶你的手機,平板,或是筆電。(螢幕大會比較好用,不過手機也可以)

2023年12月11日 星期一

提示撰寫實用指南

 

原則一:撰寫清晰具體的指示

  • 使用定界符標示不同部分:

    • 使用三個反引號等定界符清楚地標示出要求模型總結、解析或執行任務的特定文本部分。
    • 可使用各種標點符號或標記(如引號、XML 標記、章節標題等),使模型明確辨識不同部分。
    • 問題: 如果先輸入一段長文,產生一篇摘要,再要求翻譯為繁體中文。
  • 可要求結構化輸出:

    • 請求以結構化格式(如 HTML 或 JSON)提供輸出,便於解析模型的輸出結果。例如訂單格式
  • 驗證條件是否符合:

    • 當任務存在假設但可能未滿足時,讓模型首先驗證這些假設。(例如使用 IF 來檢測條件)
    • 考慮邊際案例及模型應如何處理,以避免意外錯誤或結果。
  • 少量示範:

    • 在要求模型執行特定任務之前,先提供該任務成功執行的少量範例,讓模型獲得參考。
    • 問題: 例如描述月亮之美時,如何生成你要的文字風格。
    • 答案: 你可以給予一小段"村上春樹"文字或是"李白"文字作為提示。

原則二:給予模型思考時間

  • 明確步驟要求完成任務:

    • 提供明確步驟,引導模型完成複雜任務,並確保其有足夠時間進行推理。
  • 引導模型推理:

    • 指示模型在得出結論前進行推理,避免倉促或錯誤的結論。
  • 限制模型幻覺:

    • 降低模型幻覺的風險,例如要求模型找出相關引文並據此回答問題,以追溯答案來源。

2023年12月10日 星期日

Prompting as a process

提示(Prompt)撰寫其實是一個逐步修正的過程,不要期待第一次就上手

  1. 迭代式提示開發: 創建有效的提示通常需要多次迭代。初始提示可能無法完全符合預期的結果。因此,根據初始輸出對提示進行精煉至關重要。


  2. 清晰和具體: 在提示的指令中清晰和具體很重要。無論是字數、句子結構還是特定所需的詳細資訊,都提供清晰的指導對於模型獲得更準確的結果至關重要。


  3. 調整提示: 如果初始輸出不符合期望(例如,長度過長或缺少特定資訊),則需要修改指令。這可能涉及調整字數、添加或更改特定細節,或改變輸出的焦點。


  4. 複雜的提示: 隨著時間的推移,隨著迭代的進行,提示可能變得更加詳細和複雜。這種複雜性可能包括格式要求(如HTML輸出)或要求特定的數據安排(如表格)。


  5. 應用軟體的成熟度: 隨著應用的成熟,對提示進行評估,應對較大量的示例進行評估變得至關重要,以確保在不同的輸入下具有一致且準確的性能。


  6. 整體而言,透過迭代方法開發提示,從單一示例開始,逐步根據輸出精煉指令,有助於為利用LLM的各種應用程式打造有效的提示。


Example: Test of comprehension 

Version 1: Generate the problems

Prepare 10 multiple choice problems from the paste text above to test comprehension.

  1. Shani Dhanda's activism primarily focuses on:
    A) Raising awareness for mental health issues
    B) Advocating for environmental sustainability
    C) Promoting cultural diversity
    D) Advocating for the rights of people with disabilities
    What year did Shani Dhanda organize the first event supporting disabled individuals and South Asian women?
    A) 2018
    B) 2019
    C) 2020
    D) 2021
    What medical condition does Shani Dhanda have?
    A) Rare genetic disorder
    B) Brittle Bone Disease
    C) Chronic fatigue syndrome
    D) Muscular dystrophy
    The "Diversability Card" app created by Shani Dhanda aims to provide:
    A) Social media networking for disabled individuals
    B) Travel guidance for people with disabilities
    C) Restaurant ratings and food delivery services
    D) Discounts for people with disabilities
    Shani Dhanda's vision for the future primarily revolves around:
    A) Global entrepreneurship programs
    B) Financial independence for disabled individuals
    C) Reducing carbon emissions
    D) Increasing government funding for disability services


Version 2: Making it more interactive

Prepare 10 multiple choice problems from the paste text above to test comprehension. Generate one problem at a time. Then you request an answer. Then generate next problem.

Version 3 Adding the grading 

Prepare 10 multiple choice problems from the paste text above to test comprehension. Generate one problem at a time. Then you request an answer. After you receive one, grade it. Then generate next problem. 

Version 4 Calculating the total score

Prepare 10 multiple choice problems from the paste text above to test comprehension. Generate one problem at a time. Then you request an answer. After you receive one, grade it. Then generate next problem. In the end, tell me out of the 10 questions above, how many questions are correctly answered?


Example: Test of vocabulary

Version 1 Generate the problems

Based on the vocabulary: (Exoskeleton, Myoelectric, Sensors, Hydraulic, Cylinder, Prosthesis, Rehabilitation, Paralysis, Spinal cord, Neural),  prepare 5 fill the blank quiz questions. 

  1. The ___________ system in robotics uses electrical signals generated by muscle contractions to control artificial limbs or devices.
  2. Sensors integrated into exoskeletons enable the detection of motion and force, allowing for precise ___________ control in assisting movements.
  3. A ___________ cylinder is a mechanical device that uses fluid power to perform various tasks, often employed in advanced prosthetic designs for enhanced functionality.
  4. ___________ is a process that aims to restore functions to the body after an injury, commonly employed after amputation to adapt to a new prosthesis.
  5. Damage to the ___________ cord can result in loss of sensation or motor function below the injury site, leading to conditions such as paralysis.

Version 2 One at a time

Based on the vocabulary: (Exoskeleton, Myoelectric, Sensors, Hydraulic, Cylinder, Prosthesis, Rehabilitation, Paralysis, Spinal cord, Neural),  prepare 5 fill the blank quiz questions.  Generate one problem at a time. Then you request an answer.  Then generate next problem. 

Version 3 Grading answer interactively

Based on the vocabulary: (Exoskeleton, Myoelectric, Sensors, Hydraulic, Cylinder, Prosthesis, Rehabilitation, Paralysis, Spinal cord, Neural),  prepare 5 fill the blank quiz questions.  Generate one problem at a time. Then you request an answer. After you receive one, grade it. Then generate next problem. 

Version 4 Total score

Based on the vocabulary: (Exoskeleton, Myoelectric, Sensors, Hydraulic, Cylinder, Prosthesis, Rehabilitation, Paralysis, Spinal cord, Neural), prepare 5 fill the blank quiz questions. Each question has only one missing word. Generate one problem at a time. Then you request an answer. After you receive one, grade it. Then generate next problem. In the end tell me how many are correctly answered.

Version 5 Randomize

Based on the vocabulary: (Exoskeleton, Myoelectric, Sensors, Hydraulic, Cylinder, Prosthesis, Rehabilitation, Paralysis, Spinal cord, Neural)randomize the order of these words and then prepare 5 fill the blank quiz questions.  Generate one problem at a time. Then you request an answer. After you receive one, grade it. Then generate next problem. In the end tell me how many are correctly answered.

Version 6 Limiting the # of blanks to one

Based on the vocabulary: (Exoskeleton, Myoelectric, Sensors, Hydraulic, Cylinder, Prosthesis, Rehabilitation, Paralysis, Spinal cord, Neural), randomize the order of these words and then prepare 5 fill the blank quiz questions. Each question has only one missing word. Generate one problem at a time. Then you request an answer. After you receive one, grade it. Then generate next problem. In the end tell me how many are correctly answered.


based on ChatGPT and the course in https://learn.deeplearning.ai/chatgpt-prompt-eng/lesson/3/iterative



AI Workshop 來寫寫Python程式吧 (12/12)

方便的話,可以攜帶筆電或是平板等螢幕比較大的設備,不過只有手機也是沒問題的。

AI工作坊主要內容請參看 https://nptechsl.blogspot.com/2023/12/ai-workshop.html

裡面有七個程式實作單元,12/12第一次工作坊預計進行單元一(Iteration) 與單元二(Summarize)

有任何問題都可以隨時聯絡我

2023年12月9日 星期六

AI Workshop

4 Sessions 

請攜帶你的手機,平板,或是筆電。(螢幕大會比較好用,不過手機也可以)

https://learn.deeplearning.ai/chatgpt-prompt-eng/lesson/3/iterative

申請帳號一般隱私安全注意事項

1. 避免使用公用電腦登入或註冊帳號,以免隱私資料被可能潛在的惡意軟體盜取

2. 避免使用重複的帳號密碼,建議避免一組帳號走天下,尤其是不應與金融財務相關帳戶或是職務相關登入帳號密碼相同,以免帳號被外洩時遭到連帶連鎖影響


Prompting as a process

 Guidelines for Prompting


請使用上述課程的人工智慧程式回答以下問題,請用螢幕拍照,同時附上程式與結果

Iterative (逐步修正)12/12

1. 將產品規格翻譯成繁體中文(Traditional Chinese)

2. 依據辦公椅的技術規格,為行銷團隊產生一個350個中文字的產品文字,看看文字長度是否合宜,如果太長,試著縮短文字長度,是否變得比較專業簡潔有力

3. 檢查所產生的行銷文字,是否註明產地,如果沒有請重新產生 


Summarize (摘要)12/19

1. 完成英文課程裡的例題。

2. 將四個客戶回饋(玩具,落地燈,電動牙刷,果汁機)翻譯成繁體中文

3. 將四個客戶回饋摘要為50個字,如果字數不足,請適度調整長度。需要翻譯成繁體中文


Inferring (推論)12/19, 12/26

1. 完成英文課程裡的例題。

2. 為前一題每個回饋內容產生二到五個感受,留下你認為最接近事實的感受,刪除多餘

3. 判斷每篇評論內容情緒為正面(快樂,滿意,激勵)或負面(憤怒,沮喪,失望)或中性(平和,平靜,事實陳述)

    4. 不可使用ChatGPT,根據你的獨立思考為每個評論的翻譯,感受與情緒判斷進行綜合評分,0分(完全不能接受)到10分(出奇地好)


    Inferring (推論)Part 2, 12/26

    1. 將問卷調查報導翻譯成繁體中文

    2. 為報導內容產生二到五個關鍵詞,留下最貼近事實的關鍵詞,刪除多餘

    3. 這篇報導是否有關農業,地方政府,歷史,公部門,請逐一檢查


    Transforming (轉換)

    1. An old dude who invented AI says it is unsafe.  翻譯為中文與日文

    2. 請將上述俚語改寫為正式英文商業書信。


    Expanding (擴展)

    1. 線上課程中客戶來信內容是正面還是負面?(sentiment 變數是多餘的,應刪除)

    2. 改用另一封客戶來信,測試回信功能是否正常

    3. 依據所提供的個人資料,撰寫一封求職信



    以下練習需要用到ChatGPT, 進入點如下。第一次使用者需要先註冊一個帳號。


    Expanding (擴展)Part 2

    使用 ChatGPT

    Based on the following CV of an undergraduate student, write a statement of purpose for applying for computer science department of Princeton University. You may generate several versions and pick the one you like.

    I have written 3 prestigious papers on assistive technology. I won the best paper award in Supercomputing 2013. I received the best service learning award that recognized my field service in supported employment institutions.


    Inferring (推論)Part 3

    1. 使用ChatGPT以繁體中文回答Step 1中的五個簡答題

    2. 使用ChatGPT為每個答題內容產生至多四個關鍵詞(Keywords)

    3. 使用ChatGPT判斷每篇答題內容情緒為正面(快樂,滿意,激勵)或負面(憤怒,沮喪,失望)或中性(平和,平靜,事實陳述)

    4. 不使用ChatGPT,為每題的簡答內容,關鍵詞與情緒判斷進行綜合評分,0分(完全不能接受)到10分(出奇地好)

    Step 1. Copy and paste the following into ChatGPT
    1. Write a 100-word review of the latest superhero movie, including a brief plot summary and your opinion on the acting, special effects, and overall entertainment value.
    2. Create a list of the top 5 programming languages to learn in 2023, with a brief explanation of each language's strengths and recommended resources for learning.
    3. Provide a 50-word description of the main features of the latest iPhone model, including the screen size, camera specifications, and any new software updates.
    4. Write a 150-word persuasive essay on why renewable energy is crucial for the future of the planet, including specific examples of the environmental benefits and economic advantages.
    5. Create a list of 10 tips for effective time management, with practical advice on how to prioritize tasks, avoid procrastination, and balance work and personal life.
    Step 2

    Get through each request until all the requests are completed.

    Step 3

    To summarize the questions,
    enter "how many requests have you answered?"

    Step 4

    將每個回答翻譯成繁體中文

    Step 5

    將每個回答產生至多四個關鍵詞(Keywords)

    Step 6

    判斷每篇答題內容情緒為正面(快樂,滿意,激勵)或負面(憤怒,沮喪,失望)或中性(平和,平靜,事實陳述)



    Hints:

    Step 4. For each answer your provided, translate it into Chinese.


    2023年11月13日 星期一

    11/14 《星艦迷航記》科技來襲

     在11/14晚間的課程中,我們將首先觀摩一項類似於《星艦迷航記》中使用的科技。令人驚奇的是,這部於1966年的電視劇中所幻想的科技居然在2023年成為現實。接著,我們將深入研究各種機器人,包括Tesla Optimus和Boston Dynamics等,這些機器人通常給人一種冷冰冰的感覺。然而,我們將探討為什麼吉藤先生的機器人OriHime能夠展現出溫暖的一面。他的成就同時使他在去年的2022年9月奧地利林茲舉辦的電子藝術節中獲得了「Golden Nica」獎。

    此外,我們將討論無人機的多種應用,除了攝影和作戰之外,還有哪些可能性。如果時間允許,我們將一探無人機企業如何利用無人機挽救濒危生命。

    課程內容連結 http://nptechsl.blogspot.com/2023/10/blog-post_70.html?m=1

    無人機企業 觀後自評 http://nptechsl.blogspot.com/2023/11/ai-tools-for-self-evaluation-of.html?m=1


    2023年11月12日 星期日

    AI tools for self evaluation of comprehension

     Using ChatGPT 3.5 (or Claude)

    1. Copy the transcript of the video clip  無人機改變物流:凱勒·里諾多 / Zipline執行長 video 15:00  and paste it on ChatGPT 

    2. Enter the prompt: 

    Prepare 10 multiple choice problems from the paste text above to test comprehension. Generate one problem at a time. Then you request an answer. After you receive one, grade it. Then generate next problem. In the end, tell me out of the 10 questions above, how many questions are correctly answered?

    3. Answer each question. ChatGPT will grade it and generate the next question until 10 questions are generated.


    Mail to chang212@gmail.com

    2023年11月6日 星期一

    AI tools for academic research

    這個工具利用AI從論文中自動提取重要內容,生成簡明筆記。只需提供PDF檔,就可獲得涵蓋論文主要部分的提要。

    如果有不熟悉的概念,可以讓AI進行通俗解釋。這樣,即使面對陌生領域,也可以快速抓住論文要點。

    利用這工具高效掌握內容。你可以持續關注領域裡的最新論文。

    這可以成為你學術研讀的一大助力!希望你可以善用這個工具,在學術領域不斷精進!


    Guidelines when using generative AI tools

    注意 不要將個人資料(例如個人財務,健康狀況),隱私或不可告知他人的資料(例如他人的研究資料)輸入給ChatGPT/Claude,以免危害自己或他人的利益。


    Reading a document (pdf)

    1. Using Claude, upload the pdf and summarize the paper.

    2. Make 10 slides for this paper.

    3. Translate the summary and the slides. 請翻譯這篇論文的摘要以及投影片。

    4. 輸入「幫我做成筆記好嗎」

    5. Comprehension test. Enter the prompt: 

    Prepare 10 multiple choice problems from the paste text above to test comprehension. Generate one problem at a time. Then you request an answer. After you receive one, grade it. Then generate next problem. In the end, tell me out of the 10 questions above, how many questions are correctly answered?








    11/7 使用AI深入服務設計

     11/7 上課大綱

    http://nptechsl.blogspot.com/2023/10/blog-post_70.html?m=1

    探索社會企業和社會服務,我們將討論兩個主題:

    1. **另類美食餐廳 InGalera** - 一家位於監獄內的餐廳如何改變了囚犯的生活,我們將透過一段15分鐘的影片深入探討,並瞭解其背後的故事。

    2. **機器人 x 身障就業** - 身障人士如何透過機器人技術找到就業機會,我們將觀賞一段28分鐘的影片(有效期至11/17/2023),並了解這個數位包容的主題。

    除此之外,我們將進行一系列實作練習,使用AI助手來應對不同挑戰,包括編輯服務文件、專業翻譯和編寫紀錄。最後,我們還將練習製作一個10頁的簡報,分享這些服務設計的故事。


    Guidelines when using generative AI

     有一些不錯的生成式AI 工具可供使用,例如

    There are some excellent generative AI tools available for use, such as:



    然而在使用AI時,需要注意以下:

    1. AI 不是永遠正確,請謹慎使用。(你可以想一想為甚麼AI會犯錯)
    2. 使用AI激發創意靈感,而非取代人的思考。
    3. 外文著作若具版權保護,請勿直接使用機器翻譯後進行使用,這可能構成重製並侵害著作權。
    4. 使用AI工具時請謹慎,避免濫用。
    5. 上傳個人、他人隱私資料或專業保密資訊至AI雲端,可能會違反法律,請注意維護個人與當事人權益。
    6. AI能力仍有限,使用時需注意判斷,避免錯誤。


    However, when using AI, it is important to be mindful of the following:

    1. AI is not always correct, so please use it cautiously. (Consider what situations AI might make mistakes in.)
    2. Use AI to spark creative inspiration, not to replace human thinking.
    3. If foreign works are protected by copyright, avoid using machine-translated versions directly, as this may constitute reproduction and copyright infringement.
    4. Exercise caution when using AI tools to avoid misuse.
    5. Uploading personal, others' private information, or confidential professional data to AI clouds may violate laws, so be mindful of safeguarding personal and stakeholders' rights.
    6. AI capabilities are still limited, so exercise judgment and be cautious to prevent errors when using it.