• 沒有找到結果。

在二十世紀,西方的標點符號傳入中國之前,中文的書寫,並沒有使用標點 符號的習慣。自古以來,絕大多數的漢語的典籍,段落與段落之間有所分隔,同 一段落內的文字,則串連在一起,沒有任何分隔句子和子句的符號。因此,斷句 的工作,或稱為「句讀」,必須交由讀者,在閱讀典籍時自行判斷。然而,斷句 並沒有固定的章法,也沒有明確的規則可循,全憑讀者依賴經驗和語感判定。因 此,面對同一篇文本,不同的讀者,往往有不同的斷法,而不同斷法,影響了讀 者對文義的理解。由此可知,古漢語斷句是閱讀古籍時,困難而重要的第一步驟。 

儘管諸多古文典籍,在今天都已經有經過斷句和標點的版本,但其實仍然有 更多古漢語文獻,至今尚未經過斷句作業。目前有許多數位典藏計劃,利用文字 辨識的技術,將紙本上的古漢語文本數位化,然而,斷句的工作,仍然必須交付 專人,耗費極鉅的精力和時間處理。因此,如果有自動化的古漢語斷句工具,快 速準確的為大批古文獻斷句,將能大幅減省時間和人力,並將整個數位藏典,文 獻處理的流程,推向全自動化的理想。 

 

在本研究中,我提出了自動化古漢語斷句的可能,並從相關領域中,找尋適 當的素材和工具,實現了古漢語斷句系統。在探索斷句問題的過程當中,我處理 了三個子問題。第一,為古漢語斷句系統的效能評量,尋找適當的評估指標。第 二,蒐集上古漢語語料,並透過實驗,驗證這些語料作為training data 的效能。

第三,將斷句的問題,轉化為序列標記的問題,再使用hidden Markov models 和conditional random fields 這兩種序列標記模型,以統計式的方法設計古漢語 斷句系統。 

 

我從自然語言處理、機器學習、資料探勘、樣式辨識等相關領域中,提取可

能合適的評估方式。然後,在實驗之中,實際審核這些指標對斷句成果的評估能 力。最後,挑選specificity、f‐measure、NIST‐SU error rate 等三項作為斷句研究 的主要評估指標,並以ROC curves 比較多個斷句模型的效能。 

 

為了簡化問題的複雜性,我鎖定上古漢語的文本,作為斷句系統的datasets。

這些datasets 同時具備 training data 和 test data 的功用,必須有足夠的數量和 相當的代表性,才能訓練出一般化的斷句模型,適用在各種文本上。在本研究中,

我蒐集七種上古漢語的典經文本,逐一測驗這些文本作為training data 的效能。

其中,司馬遷的《史記》有最佳的成效,以《史記》訓練出來的模型,對其他文 本都有不錯的效能表現。 

在上古漢語之外,我和台大資工數位典藏與自動推論實驗室合作,取得一批 經過專人校對標點的清代奏摺。我將這批奏摺視為特殊的dataset,與其他上古 漢語文本比對。在實驗中發現,適用於上古漢語的斷句架構,如果改以清代的 dataset 作訓練,也能適用在近代漢語上,而且有不錯的斷句效能。由此推論,

本研究提出的斷句模型,有跨時代的適用性,只要配合恰當的training data,就 能處理各時代的文本,並不侷限於上古漢語。 

雖然模型可以適用各時代的文本,然而在實驗中也發現,training data 會受 時代的侷限。《史記》對上古漢語的文本來說,是很好的training data,但卻不 能斷好清代的奏摺。反之,以清代的奏摺作training data,同樣無法斷好上古漢 語的文本。由此可知,古漢語斷句系統,必須針對處理的對象,挑選時代相近,

數量足夠的training data,才能發揮最好的效能。 

 

斷句系統的核心,我以hidden Markov models 和 conditional random fields 這兩種模型實作,並在實驗中,比較這兩種模型的效能和特性。Hidden Markov  models 是行之有年的經典方法,效率高,學習速度非常快。應用在斷句工作上,

有不錯的效能。Conditional random fields 是 2001 年,由 Lafferty et al.  提出的 序列標記模型,也是當前處理各類序列問題效能最好的方法之一。傳統的 conditional random fields,在學習的階段,必須用數值方法作參數評估,複雜度 頗高,需要較長的訓練時間。我在本研究中,採用Collins 的 averaged perceptron 演算法,取代傳統的數值方法,訓練conditional random fields。Averaged  perceptron 無法保證收斂到 global optimal,但訓練出來的模型,效能逼近傳統 的參數評估法,效率卻很高,大幅減少訓練時間。 

