uygarkurt commited on
Commit
e316309
1 Parent(s): a0e89fd

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +65 -0
README.md CHANGED
@@ -1,3 +1,68 @@
1
  ---
2
  license: mit
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: mit
3
+ language:
4
+ - tr
5
+ tags:
6
+ - punctuation restoration
7
+ - punctuation prediction
8
+ widget:
9
+ text: "Türkiye toprakları üzerindeki ilk yerleşmeler Yontma Taş Devri'nde başlar Doğu Trakya'da Traklar olmak üzere Hititler Frigler Lidyalılar ve Dor istilası sonucu Yunanistan'dan kaçan Akalar tarafından kurulan İyon medeniyeti gibi çeşitli eski Anadolu medeniyetlerinin ardından Makedonya kralı Büyük İskender'in egemenliğiyle ve fetihleriyle birlikte Helenistik Dönem başladı"
10
  ---
11
+
12
+ # Transformer Based Punctuation Restoration Models for Turkish
13
+
14
+ <div float="center">
15
+ <a href="https://github.com/uygarkurt/Turkish-Punctuation-Restoration">
16
+ <img alt="open-source-image"
17
+ src="https://img.shields.io/badge/GitHub-repository-green?logo=GitHub">
18
+ </a>
19
+ </div>
20
+ <div align="center">
21
+ <p>Liked our work? give us a ⭐ on GitHub!</p>
22
+ </div>
23
+
24
+ You can find the BERT model used in the paper Transformer Based Punctuation Restoration for Turkish. Aim of this work is correctly place pre-decided punctuation marks in a given text. We present three pre-trained transformer models to predict **period(.)**, **comma(,)** and **question(?)** marks for the Turkish language.
25
+
26
+ ## Usage <a class="anchor" id="usage"></a>
27
+
28
+ ### Inference <a class="anchor" id="inference"></a>
29
+ Recommended usage is via HuggingFace. You can run an inference using the pre-trained BERT model with the following code:
30
+ ```
31
+ from transformers import pipeline
32
+
33
+ pipe = pipeline(task="token-classification", model="uygarkurt/convbert-restore-punctuation-turkish")
34
+
35
+ sample_text = "Türkiye toprakları üzerindeki ilk yerleşmeler Yontma Taş Devri'nde başlar Doğu Trakya'da Traklar olmak üzere Hititler Frigler Lidyalılar ve Dor istilası sonucu Yunanistan'dan kaçan Akalar tarafından kurulan İyon medeniyeti gibi çeşitli eski Anadolu medeniyetlerinin ardından Makedonya kralı Büyük İskender'in egemenliğiyle ve fetihleriyle birlikte Helenistik Dönem başladı"
36
+
37
+ out = pipe(sample_text)
38
+ ```
39
+
40
+ To use a different pre-trained model you can just replace the `model` argument with one of the other [available models](#models) we provided.
41
+
42
+ ## Data <a class="anchor" id="data"></a>
43
+ Dataset is provided in `data/` directory as train, validation and test splits.
44
+
45
+ Dataset can be summarized as below:
46
+
47
+ | Split | Total | Period (.) | Comma (,) | Question (?) |
48
+ |:-----------:|:-------:|:----------:|:---------:|:------------:|
49
+ | Train | 1471806 | 124817 | 98194 | 9816 |
50
+ | Validation | 180326 | 15306 | 11980 | 1199 |
51
+ | Test | 182487 | 15524 | 12242 | 1255 |
52
+
53
+ ## Available Models <a class="anchor" id="models"></a>
54
+ We experimented with BERT, ELECTRA and ConvBERT. Pre-trained models can be accessed via Huggingface.
55
+
56
+ BERT: https://huggingface.co/uygarkurt/bert-restore-punctuation-turkish \
57
+ ELECTRA: https://huggingface.co/uygarkurt/electra-restore-punctuation-turkish \
58
+ ConvBERT: https://huggingface.co/uygarkurt/convbert-restore-punctuation-turkish
59
+
60
+ ## Results <a class="results" id="results"></a>
61
+ `Precision` and `Recall` and `F1` scores for each model and punctuation mark are summarized below.
62
+
63
+ | Model | | PERIOD | | | COMMA | | | QUESTION | | | OVERALL | |
64
+ |:--------:|:--------:|:--------:|:--------:|:--------:|:--------:|:--------:|:--------:|:--------:|:--------:|:--------:|:--------:|:--------:|
65
+ |Score Type| P | R | F1 | P | R | F1 | P | R | F1 | P | R | F1 |
66
+ | BERT | 0.972602 | 0.947504 | 0.959952 | 0.576145 | 0.700010 | 0.632066 | 0.927642 | 0.911342 | 0.919420 | 0.825506 | 0.852952 | 0.837146 |
67
+ | ELECTRA | 0.972602 | 0.948689 | 0.960497 | 0.576800 | 0.710208 | 0.636590 | 0.920325 | 0.921074 | 0.920699 | 0.823242 | 0.859990 | 0.839262 |
68
+ | ConvBERT | 0.972731 | 0.946791 | 0.959585 | 0.576964 | 0.708124 | 0.635851 | 0.922764 | 0.913849 | 0.918285 | 0.824153 | 0.856254 | 0.837907 |