# 分工 1. 郁蓁:任務簡介 2. 翊涵:第一次資料清理 *強調遇到的問題 3. 星如:第一次模型分數+輸出結果分析+下次修正方向 4. 先悅:第二次資料搜集(rule-based+傳記) 5. 心穎:第二次模型分數+輸出結果分析+下次修正方向 6. 銘杉:第三次模型修正方向+第三次模型分數 7. 郁蓁:未來展望 # 報告大綱 ## 郁蓁 #### 1. 設計模型的動機: 模型找出別名後,可以藉由這些別名來蒐集該人物的相關史料。 #### 2. 任務概述: 輸入古人的本名,可查詢到其他別名。 ## 翊涵 #### 1. 第一次資料清理 ## 星如 #### 1. 第一次模型分數解釋 #### 2. 輸出結果分析、下次修正方向 ## 先悅 #### 1. 第二次資料搜集 ## 心穎 #### 1. 第二次模型分數 #### 2. 輸出結果分析 #### 3. 修正方向 ## 銘杉 #### 1. 第三次模型修正方向 #### 2. 第三次模型分數 ## 郁蓁 #### 1. 未來展望 # 專案進程 ### 第一週(10/31):CP 資料搜集 * 資料來源:CBDB(中國歷代人物傳記資料庫) * 數據的準確性和權威性較高 * 資料格式結構化明確 * 數據清理:(附上截圖,老師說院長愛看程式XD) * 清理 74580 筆資料 * 輸出 17866 筆資料 ### 第二週(11/7):FT資料 * 是否使用人物特徵? 「人物特徵」主要是為了區別異人同名的情況。但經試算,異人同名的情況僅有 5%,擁有同個名字的,最多只有 6 個不同的人。故最後決定將異人同名用 / 符號 區隔開來,放在同一個 output 中,讓使用者參考所有同名人物的別名。 ### 第三週(11/14):CP 資料重整 * CBDB 原始資料的問題 * 別名欄位中出現亂碼、無意義別名(如「某某某」)。 * 別名中包含多餘標記或不符合使用者搜尋習慣的條目(如「XX妃、XX妻」)。 * -> 正規表達式清理 * **第一次訓練結果** ``` (alias_output) 全部加起來後的 Precision: 0.75 Recall: 0.49 F1 Score: 0.59 每一步算完取平均 Average Precision: 0.84 Average Recall: 0.63 Average F1 Score: 0.68 Exact Match Accuracy: 0.31 Total True Positives (TP): 116 Total False Positives (FP): 39 Total False Negatives (FN): 123 Error Count: 0 Error Ratio: 0.00 (alias_baseline) 全部加起來後的 Precision: 1.00 Recall: 0.46 F1 Score: 0.63 每一步算完取平均 Average Precision: 1.00 Average Recall: 0.63 Average F1 Score: 0.73 Exact Match Accuracy: 0.38 Total True Positives (TP): 111 Total False Positives (FP): 0 Total False Negatives (FN): 128 Error Count: 0 Error Ratio: 0.00 ``` **問題分析:** 1. 正史沒有的別名模型找不到 `{"model_output": ["徐堅"], "expected_output": ["徐堅、元固"]}` **但正史有的字號、諡號也找不到。** `{"model_output": ["潘孟陽"], "expected_output": ["潘孟陽、康"]}` --- 2. 模型若產生CBDB沒有的別名,皆為幻覺 ` {"model_output": ["房琯、房彥藻"], "expected_output": ["房琯、次律"]} ` (房彥藻是另一個唐代人) --- 3. 若模型有找出正確的別名,都是非常有名的人物 * 元稹、王勃、杜甫等等 * 杜甫找出的別名最多,且皆為正確 * 不確定 TAIDE 的訓練程度,因此若計算「杜甫」這種有名的人,可能模型本來就會了。計算杜甫在 cp 資料中和別名綁定幾次,不一定有參考度。 -> 必須跟助教來回更正訓練次數,直到分數達一定程度。第二次訓練複製 20 次,第三次複製 50 次。 ### 第四週 (11/21) Silver Test Set 修正 : 唐、明100筆。 * 多別名人物與少別名人物符合CP資料比例(第二週試算過) * 確保本名跟別名都有出現 * 補上傳記 ### 第五週(11/29) * 重新整理 cp 資料集,複製傳記數十次,嘗試增強模型記憶 : 把兩萬七千筆資料用 rule base + Gemini 生成傳記,複製數十次,達到人物別名多次重複的效果。(解釋為何用rule base) **第二次模型訓練結果** ``` 1. gold (test_gold_output) 全部加起來後的 Precision: 0.56 Recall: 0.65 F1 Score: 0.60 每一步算完取平均 Average Precision: 0.64 Average Recall: 0.74 Average F1 Score: 0.66 Exact Match Accuracy: 0.22 Total True Positives (TP): 127 Total False Positives (FP): 98 Total False Negatives (FN): 68 Error Count: 0 Error Ratio: 0.00 (test_gold_baseline) 全部加起來後的 Precision: 1.00 Recall: 0.52 F1 Score: 0.68 每一步算完取平均 Average Precision: 1.00 Average Recall: 0.66 Average F1 Score: 0.75 Exact Match Accuracy: 0.41 Total True Positives (TP): 101 Total False Positives (FP): 0 Total False Negatives (FN): 94 Error Count: 0 Error Ratio: 0.00 2. silver (test_silver_output) 全部加起來後的 Precision: 0.57 Recall: 0.48 F1 Score: 0.52 每一步算完取平均 Average Precision: 0.73 Average Recall: 0.60 Average F1 Score: 0.61 Exact Match Accuracy: 0.19 Total True Positives (TP): 1002 Total False Positives (FP): 769 Total False Negatives (FN): 1079 Error Count: 0 Error Ratio: 0.00 (test_silver_baseline) 全部加起來後的 Precision: 1.00 Recall: 0.48 F1 Score: 0.64 每一步算完取平均 Average Precision: 1.00 Average Recall: 0.60 Average F1 Score: 0.71 Exact Match Accuracy: 0.32 Total True Positives (TP): 989 Total False Positives (FP): 0 Total False Negatives (FN): 1092 Error Count: 0 Error Ratio: 0.00 ``` 第三次模型訓練結果 ``` 1. cp50_test_gold_output 全部加起來後的 Precision: 0.51 Recall: 0.64 F1 Score: 0.57 每一步算完取平均 Average Precision: 0.63 Average Recall: 0.73 Average F1 Score: 0.64 Exact Match Accuracy: 0.23 Total True Positives (TP): 124 Total False Positives (FP): 119 Total False Negatives (FN): 71 Error Count: 0 Error Ratio: 0.00 2. cp50_test_silver_output 全部加起來後的 Precision: 0.62 Recall: 0.49 F1 Score: 0.55 每一步算完取平均 Average Precision: 0.76 Average Recall: 0.61 Average F1 Score: 0.62 Exact Match Accuracy: 0.19 Total True Positives (TP): 1018 Total False Positives (FP): 633 Total False Negatives (FN): 1063 Error Count: 0 Error Ratio: 0.00 3. first_train_test_gold_output 全部加起來後的 Precision: 0.67 Recall: 0.58 F1 Score: 0.62 每一步算完取平均 Average Precision: 0.78 Average Recall: 0.70 Average F1 Score: 0.70 Exact Match Accuracy: 0.28 Total True Positives (TP): 114 Total False Positives (FP): 57 Total False Negatives (FN): 81 Error Count: 0 Error Ratio: 0.00 4. first_train_test_silver_output 全部加起來後的 Precision: 0.74 Recall: 0.48 F1 Score: 0.58 每一步算完取平均 Average Precision: 0.86 Average Recall: 0.60 Average F1 Score: 0.66 Exact Match Accuracy: 0.25 Total True Positives (TP): 989 Total False Positives (FP): 350 Total False Negatives (FN): 1092 Error Count: 0 Error Ratio: 0.00 ``` **問題分析:** (待補) # 心得 (待補) > 紙上得來終覺淺,絕知此事要躬行。(謝謝詩淇助教提供XD)