Conditional random fields 應用在斷句系統中,有很好的成效,從幾項指標 來看,其效能明顯地優於hidden Markov models。然而,conditional random fields 對training data 比較挑剔,份量太少、不夠有代表性,都可能使其斷句效能顯著 下降。反之,hidden Markov models 對 training data 較不敏感,在 training data 數量有限,品質不確定的情況,使用hidden Markov models 有較為穩定的表現。 

 

自動化古漢語斷句是有待拓展的研究議題,在本研究處理的範圍之外,我還 有許多想法,預計在未來逐一試驗。舉例來說,上古漢語還有許多文本,值得繼 續實驗,以找尋更好的training data。甚而,或能援用語言學知識,將眾多文本 截長補短,組成更大、更有代表性的training data。更進一步,或許可以融合各 時代的文本,建構跨越時代的泛用型training data,這對古漢語文獻處理和數位 典藏,將更有實用價值。 

在此之外,斷句系統經過training 之後所得到的斷句模型,其實也可以視為 該training data 在斷句層面上的語言模型。透過訓練所得的諸多特徵( )和其 參數(λ),可以由斷句的角度去了解 training data 的寫作風格。因此,這些特徵 與其參數本身就是頗有價值的資訊,可以運用到語料語言學、語文教學、文本考 證、作者辨識等領域的研究當中。 

   

參考文獻 

 

[1]  楊樹達,《古書句讀釋例》(上海:上海古籍出版社,2007)。 

[2]  李鐸、王毅,〈關於古代文獻信息化工程與古典文學研究之間互動關系的對 話〉,《文學遺產》,頁126‐160,2005 第一期。 

[3]  林爾正、林丹紅,〈計算機應用於古籍整理研究概況〉,《情報探索》,頁28‐29,

2007 第六期。 

[4]  J. Gao, M. Li, and C. Huang, " Improved Source‐Channel Models for Chinese  Word Segmentation," in Proceedings of the 41st Annual Meeting of 

Association of Computational Linguistics (ACL), Japan, 2003. 

[5]  H. Zhang, Q. Liu, X. Cheng, H. Zhang, and H. Yu, "Chinese Lexical Analysis  Using Hierarchical Hidden Markov Model," in Proceedings of the Second  SIGHAN Workshop, Japan, 2003, pp. 63‐70. 

[6]  N. Xue, "Chinese Word Segmentation as Character Tagging," International  Journal of Computational Linguistics and Chinese Language Processing, vol. 8,  no. 1, pp. 29‐48, 2003. 

[7]  F. Peng, F. Feng, and A. McCallum, "Chinese Segmentation and New Word  Detection using Conditional Random Fields," in Proceedings of the 20th  International Conference on Computational Linguistics (COLING 2004), 2004,  pp. 562‐568. 

[8]  L. Lafferty, A. McCallum, and F. Pereira, "Conditional Random Fields: 

Probabilistic Models for Segmenting and Labeling Sequence Data," in 

Proceedings of the 18th International Conference on Machine Learning, 2001,  pp. 282‐289. 

[9]  R. Mitkov, The Oxford Handbook of Computational Linguistics. New York.: 

Oxford University Press, 2003. 

[10] L. Breiman, J. H. Friedman, R. Olshen, and C. J. Stone, Classification and  Regression Trees. Belmont, CA.: International Group, 1984. 

[11] S. M. Humphrey, "Research on Interactive Knowledge‐Based Indexing: The  Medindex Prototype," in Symposium on Computer Applications in Medical  Care, 1989, pp. 527‐533. 

[12] D. D. Palmer and M. A. Hearst, "Adaptive Sentence Boundary 

Disambiguation," in Proceedings of the 1994 Conference on Applied Natural  Language Processing (ANLP), Stuttgart, Germany, 1994, pp. 78‐83. 

Language Indexing," in Proceedings of the DARPA Speech and Natural  Language Workshop, Morgan Kaufmann, 1989, pp. 339‐352. 

[14] J. C. Reynar and A. Ratnaparkhi, " A Maximum Entropy Approach to  Identifying Sentence Boundaries," in Proceedings of the 5th Conference on  Applications of Natural Language Processing, 1997, pp. 16‐19. 

[15] S. Cuendet, D. Hakkani‐Tür, and E. Shriberg, "Automatic Labeling 

Inconsistencies Detection and Correction for Sentence Unit Segmentation in  Conversational Speech," in Proceedings of MLMI 2007, Brno, Czech Republic.,  2007. 

[16] L. Huang, Y. Peng, H. Wang, and Z. Wu, "Statistical Part‐of‐Speech Tagging for  Classical Chinese," in Text, Speech, and Dialogue: 5th International Conference  (TSD 2002), 2002, pp. 115‐122. 

