製作可說出實驗儀器用途的聊天機器人 (學生版)Chatbot designed to answer questions about laboratory apparatus (Student's version)

STEM 連繫 (S1–S3)STEM connection (S1–S3)製作可說出實驗儀器用途的聊天機器人Chatbot designed to answer questions about laboratory apparatus
學習技能:Learning skill: 編程訓練Programming

前言Introduction

在課本的1.4A章節,學生學過實驗室中一些常見的儀器及它們的用途。在這個編程活動中,學生將學習如何製作和「訓練」一個聊天機器人,用來說出有關各種實驗室儀器的用途。

In Section 1.4A, students have learned some common apparatus in the laboratory and their uses. In this coding activity, students will study how to develop and ‘train’ a chatbot to answer questions about the use of laboratory apparatus.


常見的實驗儀器Some common apparatus in the laboratory

以下顯示一些常見的實驗儀器及它們的用途。

The following show some common apparatus in the laboratory and their uses.

大試管
  • 用來盛載較大量的液體或固體
試管
  • 用來盛載少量液體或固體
Boiling tube
  • to hold a larger amount of liquids or solids
Test tube
  • to hold a smaller amount of liquids or solids
燒杯
  • 用來盛載液體或固體
Beaker
  • to hold liquids or solids
錐形燒瓶
  • 用來盛載液體或固體
膠塞
  • 用來塞着試管口或燒瓶口
Conical flask
  • to hold liquids or solids
Rubber stopper
  • to plug the opening of test tubes and flasks
試劑瓶
  • 用來儲存液體
Reagent bottle
  • to store liquids
滴瓶
  • 用來儲存液體,移取時可逐滴使用
Dropping bottle
  • to store liquids that will be used in drops
集氣瓶
  • 用來收集或盛載氣體
Gas jar
  • to collect or hold gases
量筒
  • 用來量度液體的體積
Measuring cylinder
  • to measure the volume of liquids
錶面玻璃
  • 用來盛載少量液體或固體
Watch glass
  • to hold a small amount of liquids or solids
蒸發皿
  • 用來盛載待蒸發的液體
Evaporating dish
  • to hold a liquid to be evaporated
  • 用來拿起熱的物件
Tongs
  • to hold hot objects
試管夾
  • 加熱時用來夾着試管
Test tube holder
  • to hold a test tube when heating
刮勺
  • 用來移取少量粉狀化學品
Spatula
  • to transfer a small amount of powder
試管架
  • 用來放置試管或大試管
Test tube rack
  • to hold test tubes or boiling tubes safely
漏斗
  • 過濾時用來讓液體向下流出
Filter funnel
  • to let liquids flow down during filtration
濾紙
  • 過濾時用來把固體從液體中分隔出來
Filter paper
  • to separate solids from liquids during filtration
滴管
  • 用來移取少量液體
Dropper
  • to transfer a small amount of liquids
玻璃棒
  • 用來攪拌液體
Glass rod
  • to stir liquids
支架和夾
  • 用來固定儀器的位置
Stand and clamp
  • to fix the position of apparatus
鐵絲網
  • 加熱時用來支撐儀器(例如燒杯或燒瓶)
三腳架
  • 用來支撐鐵絲網
本生燈
  • 用來把物質加熱
隔熱墊
  • 加熱時用來保護實驗桌
Wire gauze
  • to support apparatus (e.g. beaker or flask) during heating
Tripod
  • to support the wire gauze
Bunsen burner
  • to heat substances
Heat-proof mat
  • to protect the bench during heating


聊天機器人Chatbot
甚麼是聊天機器人?What is a chatbot?

聊天機器人是一種使用人工智能(AI)的電腦程式,用來與人溝通。你可以向聊天機器人輸入訊息或跟它說話,它便會分析和嘗試理解你的說話,然後給予回應。

聊天機器人有許多不同的用途,例如幫助人們解答或解決問題、提供資訊或娛樂,甚至可以當作虛擬朋友來聊天。聊天機器人已愈來愈普及,並且被廣泛使用在網站、社交媒體、通訊應用程式及其他平台上。

A chatbot is a computer program that uses artificial intelligence (AI) to communicate with people. You can type messages or speak to it, and it will analyze and try to understand what you're saying before responding.

Chatbots have many different uses, such as helping people solve their questions or problems, providing information or entertainment, or even just being a virtual friend to talk to. They are becoming more and more common and are used on websites, social media, messaging apps, and other platforms.

在人工智能中,甚麼是「提示 (prompt)」?What is a prompt in AI?

在人工智能中,「提示」是用來與人工智能進行溝通的方式,包括文字、問題或資訊。提示有助與機器人對話,讓它更易理解用戶的需要,這是聊天機器人的運作中十分重要的部分。一個設計良好的提示,可以幫助聊天機器人明白用戶的問題並提供正確的回覆,讓用戶在與機器人對話時更有效率及感到簡便易用。

A prompt in AI is any form of text, question, or information that is used to communicate with the AI. In chatbots, prompts are an important part of their functionality because they help guide the conversation and make the chatbots understand the needs of the users. A well-designed prompt can help the chatbot understand the user's question and provide the correct response, making the chatbot more user-friendly and efficient in communication.

聊天機器人已逐漸應用在網站上,用來回答訪客的問題。

Chatbots are now commonly used on websites to answer visitors' questions.


編程活動Coding activity
使用Scratch來製作簡單的聊天機器人Using Scratch to build a simple chatbot

Scratch 是一個網上電腦程式開發平台,讓學生可學習編寫電腦程式、遊戲、動畫或互動程式等。請參考以下步驟,學習如何使用Scratch製作一個簡單的聊天機器人。

Scratch is an online computer programming platform that enables students to create interactive stories, games, and animations. Follow the steps below to learn how to use Scratch to create a simple chatbot.


第一部分—開啟程式Part I - Opening the programme
  1. 點擊以下按鈕下載或檢視示範專案。
    示範專案:
    下載 檢視

    Click on the following buttons to download or view the demonstration project.
    Demonstration project:
    Download View

  2. 如在網上檢視專案,你可以點擊右上方的「切換到程式頁面 (See inside)」按鈕,查看這程式是如何製作的。

    If you are viewing the project online, you can click on the ‘See inside (切換到程式頁面)’ button in the top right corner to see how it is built.


第二部分—測試程式並給予回應Part II - Testing the programme and giving feedback
  1. 點擊「綠旗」按鈕來啟動程式。

    Click on the ‘green flag’ button to start the programme.

  2. 在這個示範專案中,聊天機器人已經預載了在1.4章節介紹的實驗室儀器的資料。你可以輸入一個儀器的名稱,聊天機器人便會提供課本上所描述的用途。

    In this demonstration project, the chatbot has been programmed with information about the laboratory apparatus discussed in Section 1.4. You can type the name of an apparatus and the chatbot will provide you with its use as described in your textbook.

  3. 如果聊天機器人不知道你所輸入的儀器是甚麼,你可以告訴聊天機器人它的用途。當你下次再問及該儀器時,聊天機器人便能夠為你提供答案。

    If you enter the name of an apparatus that the chatbot does not know, you can inform the chatbot about its use, and it will be able to provide you with an answer the next time you ask.


第三部分—修改你自己的聊天機器人Part III - Modifying your own chatbot
  1. 點擊以下按鈕下載延伸專案。
    延伸專案:
    下載

    Click on the following button to download the extended sample project.
    Extended project:
    Download

  2. 登入Scratch後,可從左上方點擊「檔案」,然後選擇「從你的電腦挑選」來上傳延伸專案到你的帳戶並進行編輯。

    After signing in to Scratch, click on 'File(檔案)' from the top left corner and select 'Load from your computer(從你的電腦挑選)' to upload the project and edit it using your own account.

  3. 參考以下指引來修改延伸專案,並製作你的聊天機器人。例如,製作一個聊天機器人來介紹學校的設施。

    Use the following guidelines to modify the extended project and create your own chatbot. For example, you can create a chatbot to introduce the facilities in your school.


要修改聊天機器人的提示和回覆,請按照以下步驟進行:

To modify the prompts and responses of your chatbot, follow these steps:

1 在左方選單中點擊「變數」。 Click on 'Variables (變數)' in the left-hand menu.
2 勾選方框來顯示「提示」和「回覆」的清單(資料庫)。
(「提示」是使用者輸入的儀器,而「回覆」則是聊天機器人對每個提示所作出相對應的回覆。)
Check the box to display the List (database) of 'prompts' and 'responses'.
‘Prompts’ are the apparatus entered by the user, while ‘responses’ are the corresponding output from the chatbot for each prompt.
3 修改「提示」和「回覆」清單中的內容,並確保每個提示和回覆均配對相同的編號。你可以點擊左下方的「+」添加新的項目。
(如果你想隱藏清單,請參考步驟(2),並取消勾選方框。)
Edit the content in the 'prompts' and 'responses' tables, making sure to match the same number for each prompt and response. You can click on the + button in the lower left corner to add new items.
(If you want to hide the List, refer to step (2), and clear the box.}
4 按需要修改聊天機器人的對話。 Update the dialogues of the chatbot as necessary.
5 點擊「綠旗」按鈕測試聊天機器人。 Click on the 'green flag' button to test your chatbot.

討論Discussion
聊天機器人在科學中的應用The use of chatbots in science

聊天機器人在科學上有廣泛的潛在用處,讓科學家可更有效率地工作。例如,聊天機器人可以協助科學家搜尋資訊及分析科學數據。進階的聊天機器人甚至可以用來透過程式以控制實驗室儀器、進行實驗或測量,並分析結果,為研究人員提供所需回覆。

相對於靠人手進行科學研究,使用聊天機器人來代替這項工作又有甚麼優點和缺點呢?試與你的同學討論。

Chatbots have the potential to be useful in various scientific applications, helping scientists work more efficiently and effectively. For example, chatbots can assist scientists in finding information and analyzing scientific data. Advanced chatbots can even be programmed to control laboratory equipment, perform experiments or measurements, and analyze the results, providing feedback to researchers.

Try to discuss with your classmates the pros and cons of using chatbots for conducting scientific research compared to human researchers.


優點:

Pros:

缺點:

Cons:

沒有使用權限No access right

你的學校未有使用本系列資源之權限。

Your school does not have the access right to open the resources of this series.

沒有使用權限No access right

你的學校未有使用本系列資源之權限。

Your school does not have the access right to open the resources of this series.