第二節 實驗一參數設定
一、 演算法參數設定
為了證明本論文提出的演算法能正確匹配到相對應的句子,本論文會 事先移除標點符號,並計算演算法抽取的句子與匹配的投影檔句子之間的 重疊字詞,並累加所有重疊字詞除投影檔之總字詞數,得出最後正確重疊 字詞結果,公式如下:
Match(演算法抽取的句子字詞,匹配對應的投影檔句子字詞)
投影檔總字詞數 (13)
由表 4-2 結果顯示,當 Pcr起始值等於 0.8 時,正確字詞數比例達 56.29%,
較具有懲罰文字稿長句子的能力,具有最高的正確比例,因此後續研究固 定設定 Pcr為 0.8。我們進一步實驗是否只需移除標點符號還是必須移除停 用字才能足以正確的匹配句子,由表 4-3 結果顯示,如只透過移除標點符號 匹配句子之正確率會持續下降,原因在於只使用移除標點符號就進行匹配,
則可能會發生匹配到停用字的誤差,導致標記錯誤類別,因此證明移除停 用字比起移除標點符號進行匹配句子更能準確的匹配到句子,後續研究只 考量移除停用字進行句子間的匹配。有時文字稿長句子能匹配到多個投影 檔句子,本論文設定取多個句子的演算法,如表 4-4 結果顯示,當 Pcr >目 前 Pcr + 0.15 之規則時,具有最高 57.54%的正確字詞數比例。綜合上述研究 結果,本論文設定 Pcr起始值為 0.8,只考量移除停用字進行句子匹配及 Pcr >
目前 Pcr + 0.15 作為演算法的參數設定。
表 4-2 Pcr起始值之參數設定
Pcr起始值 Pcr<=?時,移除停用字 匹配多個句子演算法 正確率
Pcr起始值 Pcr<=?時,移除停用字 匹配多個句子演算法 正確率 具有深遠的影響。過去的方法大多用經驗法則(Boger & Guterman 1997),或 土法煉鋼的方式來實現,現存的方法仍未有確切的方式來決定(Mas & Flores
2008)。本論文採用 5 次交叉驗證的方法來實驗,由圖 4-1 結果顯示,當模
welcome everyone to this first lecture of the course on audio signal processing for music applications
in this first lecture i want to introduce a few practical things related with the course
the first one is to introduce ourselves
professor julius smith he's a professor at stanford university at the center for computer research in music and acoustics
under whom i did my phd quite a few years ago
and from whom i learned most of the things i know on audio signal processing and myself my name is xavier serra and i teach at the pompeu fabra in barcelona universityand i lead a research group in music technology
and we have two teaching assistants in the course
despite these pictures we are definitely not professional performers but we are definitely music lovers
2. 移除停用字資料集。內容如表 4-6 所示:
表 4-6 移除停用字資料集之文字稿內容例子 文字稿內容
welcome everyone first lecture course audio signal processing music applications
first lecture want introduce few practical things related course first one introduce
professor julius smith professor stanford university center computer research music acoustics
under phd quite few years ago
from learned most things know audio signal processing name xavier serra teach pompeu fabra university
lead research group music technology two teaching assistants course
pictures definitely professional performers definitely music lovers
表 4-7、4-8 的結果顯示,預處理的執行時間約花費 14 秒,是因此階段
需將原始文字稿之句子做移除停用字,此階段花費的比起不移除停用字資 料集來的費時,因此最後生成摘要時間處理的較慢。
在設定相同參數時,因資料量大小的差異,不移除停用字資料集在模 型訓練會比移除停用字資料集來的久,雖然訓練時間相對較長,但是增加 些許時間就能進一步區別不同類別的特徵,能達到更高的 ROC 值與 ROUGE 值結果。因使用 LSTM 訓練出的模型是具有長時間範圍內的記憶功能,如 使用移除停用字資料集作為訓練,其模型較無法分辨每個序列向量之間的 區別,導致各類別特徵可能存在著模糊地帶的疑慮,進一步抽取各類別特 徵來識別於驗證集的句子上,是不足以區別不同的類別標籤。因此不移除 停用字資料集較適合作為深度神經網路語言模型的輸入資料集。
此外,若使用不移除停用字資料集中,隨機梯度下降(SGD)最佳化演算 法之 ROUGE 值結果顯示低於 Conjugate Gradient 最佳化演算法,但 ROC 值表現較好一點。因 ROC 值表現較好的參數,能夠判區分句子為正確的類 別標籤,因此得到較好的結果,且本論文進一步限制抽取摘要的字詞數上 限,因此透過句子被預測為摘要句的機率值進行降冪排序,在平均 ROUGE 值表現較好的參數中,分數較高的句子與投影檔的字詞數之重疊字詞比率 較高,造成計算出的平均 ROUGE 值較低。因 ROUGE 結果與 ROC 值並未 相差太多,且設定 SGD 來訓練模型所平均花費的時間約 80 秒,而 Conjugate Gradient 則需 325 秒,將近相差 4 倍,因此本論文設定最佳化演算法為 SGD。
表 4-7 移除停用字資料集之 5 次交叉驗證平均結果(%、秒)
表 4-9 不同資料集產生一門新課程摘要的執行時間(秒)
總處理時間 評估時間 生成摘要時間
不移除停用字資料集 190 37 0.818
移除停用字資料集 185 27 1.171
備註:粗體表示為最佳值
綜合上述研究結果,雖然不移除停用字資料集評估時間較久,但多增 加些許時間就能區別不同類別的特徵,得到較高的 ROUGE 值與 ROC 值,
因此本研究後續研究只探討不移除停用字資料集作為輸入模型的資料集,
隱藏層設為 2 層,最佳演算法參數設為 SGD,學習率參數則為 1E-4。
第三節 實驗二不同摘要器之結果比較
以往的研究難以評估模型是否為好的模型,原因在於兩兩模型之間並 無存在一個評判的標準,無法直接做之間的比較。本論文探討質化分析(如:
句意是否完整、重點是否都有涵蓋)和量化分析(ROUGE)來評估不同摘要器 的優劣。
一、 質化分析
以 Beginning Game Programming with C 的 3.5 章節為例,其投影片內容 如表 4-10 所示:
表 4-10 投影檔內容 投影片內容 Lecture Selection : Switch Statements
Last time , we talked about how we can use the various forms of the if statement to make decisions in our programs
This time , we'll look at how we can use another statement - - the switch statement
- - to make decisions
Another statement we'll use to perform selection in our C# code is the A : else statement
B : switch statement C : witch statement D : warlock statement
Start IDE and open Console App project
Read in a your n from the user and print a message if they say y ( using a switch statement )
Add clause for a n message Add default clause
Recap We discussed how to use the switch statement to select what our program does
Next Time We'll discuss various applications of the selection construct in our games 線上摘要器 Auto Summarizer 能還原英文大小寫,Free Summarizer、
Tools4noobs 之線上摘要器並無此功能。
以 Beginning Game Programming with C 的 3.5 章節為例,LSTM 所產生 的摘要內容如表 4-11 所示;TF-ISF 所產生的摘要內容如表 4-12 所示;Auto Summarizer 所產生的摘要內容如表 4-13 所示;Free Summarizer 所產生的摘 要內容如表 4-14 所示;Tools4noobs 所產生的摘要內容如表 4-15 所示。
表 4-11 LSTM 之深度網路語言模型所產生的摘要內容 擷取摘要內容如下
In this lecture , we're continuing our discussion of the selection control structure .
This time , we're going to look at another C# statement we can use to implement the selection control structure in C# .
And the way the switch statement works is we type the word switch , which is a keyword .
Other programming languages let you do that .
So it turns out , that we can list multiple cases , multiple values for the answer variable in this particular case that will do this stuff here .
Still showing you that y works in both cases .
Where it figures out which of these things matches , if you will , and does the appropriate stuff inside .
An enumeration is basically a data type that has specific values . We'll look at enumerations and see how they all work so ,
表 4-12 TF-ISF 所產生的摘要內容 擷取摘要內容如下
This time , we're going to look at another C# statement we can use to implement the selection control structure in C# .
So it turns out , that we can list multiple cases , multiple values for the answer variable in this particular case that will do this stuff here .
And so , if I just stack these values like this , then I can check both answer being lower case y and the answer being upper case y .
I'll point out that I cannot down here decide , oh I want to do another thing with lower case y , because that has already been included .
And , we're still going to have to add a break , because we add a break at the end of every clause we include in a switch statement .
表 4-13 Auto Summarizer 所產生的摘要內容 擷取摘要內容如下
That statement is called the switch statement .
That error message says we can't fall through from this case to other cases . So it turns out , that we can list multiple cases , multiple values for the answer variable in this particular case that will do this stuff here .
And so , if I just stack these values like this , then I can check both answer being lower case y and the answer being upper case y .
Because we sure don't want to have to say , case a , case , upper case A , case b , all of the other possible characters that are not y or n .
表 4-14 Free Summarizer 所產生的摘要內容 擷取摘要內容如下
So the new statement we're looking at is the switch statement .
And the way the switch statement works is we type the word switch , which is a keyword .
So we have case , lower case y .
And that error message says we can't fall through from this case to other cases . So it turns out , that we can list multiple cases , multiple values for the answer variable in this particular case that will do this stuff here .
And so , if I just stack these values like this , then I can check both answer being lower case y and the answer being upper case y .
Because we sure don't want to have to say , case a , case , upper case A , case b , all of the other possible characters that are not y or n .
I'm going to have you , if you do the optional lab , I'm going to have you do some practice with both if statements and switch statements , because they're both useful tools for selection .
表 4-15 Tools4noobs 所產生的摘要內容 擷取摘要內容如下
So , you might wonder why we care ? If we already have this if else , if else structure , why would we want a switch statement instead ? And it turns out that I covered it here because it's sort of the other statement we use for selection in C# .
And , we're still going to have to add a break , because we add a break at the end of every clause we include in a switch statement .
Because we sure don't want to have to say , case a , case , upper case A , case 與 Free Summarizer 摘要器只有直接提到關鍵工具名稱,並未提到此章節想 表達的意義,較無法直接聯想到投影檔的涵義。而 Tools4noobs 因並未將生 成摘要依照原始文字稿句子順序重新排序,會造成前後文內容毫無頭緒的
情形發生,是 5 種摘要器中較為不好的摘要器。但單單透過質化分析來證 明模型是否優劣是不夠堅固的,仍必須進一步透過量化分析(ROUGE 表現) 才能證明何者模型表現是最好的。
二、 量化分析
本實驗目的會與黃喬(2016)LDA 主題模型,以及 Auto Summarizer、Free Summarizer、Tools4noobs 之線上開放原始碼摘要法模型進行比較,透過客
Perplexity 提示詞 TF 正 規化 章節數提示詞次數 Perplexity 提示詞次數 Chapter 數提示詞
*TF *TF 次數*TF
TF 0.3282 0.3273 0.3253
TF-ISF 0.3267 0.3281 0.3256
TF-SF 0.3239 0.3252 0.3222
平均 F1 值
TF 0.3247
TF-ISF 0.3252
TF-SF 0.3195
備註:粗體表示為最高值 資料來源:黃喬(2016)
由不同摘要器所產生的摘要結果,並與投影片進行比對計算 ROUGE-1、
ROUGE-2、ROUGE-3,以探討摘要擷取效能。我們設定擷取摘要的句子數 上限比較不同摘要器的優劣,因線上摘要器 Free Summarizer 無法設定句子 上限,及 Auto Summarizer 內部設定 5 個句子產生 1 個句子、10 個句子產生 2 個句子的方法,無法保證能依照不同上限句子的規則來產生摘要,如加入 探討可能會有疑慮,因此兩者並未做進一步的探討。
透過表 4-17 結果顯示,TF-ISF 所擷取的字詞數為最高,LSTM 則為最
透過表 4-17 結果顯示,TF-ISF 所擷取的字詞數為最高,LSTM 則為最