[17] P. N. Tan, M. Steinbach, and K. V., Introduction to Data Mining: Pearson  Education, Inc., 2006. 

[18] E. Alpaydin, Introduction to Machine Learning: The MIT Press, 2004. 

[19] A. Berger, S. Della Pietra, and V. Della Pietra, "A Maximum Entropy Approach  to Natural Language Processing," Computational Linguistics, vol. 22, no. 1, pp. 

39‐71, 1996. 

[20] S. Abney, R. E. Schapire, and Y. Singer, "Boosting Applied to Tagging and PP  Attachment," in Proceedings of the Joint SIGDAT Conference on EMNLP and  VLC, 1999, pp. 38‐45. 

[21] Y. Altun and H. T., "Large Margin Methods for Label Sequence Learning," in  Proceedings of the 8th European Conference on Speech Communication and  Technology (EuroSpeech), 2003. 

[22] L. R. Rabiner, "A Tutorial on Hidden Markov Models and Selected Application  in Speech Recognition," Proceedings of the IEEE, vol. 77, no. 2, pp. 257‐286,  1989. 

[23] A. J. Viterbi, "Error Bounds for Convolutional Codes and an Asymptotically  Optimum Decoding Algorithm," IEEE Transactions on Information Theory, vol. 

13, no. 2, pp. 260‐267, 1967. 

[24] C. D. Manning and H. Schütze, Foundations of Statistical Natural Language  Processing. MA, US: The MIT Press, 1999. 

[25] A. McCallum, D. Freitag, and F. Pereira, "Maximum Entropy Markov Models  for Information Extraction and Segmentation," in Proceedings of 

International Conference on Machine Learning 2000, Stanford, California,  2000, pp. 591‐598. 

[26] H. M. Wallach, "Conditional Random Fields: An Introduction," University of 

[27] R. Feldman and J. Sanger, The Text Mining Handbook. New York, US.: 

Cambridge University Press, 2007. 

[28] F. Sha and F. Pereira, "Shallow Parsing with Conditional Random Fields," in  Proceedings of Human Language Technology Conference and North American  Chapter of the Association for Computational Linguistics (HLT­NAACL), 2003,  pp. 134‐141. 

[29] Y. Liu, A. Stolcke, E. Shriberg, and H. M., "Using Conditional Random Fields  for Sentence Boundary Detection in Speech," in Proceedings of the 43rd  Annual Meeting of Association of Computational Linguistics (ACL), 2005, pp. 

451‐458. 

[30] S. Della Pietra, V. Della Pietra, and J. Lafferty, "Inducing Features of Random  Fields," IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 

19, no. 4, pp. 380‐393, 1997. 

[31] A. McCallum, "Mallet: A machine learning for language toolkit," 2002. 

[32] M. Collins, "Discriminative Training Methods for Hidden Markov Models: 

Theory and Experiments with Perceptron Algorithms," in Proceedings of the  Conference on Empirical Methods in Natural Language Processing (EMNLP),  2002, pp. 1‐8. 

[33] F. Rosenblatt, "The Perceptron: A Probabilistic Model for Information  Storage and Organization in the Brain," Psychological Review, vol. 65, pp. 

384‐408, 1958. 

[34] Y. Freund and R. E. Schapire, "Large Margin Classification using the 

Perceptron Algorithm," Machine Learning, vol. 37, no. 3, pp. 277‐296, 1999. 

[35] M. Collins and D. Nigel, "New Ranking Algorithms for Parsing and Tagging: 

Kernels over Discrete Structures, and the Voted Perceptron," in Proceedings  of the 40th Annual Meeting of the Association for Computational Linguistics  (ACL), 2002, pp. 263‐270. 

[36] A. McCallum and C. Sutton, "An Introduction to Conditional Random Fields  for Relational Learning," in Introduction to Statistical Relational Learning MA,  US: The MIT Press, 2007, pp. 1‐35. 

[37] 楊樹達,《詞詮》(上海:上海古籍出版社,2006)。 

[38] 朱自清,《經典常談》(上海:復旦大學出版社,2004)。 

[39] S. W. Durrant, The Cloudy Mirror: Tension and Conflict in the Writing of Sima  Qian. Albany: State University of New York Press, 1995. 

[40] S. Chen, J. Hsiang, H. Tu, and M. Wu, "On Building a Full‐Text Digital Library  of Historical Documents," in Asian Digital Libraries. Looking Back 10 Years  and Forging New Frontiers, 2007, pp. 49‐60. 

Processing," in Department of Computer Science and Software Engineering,  Faculty of Engineering. vol. Doctor of Philosophy: University of Melbourne,  2007.