通过微调KB-BERT恢复瑞典语中的标点符号
Punctuation restoration in Swedish through fine-tuned KB-BERT
摘要:
本文提出了一种利用BERT模型自动恢复瑞典语标点符号的方法。该方法是基于KB-BERT,一个公开的,神经网络语言模型预先训练的瑞典国家图书馆的瑞典语语料库。然后,利用政府文本语料库,对这一模式进行了微调,以适应这一具体任务。如果输入的是小写和不加标点的瑞典语文本,模型应该返回语法正确的标点文本副本作为输出。这个问题的成功解决方案为一系列NLP领域带来了好处,例如语音到文本和自动文本。该项目只考虑了标点符号句号,逗号和问号,因为缺乏更罕见的标记数据,如标点符号。此外,有些标记在某种程度上可以与更常见的标记互换,例如感叹号和句号。因此,数据集的所有感叹号都被句号取代。经过微调的瑞典BERT模型,被称为presto BERT,取得了78.9的F1总成绩。该模型的得分与国际同行相似,匈牙利和中国模型的F1得分分别为82.2和75.6。作为进一步的比较,进行了人类评估案例研究。人类测试组的总体F1得分为81.7,但在句号和逗号上的得分都比prestoBERT差得多。检查模型和人类的输出句子显示出令人满意的结果,尽管F1分数存在差异。这种脱节似乎源于不必要地专注于复制测试集中使用的完全相同的标点符号,而不是提供任何数量的正确解释。如果可以重写损失函数,以奖励所有语法正确的输出,而不是仅仅奖励一个原始示例,那么prestoBERT和人类组的性能都可以显著提高。
英文摘要:
Presented here is a method for automatic punctuation restoration in Swedish using a BERT model. The method is based on KB-BERT, a publicly available, neural network language model pre-trained on a Swedish corpus by National Library of Sweden. This model has then been fine-tuned for this specific task using a corpus of government texts. With a lower-case and unpunctuated Swedish text as input, the model is supposed to return a grammatically correct punctuated copy of the text as output. A successful solution to this problem brings benefits for an array of NLP domains, such as speech-to-text and automated text. Only the punctuation marks period, comma and question marks were considered for the project, due to a lack of data for more rare marks such as semicolon. Additionally, some marks are somewhat interchangeable with the more common, such as exclamation points and periods. Thus, the data set had all exclamation points replaced with periods. The fine-tuned Swedish BERT model, dubbed prestoBERT, achieved an overall F1-score of 78.9. The proposed model scored similarly to international counterparts, with Hungarian and Chinese models obtaining F1-scores of 82.2 and 75.6 respectively. As further comparison, a human evaluation case study was carried out. The human test group achieved an overall F1-score of 81.7, but scored substantially worse than prestoBERT on both period and comma. Inspecting output sentences from the model and humans show satisfactory results, despite the difference in F1-score. The disconnect seems to stem from an unnecessary focus on replicating the exact same punctuation used in the test set, rather than providing any of the number of correct interpretations. If the loss function could be rewritten to reward all grammatically correct outputs, rather than only the one original example, the performance could improve significantly for both prestoBERT and the human group.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。