本文主要介紹使用ResponseSelector實現校園招聘FAQ機器人,回答面試流程和麵試結果查詢的FAQ問題。FAQ機器人功能分為業務無關的功能和業務相關的功能2類。
一.data/nlu.yml檔案
與普通意圖相比,ResponseSelector訓練資料中的意圖採用group/intent格式(檢索意圖)。比如,普通意圖intent: greet,而後者intent: faq/notes。如下所示:
version: "3.1"
nlu:
- intent: goodbye
examples: |
- 拜拜
- 再見
- 拜
- 退出
- 結束
- intent: greet
examples: |
- 你好
- 您好
- hello
- hi
- 喂
- 在麼
- intent: faq/notes
examples: |
- 應聘ACME校園招聘職位的注意事項?
- intent: faq/work_location
examples: |
- 校園招聘錄取的應屆生主要工作地點在哪裡?
- intent: faq/max_job_request
examples: |
- 最多申請幾個職位?
- intent: faq/audit
examples: |
- 各階段稽核說明
- intent: faq/write_exam_participate
examples: |
- 怎樣參加筆試?
- intent: faq/write_exam_location
examples: |
- 筆試考試地點如何安排?
- intent: faq/write_exam_again
examples: |
- 筆試只安排一次嗎?我筆試當天沒有參加,是否還有再次筆試的機會?
- intent: faq/write_exam_with-out-offer
examples: |
- 如果我沒有收到筆試通知,但我很想進入ACME,能否直接進入考場參加考試?
- intent: faq/interview_arrangement
examples: |
- 面試什麼時候開始?會提前多少天通知面試安排?
- intent: faq/interview_times
examples: |
- 一般會安排幾次面試?
- intent: faq/interview_from
examples: |
- 面試的形式是怎樣的?是單獨面試還是小組面試?
- intent: faq/interview_clothing
examples: |
- 對面試的服裝有什麼具體的要求?
- intent: faq/interview_paperwork
examples: |
- 面試時需要攜帶什麼資料?
- intent: faq/interview_result
examples: |
- 如何查詢面試結果?
二.data/responses.yml檔案
主要是根據相關intent來進行相應的response。比如,utter_faq/notes的response對應於意圖faq/notes。如下所示:
version: "3.1"
responses:
utter_faq/notes:
- text: 1、登在校園招聘板塊內的職位資訊才適用於應屆畢業生招聘,請所有的應屆畢業生去校園招聘的版塊尋找您感興趣的職位。2、列出的每個職位的要求是該職位的最低要求,為了保證您應聘的成功率,希望您嚴格按照職位的要求考慮您的選擇。3、提交成功後,在招聘結束前,您將不能修改或再次提交簡歷,因此,請於仔細確認填寫資訊後提交簡歷。
utter_faq/work_location:
- text: 招聘資訊中包含各職位的工作地點內容,請參考各職位內容的詳細介紹。
utter_faq/max_job_request:
- text: 對於校園招聘,最多申請2個職位。
utter_faq/audit:
- text: 1、簡歷稽核:應聘者需要通過ACME網站,填寫並提交個人簡歷,ACME的招聘專員將對收取的簡歷進行認真的審查和篩選。瞭解應聘者的情況,並篩選出符合職位要求的簡歷,同時確認簡歷記載內容是否屬實。2、筆試稽核:ACME技術類測試主要針對應聘者的專業技能進行檢查和評價。3、面試稽核:經過實施評價應聘者基本素質的第一階段面試和評價專業知識的第二階段面試,對應聘者是否符合ACME人才理念以及應聘者的工作能力做出客觀的綜合評價,從而決定是否錄用該應聘者。
utter_faq/write_exam_participate:
- text: 通過簡歷稽核的應聘者,我們將採用簡訊、e-mail、ACME公告欄以及電話通知的方式告知您
utter_faq/write_exam_location:
- text: 筆試地點將根據您在簡歷中填寫的學校所在城市進行統籌安排
utter_faq/write_exam_again:
- text: 校園招聘的大規模的筆試僅安排一次,請收到筆試通知的同學認真對待筆試機會。
utter_faq/write_exam_with-out-offer:
- text: 由於我們是按照嚴格的招聘流程篩選出的筆試名單,所以非常抱歉,對於沒有收到筆試通知的同學,就不能參加本次校園招聘的筆試。
utter_faq/interview_arrangement:
- text: 不同的職位面試進度安排不同,除特殊安排外,筆試結束一週左右會安排面試。
utter_faq/interview_times:
- text: 一般情況下,業務部門和人力資源部會同時或者分別安排一次面試。個別特殊職位需要2次及以上的面試。
utter_faq/interview_from:
- text: 面試一般以單獨面試的形式進行,但根據各公司的面試安排,也會進行小組面試。
utter_faq/interview_clothing:
- text: 面試著裝沒有統一要求,但建議您儘量穿著較為正式的職業裝參加。
utter_faq/interview_paperwork:
- text: 面試時,請您攜帶可以證明您身份的有效證件,有特殊要求的職位請攜帶好能證明您專業水平的證書原件以及影印件。
utter_faq/interview_result:
- text: 我們會通過郵件或電話的形式,通知您面試結果。
三.data/stories.yml檔案
story即場景編排,如下所示:
version: "3.1"
stories:
- story: greet
steps:
- intent: greet
- action: utter_greet
- story: say goodbye
steps:
- intent: goodbye
- action: utter_goodbye
四.data/rules.yml檔案
定義了規則名"respond to FAQs",當檢索意圖是faq時,執行utter_faq,如下所示:
version: "3.1"
rules:
- rule: respond to FAQs
steps:
- intent: faq
- action: utter_faq
五.domain.yml檔案
該檔案主要包含intents、responses和actions等資訊,如下所示:
version: "3.1"
session_config:
session_expiration_time: 60
carry_over_slots_to_new_session: true
intents:
- goodbye
- greet
- faq
responses:
utter_greet:
- text: 你好,我是 Silly,我是一個基於 Rasa 的 FAQ 機器人
utter_goodbye:
- text: 再見!
utter_default:
- text: 系統不明白您說的話
actions:
- utter_goodbye
- utter_greet
- utter_default
- utter_faq
六.config.yml檔案
主要是pipeline和policies設定。前者基本思路是分詞、特徵化、意圖識別和實體抽取,後者定義各種策略。特別注意,FAQ機器人需要將ResponseSelector元件加入NLU的流水線,並且還需要啟用RulePolicy和設定rule(參考四.data/rules.yml檔案)。如下所示:
recipe: default.v1
language: "zh"
pipeline:
- name: JiebaTokenizer
- name: LanguageModelFeaturizer
model_name: "bert"
# model_weights: "bert-base-chinese"
model_weights: "L:/20230713_HuggingFaceModel/20231004_BERT/bert-base-chinese"
- name: "DIETClassifier"
epochs: 100
tensorboard_log_directory: ./log
learning_rate: 0.001
- name: "ResponseSelector"
policies:
- name: MemoizationPolicy
- name: TEDPolicy
- name: RulePolicy
assistant_id: 20231109-225257-frayed-branch
七.endpoints.yml檔案
action_endpoint、tracker_store和event_broker通常使用預設設定,如下所示:
# This file contains the different endpoints your bot can use.
# Server where the models are pulled from.
# https://rasa.com/docs/rasa/user-guide/running-the-server/#fetching-models-from-a-server/
#models:
# url: http://my-server.com/models/default_core@latest
# wait_time_between_pulls: 10 # [optional](default: 100)
# Server which runs your custom actions.
# https://rasa.com/docs/rasa/core/actions/#custom-actions/
action_endpoint:
url: "http://localhost:5055/webhook"
# Tracker store which is used to store the conversations.
# By default the conversations are stored in memory.
# https://rasa.com/docs/rasa/api/tracker-stores/
#tracker_store:
# type: redis
# url: <host of the redis instance, e.g. localhost>
# port: <port of your redis instance, usually 6379>
# db: <number of your database within redis, e.g. 0>
# password: <password used for authentication>
#tracker_store:
# type: mongod
# url: <url to your mongo instance, e.g. mongodb://localhost:27017>
# db: <name of the db within your mongo instance, e.g. rasa>
# username: <username used for authentication>
# password: <password used for authentication>
# Event broker which all conversation events should be streamed to.
# https://rasa.com/docs/rasa/api/event-brokers/
#event_broker:
# url: localhost
# username: username
# password: password
# queue: queue
八.模型訓練和執行Rasa伺服器
1.模型訓練
rasa train
2.執行Rasa伺服器
rasa run --cors "*"
3.開啟http server服務
python -m http.server
說明:測試FAQ機器人可以通過Web頁面,還可通過命令列rasa shell --debug。
九.PyCharm偵錯Rasa程式碼
1.Rasa中的DAG
Rasa中DAG圖節點可能是NLP元件,也可能是Policy元件,本質上都可以抽象為Graph Component。如下所示:
Rasa會把訓練過的Component快取到磁碟中,當某個Component發生變化的時候,比如CountVectorizer,只會把依賴CountVectorizer的元件(DIETClassifier、TEDPolicy和Policy Ensemble)再訓練,而其它的元件不變。如下所示:
2.PyCharm偵錯Rasa程式碼
PyCharm偵錯Rasa原始碼也比較方便,主要是設定指令碼路徑、引數和工作目錄,如下所示:
然後就可以偵錯訓練資料是如何被處理的,DAG是如何被構建的,Component是如何被載入和執行的,最終模型檔案是如何被儲存的等。Rasa中的fingerprint_key可能是唯一標識的意思。
3.rasa train nlu --debug紀錄檔
通過控制檯輸出紀錄檔,可輔助理解Rasa執行過程,以及原始碼偵錯,如下所示:
L:\20231106_ConversationSystem\20220407_RasaEcosystem\RasaBooks\RasaInAction\rasa_chinese_book_code\Chapter04\venv\Scripts\python.exe "D:/Program Files/JetBrains/PyCharm 2023.1.3/plugins/python/helpers/pydev/pydevd.py" --multiprocess --qt-support=auto --client 127.0.0.1 --port 38019 --file L:\20231106_ConversationSystem\20220407_RasaEcosystem\RasaBooks\RasaInAction\rasa_chinese_book_code\Chapter04\venv\Lib\site-packages\rasa\__main__.py train nlu --debug
Connected to pydev debugger (build 232.9559.58)
2023-11-10 23:24:32 DEBUG h5py._conv - Creating converter from 7 to 5
2023-11-10 23:24:32 DEBUG h5py._conv - Creating converter from 5 to 7
2023-11-10 23:26:17 DEBUG rasa.shared.nlu.training_data.loading - Training data format of 'data\nlu.yml' is 'rasa_yml'. # nul.yml檔案(rasa_yml資料格式)
2023-11-10 23:26:17 DEBUG rasa.shared.nlu.training_data.loading - Training data format of 'data\responses.yml' is 'rasa_yml'. # responses.yml檔案(rasa_yml資料格式)
2023-11-10 23:26:17 DEBUG rasa.shared.nlu.training_data.loading - Training data format of 'data\rules.yml' is 'unk'. # rules.yml檔案(unk資料格式)
2023-11-10 23:26:17 DEBUG rasa.shared.nlu.training_data.loading - Training data format of 'data\stories.yml' is 'unk'. # stories.yml檔案(unk資料格式)
2023-11-10 23:26:33 DEBUG rasa.telemetry - Skipping telemetry reporting: no license hash found. # 跳過telemetry報告:找不到許可證雜湊。
2023-11-10 23:27:24 DEBUG rasa.engine.training.graph_trainer - Starting training. # 開始訓練
2023-11-10 23:27:24 DEBUG rasa.engine.graph - Node 'train_JiebaTokenizer0' loading 'FingerprintComponent.create' and kwargs: '{}'. # train_JiebaTokenizer0
2023-11-10 23:27:24 DEBUG rasa.engine.graph - Node 'run_JiebaTokenizer0' loading 'FingerprintComponent.create' and kwargs: '{}'. # run_JiebaTokenizer0
2023-11-10 23:27:24 DEBUG rasa.engine.graph - Node 'run_LanguageModelFeaturizer1' loading 'FingerprintComponent.create' and kwargs: '{}'. # run_LanguageModelFeaturizer1
2023-11-10 23:27:24 DEBUG rasa.engine.graph - Node 'train_DIETClassifier2' loading 'FingerprintComponent.create' and kwargs: '{}'. # train_DIETClassifier2
2023-11-10 23:27:24 DEBUG rasa.engine.graph - Node 'train_ResponseSelector3' loading 'FingerprintComponent.create' and kwargs: '{}'. # train_ResponseSelector3
2023-11-10 23:27:24 DEBUG rasa.engine.training.graph_trainer - Running the train graph in fingerprint mode. # 在fingerprint模式下執行訓練圖。
2023-11-10 23:27:24 DEBUG rasa.engine.runner.dask - Running graph with inputs: {'__importer__': NluDataImporter}, targets: None and ExecutionContext(model_id=None, should_add_diagnostic_data=False, is_finetuning=False, node_name=None).
2023-11-10 23:27:24 DEBUG rasa.engine.graph - Node 'schema_validator' loading 'DefaultV1RecipeValidator.create' and kwargs: '{}'. # schema_validator
2023-11-10 23:27:24 DEBUG rasa.engine.graph - Node 'schema_validator' running 'DefaultV1RecipeValidator.validate'. # schema_validator
2023-11-10 23:27:24 DEBUG rasa.shared.nlu.training_data.training_data - Validating training data... # 驗證訓練資料...
2023-11-10 23:27:24 DEBUG rasa.engine.graph - Node 'finetuning_validator' loading 'FinetuningValidator.create' and kwargs: '{}'. # finetuning_validator
2023-11-10 23:27:24 DEBUG rasa.engine.graph - Node 'finetuning_validator' running 'FinetuningValidator.validate'. # finetuning_validator
2023-11-10 23:27:24 DEBUG rasa.engine.storage.local_model_storage - Resource 'finetuning_validator' was requested for writing. # finetuning_validator
2023-11-10 23:27:24 DEBUG rasa.engine.storage.local_model_storage - Resource 'finetuning_validator' was persisted. # finetuning_validator
2023-11-10 23:27:24 DEBUG rasa.engine.graph - Node 'nlu_training_data_provider' loading 'NLUTrainingDataProvider.create' and kwargs: '{}'. # nlu_training_data_provider
2023-11-10 23:27:24 DEBUG rasa.engine.graph - Node 'nlu_training_data_provider' running 'NLUTrainingDataProvider.provide'. # nlu_training_data_provider
2023-11-10 23:27:24 DEBUG rasa.shared.nlu.training_data.loading - Training data format of 'data\nlu.yml' is 'rasa_yml'. # nul.yml檔案(rasa_yml資料格式)
2023-11-10 23:27:25 DEBUG rasa.shared.nlu.training_data.loading - Training data format of 'data\responses.yml' is 'rasa_yml'. # responses.yml檔案(rasa_yml資料格式)
2023-11-10 23:27:25 DEBUG rasa.engine.graph - Node 'train_JiebaTokenizer0' running 'FingerprintComponent.run'. # train_JiebaTokenizer0
2023-11-10 23:27:25 DEBUG rasa.engine.training.fingerprinting - Calculated fingerprint_key '963f41cf1cdb9cadc8914a14e070fb8e' for class 'JiebaTokenizer'. # 計算類'JiebaTokenizer'的指紋金鑰
2023-11-10 23:27:25 DEBUG rasa.engine.graph - Node 'run_JiebaTokenizer0' running 'FingerprintComponent.run'. # run_JiebaTokenizer0
2023-11-10 23:27:25 DEBUG rasa.engine.training.fingerprinting - Calculated fingerprint_key 'ae36d2dae4cc78840b153d44fee8f81a' for class 'JiebaTokenizer'. # 計算類'JiebaTokenizer'的指紋金鑰
2023-11-10 23:27:25 DEBUG rasa.engine.graph - Node 'run_LanguageModelFeaturizer1' running 'FingerprintComponent.run'. # run_LanguageModelFeaturizer1
2023-11-10 23:27:25 DEBUG rasa.engine.training.fingerprinting - Calculated fingerprint_key 'f2bfce545dd2c1c12fb895b075954315' for class 'LanguageModelFeaturizer'. # 計算類'LanguageModelFeaturizer'的指紋金鑰
2023-11-10 23:27:25 DEBUG rasa.engine.graph - Node 'train_DIETClassifier2' running 'FingerprintComponent.run'. # train_DIETClassifier2
2023-11-10 23:27:25 DEBUG rasa.engine.training.fingerprinting - Calculated fingerprint_key '1d3616cf6980e5f0f38aa9ceb51f1e7a' for class 'DIETClassifier'. # 計算類'DIETClassifier'的指紋金鑰
2023-11-10 23:27:25 DEBUG rasa.engine.graph - Node 'train_ResponseSelector3' running 'FingerprintComponent.run'. # train_ResponseSelector3
2023-11-10 23:27:25 DEBUG rasa.engine.training.fingerprinting - Calculated fingerprint_key 'b91434757a05a4178cdc7f7882cfd9aa' for class 'ResponseSelector'. # 計算類'ResponseSelector'的指紋金鑰
2023-11-10 23:27:25 DEBUG rasa.engine.training.graph_trainer - Running the pruned train graph with real node execution. # 使用真實節點執行修剪的訓練圖。
2023-11-10 23:27:25 DEBUG rasa.engine.runner.dask - Running graph with inputs: {'__importer__': NluDataImporter}, targets: None and ExecutionContext(model_id=None, should_add_diagnostic_data=False, is_finetuning=False, node_name=None).
2023-11-10 23:27:25 DEBUG rasa.engine.graph - Hook 'LoggingHook.on_before_node' running for node 'nlu_training_data_provider'. # nlu_training_data_provider
2023-11-10 23:27:25 DEBUG rasa.engine.graph - Hook 'TrainingHook.on_before_node' running for node 'nlu_training_data_provider'. # nlu_training_data_provider
2023-11-10 23:27:25 DEBUG rasa.engine.training.fingerprinting - Calculated fingerprint_key '1fbfa24243412736ce1002efbeba382f' for class 'NLUTrainingDataProvider'. # 計算類'NLUTrainingDataProvider'的指紋金鑰
2023-11-10 23:27:25 DEBUG rasa.engine.graph - Node 'nlu_training_data_provider' loading 'PrecomputedValueProvider.create' and kwargs: '{}'. # nlu_training_data_provider
2023-11-10 23:27:25 DEBUG rasa.engine.graph - Node 'nlu_training_data_provider' running 'PrecomputedValueProvider.get_value'. # nlu_training_data_provider
2023-11-10 23:27:25 DEBUG rasa.engine.graph - Hook 'LoggingHook.on_after_node' running for node 'nlu_training_data_provider'. # nlu_training_data_provider
2023-11-10 23:27:25 DEBUG rasa.engine.graph - Hook 'TrainingHook.on_after_node' running for node 'nlu_training_data_provider'. # nlu_training_data_provider
2023-11-10 23:27:25 DEBUG rasa.engine.graph - Hook 'LoggingHook.on_before_node' running for node 'train_JiebaTokenizer0'. # train_JiebaTokenizer0
2023-11-10 23:27:25 INFO rasa.engine.training.hooks - Starting to train component 'JiebaTokenizer'. # 開始訓練元件'JiebaTokenizer'。
2023-11-10 23:27:25 DEBUG rasa.engine.graph - Hook 'TrainingHook.on_before_node' running for node 'train_JiebaTokenizer0'. # train_JiebaTokenizer0
2023-11-10 23:27:25 DEBUG rasa.engine.training.fingerprinting - Calculated fingerprint_key '963f41cf1cdb9cadc8914a14e070fb8e' for class 'JiebaTokenizer'. # 計算類'JiebaTokenizer'的指紋金鑰
2023-11-10 23:27:25 DEBUG rasa.engine.graph - Node 'train_JiebaTokenizer0' loading 'JiebaTokenizer.create' and kwargs: '{}'. # train_JiebaTokenizer0
2023-11-10 23:27:25 DEBUG rasa.engine.graph - Node 'train_JiebaTokenizer0' running 'JiebaTokenizer.train'. # train_JiebaTokenizer0
2023-11-10 23:27:25 DEBUG rasa.engine.graph - Hook 'LoggingHook.on_after_node' running for node 'train_JiebaTokenizer0'. # train_JiebaTokenizer0
2023-11-10 23:27:25 INFO rasa.engine.training.hooks - Finished training component 'JiebaTokenizer'. # 完成訓練元件'JiebaTokenizer'。
2023-11-10 23:27:25 DEBUG rasa.engine.graph - Hook 'TrainingHook.on_after_node' running for node 'train_JiebaTokenizer0'. # train_JiebaTokenizer0
2023-11-10 23:27:25 DEBUG rasa.engine.training.hooks - Caching 'Resource' with fingerprint_key: '963f41cf1cdb9cadc8914a14e070fb8e' and output_fingerprint '141a681b80024953b9b7865284b9fece'.
2023-11-10 23:27:25 DEBUG rasa.engine.storage.local_model_storage - Resource 'train_JiebaTokenizer0' was requested for reading. # train_JiebaTokenizer0
2023-11-10 23:27:25 DEBUG rasa.engine.storage.resource - Skipped caching resource 'train_JiebaTokenizer0' as no persisted data was found. # 跳過快取資源'train_JiebaTokenizer0',因為找不到持久化資料。
2023-11-10 23:27:25 DEBUG rasa.engine.caching - Caching output of type 'Resource' succeeded. # 快取型別為'Resource'的輸出成功。
2023-11-10 23:27:26 DEBUG rasa.engine.graph - Hook 'LoggingHook.on_before_node' running for node 'run_JiebaTokenizer0'. # run_JiebaTokenizer0
2023-11-10 23:27:26 DEBUG rasa.engine.graph - Hook 'TrainingHook.on_before_node' running for node 'run_JiebaTokenizer0'. # run_JiebaTokenizer0
2023-11-10 23:27:26 DEBUG rasa.engine.training.fingerprinting - Calculated fingerprint_key '496a8741f1dfb458bbfedb535d343623' for class 'JiebaTokenizer'. # 計算類'JiebaTokenizer'的指紋金鑰
2023-11-10 23:27:26 DEBUG rasa.engine.graph - Node 'run_JiebaTokenizer0' loading 'JiebaTokenizer.load' and kwargs: '{'resource': Resource(name='train_JiebaTokenizer0', output_fingerprint='141a681b80024953b9b7865284b9fece')}'.
2023-11-10 23:27:26 DEBUG rasa.engine.graph - Node 'run_JiebaTokenizer0' running 'JiebaTokenizer.process_training_data'. # run_JiebaTokenizer0
# jieba分詞
Building prefix dict from the default dictionary ...
2023-11-10 23:27:26 DEBUG jieba - Building prefix dict from the default dictionary ...
Loading model from cache C:\Users\ADMINI~1\AppData\Local\Temp\jieba.cache
2023-11-10 23:27:26 DEBUG jieba - Loading model from cache C:\Users\ADMINI~1\AppData\Local\Temp\jieba.cache
Loading model cost 1.116 seconds.
2023-11-10 23:27:27 DEBUG jieba - Loading model cost 1.116 seconds.
Prefix dict has been built successfully.
2023-11-10 23:27:27 DEBUG jieba - Prefix dict has been built successfully.
2023-11-10 23:27:27 DEBUG rasa.engine.graph - Hook 'LoggingHook.on_after_node' running for node 'run_JiebaTokenizer0'.
2023-11-10 23:27:27 DEBUG rasa.engine.graph - Hook 'TrainingHook.on_after_node' running for node 'run_JiebaTokenizer0'.
2023-11-10 23:27:27 DEBUG rasa.engine.training.hooks - Caching 'TrainingData' with fingerprint_key: '496a8741f1dfb458bbfedb535d343623' and output_fingerprint '1baa8435dc0351e013e3b8f3635e83d6'.
2023-11-10 23:27:27 DEBUG rasa.engine.graph - Hook 'LoggingHook.on_before_node' running for node 'run_LanguageModelFeaturizer1'.
2023-11-10 23:27:27 DEBUG rasa.engine.graph - Hook 'TrainingHook.on_before_node' running for node 'run_LanguageModelFeaturizer1'.
2023-11-10 23:27:27 DEBUG rasa.engine.training.fingerprinting - Calculated fingerprint_key 'de5a4adf999a20fb8e5716903003508c' for class 'LanguageModelFeaturizer'.
2023-11-10 23:27:27 DEBUG rasa.engine.graph - Node 'run_LanguageModelFeaturizer1' loading 'LanguageModelFeaturizer.load' and kwargs: '{}'.
2023-11-10 23:27:28 DEBUG rasa.nlu.featurizers.dense_featurizer.lm_featurizer - Loading Tokenizer and Model for bert
2023-11-10 23:27:32 DEBUG rasa.engine.graph - Node 'run_LanguageModelFeaturizer1' running 'LanguageModelFeaturizer.process_training_data'.
2023-11-10 23:27:41 DEBUG rasa.engine.graph - Hook 'LoggingHook.on_after_node' running for node 'run_LanguageModelFeaturizer1'.
2023-11-10 23:27:41 DEBUG rasa.engine.graph - Hook 'TrainingHook.on_after_node' running for node 'run_LanguageModelFeaturizer1'.
2023-11-10 23:27:41 DEBUG rasa.engine.training.hooks - Caching 'TrainingData' with fingerprint_key: 'de5a4adf999a20fb8e5716903003508c' and output_fingerprint '1192d8329eb2a6d87f6e965765d10871'.
2023-11-10 23:27:41 DEBUG rasa.engine.graph - Hook 'LoggingHook.on_before_node' running for node 'train_DIETClassifier2'.
2023-11-10 23:27:41 INFO rasa.engine.training.hooks - Starting to train component 'DIETClassifier'.
2023-11-10 23:27:41 DEBUG rasa.engine.graph - Hook 'TrainingHook.on_before_node' running for node 'train_DIETClassifier2'.
2023-11-10 23:27:41 DEBUG rasa.engine.training.fingerprinting - Calculated fingerprint_key '7d66b69a551ffbc2a45237a02ffc5aa7' for class 'DIETClassifier'.
2023-11-10 23:27:41 DEBUG rasa.engine.graph - Node 'train_DIETClassifier2' loading 'DIETClassifier.create' and kwargs: '{}'.
2023-11-10 23:27:41 DEBUG rasa.engine.graph - Node 'train_DIETClassifier2' running 'DIETClassifier.train'.
2023-11-10 23:27:41 DEBUG rasa.nlu.classifiers.diet_classifier - No label features found. Computing default label features.
2023-11-10 23:27:41 DEBUG rasa.nlu.classifiers.diet_classifier - You specified 'DIET' to train entities, but no entities are present in the training data. Skipping training of entities.
2023-11-10 23:27:42 DEBUG rasa.nlu.classifiers.diet_classifier - Following metrics will be logged during training:
2023-11-10 23:27:42 DEBUG rasa.nlu.classifiers.diet_classifier - t_loss (total loss)
2023-11-10 23:27:42 DEBUG rasa.nlu.classifiers.diet_classifier - i_acc (intent acc)
2023-11-10 23:27:42 DEBUG rasa.nlu.classifiers.diet_classifier - i_loss (intent loss)
2023-11-10 23:27:42 DEBUG rasa.utils.tensorflow.data_generator - The provided batch size is a list, this data generator will use a linear increasing batch size.
Epochs: 0%| | 0/100 [00:00<?, ?it/s]
Epochs: 100%|██████████| 100/100 [01:26<00:00, 1.15it/s, t_loss=0.258, i_loss=0.0123, i_acc=1]
2023-11-10 23:29:09 DEBUG rasa.engine.storage.local_model_storage - Resource 'train_DIETClassifier2' was requested for writing.
2023-11-10 23:29:09 DEBUG rasa.engine.storage.local_model_storage - Resource 'train_DIETClassifier2' was persisted.
2023-11-10 23:29:09 DEBUG rasa.engine.graph - Hook 'LoggingHook.on_after_node' running for node 'train_DIETClassifier2'.
2023-11-10 23:29:09 INFO rasa.engine.training.hooks - Finished training component 'DIETClassifier'.
2023-11-10 23:29:09 DEBUG rasa.engine.graph - Hook 'TrainingHook.on_after_node' running for node 'train_DIETClassifier2'.
2023-11-10 23:29:09 DEBUG rasa.engine.training.hooks - Caching 'Resource' with fingerprint_key: '7d66b69a551ffbc2a45237a02ffc5aa7' and output_fingerprint '9a50714386a54eebbd0b5eb4ab2fd23c'.
2023-11-10 23:29:09 DEBUG rasa.engine.storage.local_model_storage - Resource 'train_DIETClassifier2' was requested for reading.
2023-11-10 23:29:09 DEBUG rasa.engine.caching - Caching output of type 'Resource' succeeded.
2023-11-10 23:29:11 DEBUG rasa.engine.graph - Hook 'LoggingHook.on_before_node' running for node 'train_ResponseSelector3'.
2023-11-10 23:29:11 INFO rasa.engine.training.hooks - Starting to train component 'ResponseSelector'.
2023-11-10 23:29:11 DEBUG rasa.engine.graph - Hook 'TrainingHook.on_before_node' running for node 'train_ResponseSelector3'.
2023-11-10 23:29:11 DEBUG rasa.engine.training.fingerprinting - Calculated fingerprint_key '0e102b0ba0b459b1556ae9eb4aaac987' for class 'ResponseSelector'.
2023-11-10 23:29:11 DEBUG rasa.engine.graph - Node 'train_ResponseSelector3' loading 'ResponseSelector.create' and kwargs: '{}'.
2023-11-10 23:29:11 DEBUG rasa.engine.graph - Node 'train_ResponseSelector3' running 'ResponseSelector.train'.
2023-11-10 23:29:11 INFO rasa.nlu.selectors.response_selector - Retrieval intent parameter was left to its default value. This response selector will be trained on training examples combining all retrieval intents.
2023-11-10 23:29:11 DEBUG rasa.nlu.classifiers.diet_classifier - No label features found. Computing default label features.
2023-11-10 23:29:11 DEBUG rasa.nlu.selectors.response_selector - Following metrics will be logged during training:
2023-11-10 23:29:11 DEBUG rasa.nlu.selectors.response_selector - t_loss (total loss)
2023-11-10 23:29:11 DEBUG rasa.nlu.selectors.response_selector - r_acc (response acc)
2023-11-10 23:29:11 DEBUG rasa.nlu.selectors.response_selector - r_loss (response loss)
2023-11-10 23:29:11 DEBUG rasa.utils.tensorflow.data_generator - The provided batch size is a list, this data generator will use a linear increasing batch size.
Epochs: 100%|██████████| 300/300 [00:39<00:00, 7.55it/s, t_loss=2.93, r_loss=1.17, r_acc=1]
2023-11-10 23:29:51 DEBUG rasa.engine.storage.local_model_storage - Resource 'train_ResponseSelector3' was requested for writing.
2023-11-10 23:29:51 DEBUG rasa.engine.storage.local_model_storage - Resource 'train_ResponseSelector3' was persisted.
2023-11-10 23:29:51 DEBUG rasa.engine.storage.local_model_storage - Resource 'train_ResponseSelector3' was requested for writing.
2023-11-10 23:29:51 DEBUG rasa.engine.storage.local_model_storage - Resource 'train_ResponseSelector3' was persisted.
2023-11-10 23:29:51 DEBUG rasa.engine.graph - Hook 'LoggingHook.on_after_node' running for node 'train_ResponseSelector3'.
2023-11-10 23:29:51 INFO rasa.engine.training.hooks - Finished training component 'ResponseSelector'.
2023-11-10 23:29:51 DEBUG rasa.engine.graph - Hook 'TrainingHook.on_after_node' running for node 'train_ResponseSelector3'.
2023-11-10 23:29:51 DEBUG rasa.engine.training.hooks - Caching 'Resource' with fingerprint_key: '0e102b0ba0b459b1556ae9eb4aaac987' and output_fingerprint '300fbcfe9f004bf2a6870e283e7b4f92'.
2023-11-10 23:29:51 DEBUG rasa.engine.storage.local_model_storage - Resource 'train_ResponseSelector3' was requested for reading.
2023-11-10 23:29:51 DEBUG rasa.engine.caching - Caching output of type 'Resource' succeeded.
2023-11-10 23:29:51 DEBUG rasa.engine.storage.local_model_storage - Start to created model package for path 'models\nlu-20231110-232632-arid-seasoning.tar.gz'.
2023-11-10 23:29:58 DEBUG rasa.engine.storage.local_model_storage - Model package created in path 'models\nlu-20231110-232632-arid-seasoning.tar.gz'.
Your Rasa model is trained and saved at 'models\nlu-20231110-232632-arid-seasoning.tar.gz'.
2023-11-10 23:29:58 DEBUG rasa.telemetry - Skipping telemetry reporting: no license hash found.
Process finished with exit code 0
參考文獻:
[1]《Rasa實戰》