Upload folder using huggingface_hub
Browse files- README.md +80 -0
- config.json +44 -0
- generation_config.json +9 -0
- model.safetensors +3 -0
- pytorch_model.bin +3 -0
- special_tokens_map.json +15 -0
- tf_model.h5 +3 -0
- tokenizer.json +0 -0
- tokenizer_config.json +13 -0
- vocab.txt +0 -0
README.md
ADDED
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language: cs
|
3 |
+
license: cc-by-nc-sa-4.0
|
4 |
+
tags:
|
5 |
+
- Czech
|
6 |
+
- GEC
|
7 |
+
- GECCC dataset
|
8 |
+
---
|
9 |
+
|
10 |
+
# Model Card for transformer-base-geccc-mate
|
11 |
+
|
12 |
+
The `transformer-base-geccc-mate` model is a sequence-to-sequence model performing
|
13 |
+
grammar error correction in Czech described in the paper
|
14 |
+
[Refining Czech GEC: Insights from a Multi-Experiment Approach](https://arxiv.org/abs/2506.22402).
|
15 |
+
It is a base-sized Transformer trained from scratch using
|
16 |
+
the MATE method and the [GECCC dataset](https://hdl.handle.net/11234/1-4861).
|
17 |
+
|
18 |
+
## Model Description
|
19 |
+
|
20 |
+
- **Developed by:** [Seznam.cz](https://seznam.cz) and [Charles University, MFF, ÚFAL](https://ufal.mff.cuni.cz/)
|
21 |
+
- **Language(s) (NLP):** Czech
|
22 |
+
- **Model type:** subword-based encoder-decoder Transformer model
|
23 |
+
- **Finetuned on:**
|
24 |
+
- first synthetic errors generated by the MATE method (see [the paper](https://arxiv.org/abs/2506.22402))
|
25 |
+
- then the [GECCC dataset](https://hdl.handle.net/11234/1-4861)
|
26 |
+
- **License:** CC BY-NC-SA 4.0
|
27 |
+
|
28 |
+
## Model Sources
|
29 |
+
|
30 |
+
- **Repository:** https://github.com/ufal/tsd2025-gec
|
31 |
+
- **Paper:** [Refining Czech GEC: Insights from a Multi-Experiment Approach](https://arxiv.org/abs/2506.22402)
|
32 |
+
- **Dataset:** [GECCC dataset](https://hdl.handle.net/11234/1-4861)
|
33 |
+
|
34 |
+
## Evaluation
|
35 |
+
|
36 |
+
<div align="center">
|
37 |
+
<img src="https://github.com/ufal/tsd2025-gec/blob/main/figures/bubble_chart.svg?raw=true" width="100%" alt="Performance bubblechart" />
|
38 |
+
</div>
|
39 |
+
|
40 |
+
| Model | Parameters | GECCC F-0.5 score |
|
41 |
+
|:------|-----------:|:-----------------:|
|
42 |
+
| [byt5-small-geccc-mate](https://hf.co/ufal/byt5-small-geccc-mate) | 300M | 72.56 |
|
43 |
+
| [byt5-base-geccc-mate](https://hf.co/ufal/byt5-base-geccc-mate) | 582M | 75.15 |
|
44 |
+
| [byt5-large-geccc-mate](https://hf.co/ufal/byt5-large-geccc-mate) | 1275M | 77.01 |
|
45 |
+
| [**transformer-base-geccc-mate**](https://hf.co/ufal/transformer-base-geccc-mate) | **65M** | **73.73** |
|
46 |
+
|
47 |
+
## Uses
|
48 |
+
|
49 |
+
The model can be directly used to process space-tokenized input Czech text and produce grammar-corrected Czech text.
|
50 |
+
|
51 |
+
## How to Get Started with the Model
|
52 |
+
|
53 |
+
Use the code below to get started with the model. Note that the input must be **space-tokenized**, i.e., every token (using the [UDPipe 1](https://ufal.mff.cuni.cz/udpipe/1) tokenizer [czech-pdt-ud-2.5-191206.udpipe](https://hdl.handle.net/11234/1-3131)) must be space-separated.
|
54 |
+
|
55 |
+
```python
|
56 |
+
tokenizer = transformers.AutoTokenizer.from_pretrained("ufal/transformer-base-geccc-mate")
|
57 |
+
model = transformers.AutoModelForSeq2SeqLM.from_pretrained("ufal/transformer-base-geccc-mate")
|
58 |
+
|
59 |
+
batch = tokenizer(["Sveřepý šakali zavile vyly na býlí mesýc .", return_tensors="pt")
|
60 |
+
outputs = model.generate(batch.input_ids, max_length=256, num_beams=4)
|
61 |
+
|
62 |
+
print(tokenizer.batch_decode(outputs, skip_special_tokens=True))
|
63 |
+
```
|
64 |
+
|
65 |
+
## BibTeX Citation
|
66 |
+
|
67 |
+
```
|
68 |
+
@InProceedings{10.1007/978-3-032-02551-7_7,
|
69 |
+
author="Pechman, Petr and Straka, Milan and Strakov{\'a}, Jana and N{\'a}plava, Jakub",
|
70 |
+
editor="Ek{\v{s}}tein, Kamil and Konop{\'i}k, Miloslav and Pra{\v{z}}{\'a}k, Ond{\v{r}}ej and P{\'a}rtl, Franti{\v{s}}ek",
|
71 |
+
title="Refining Czech GEC: Insights from a Multi-experiment Approach",
|
72 |
+
booktitle="Text, Speech, and Dialogue",
|
73 |
+
year="2026",
|
74 |
+
publisher="Springer Nature Switzerland",
|
75 |
+
address="Cham",
|
76 |
+
pages="64--76",
|
77 |
+
isbn="978-3-032-02551-7",
|
78 |
+
doi="10.1007/978-3-032-02551-7_7"
|
79 |
+
}
|
80 |
+
```
|
config.json
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"activation_dropout": 0.0,
|
3 |
+
"activation_function": "relu",
|
4 |
+
"architectures": [
|
5 |
+
"BartForConditionalGeneration"
|
6 |
+
],
|
7 |
+
"attention_dropout": 0.0,
|
8 |
+
"bos_token_id": 1,
|
9 |
+
"classifier_dropout": 0.0,
|
10 |
+
"d_model": 512,
|
11 |
+
"decoder_attention_heads": 8,
|
12 |
+
"decoder_ffn_dim": 2048,
|
13 |
+
"decoder_layerdrop": 0.0,
|
14 |
+
"decoder_layers": 6,
|
15 |
+
"decoder_start_token_id": 1,
|
16 |
+
"dropout": 0.1,
|
17 |
+
"encoder_attention_heads": 8,
|
18 |
+
"encoder_ffn_dim": 2048,
|
19 |
+
"encoder_layerdrop": 0.0,
|
20 |
+
"encoder_layers": 6,
|
21 |
+
"eos_token_id": 2,
|
22 |
+
"forced_eos_token_id": 2,
|
23 |
+
"id2label": {
|
24 |
+
"0": "LABEL_0",
|
25 |
+
"1": "LABEL_1",
|
26 |
+
"2": "LABEL_2"
|
27 |
+
},
|
28 |
+
"init_std": 0.02,
|
29 |
+
"is_encoder_decoder": true,
|
30 |
+
"label2id": {
|
31 |
+
"LABEL_0": 0,
|
32 |
+
"LABEL_1": 1,
|
33 |
+
"LABEL_2": 2
|
34 |
+
},
|
35 |
+
"max_position_embeddings": 256,
|
36 |
+
"model_type": "bart",
|
37 |
+
"num_hidden_layers": 6,
|
38 |
+
"pad_token_id": 0,
|
39 |
+
"scale_embedding": true,
|
40 |
+
"torch_dtype": "float32",
|
41 |
+
"transformers_version": "4.33.3",
|
42 |
+
"use_cache": true,
|
43 |
+
"vocab_size": 32000
|
44 |
+
}
|
generation_config.json
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_from_model_config": true,
|
3 |
+
"bos_token_id": 1,
|
4 |
+
"decoder_start_token_id": 1,
|
5 |
+
"eos_token_id": 2,
|
6 |
+
"forced_eos_token_id": 2,
|
7 |
+
"pad_token_id": 0,
|
8 |
+
"transformers_version": "4.33.3"
|
9 |
+
}
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:327150a2f8aef62fe74170a91b09f3c096d8ad984297b46ec6af288866f90ba6
|
3 |
+
size 243312640
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:12ce1417e74672d1ff46d61e9a62f0e36bbdde34418df7e4c8fcf246cf9921ac
|
3 |
+
size 243368627
|
special_tokens_map.json
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": "[CLS]",
|
3 |
+
"cls_token": "[CLS]",
|
4 |
+
"eos_token": "[SEP]",
|
5 |
+
"mask_token": {
|
6 |
+
"content": "[MASK]",
|
7 |
+
"lstrip": false,
|
8 |
+
"normalized": false,
|
9 |
+
"rstrip": false,
|
10 |
+
"single_word": false
|
11 |
+
},
|
12 |
+
"pad_token": "[PAD]",
|
13 |
+
"sep_token": "[SEP]",
|
14 |
+
"unk_token": "[UNK]"
|
15 |
+
}
|
tf_model.h5
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:08fd484ce8f0665ef2d3c18cb49229f217d65d53f14af5443cbe35e71531ea43
|
3 |
+
size 243574672
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"add_prefix_space": false,
|
3 |
+
"bos_token": "[CLS]",
|
4 |
+
"cls_token": "[CLS]",
|
5 |
+
"eos_token": "[SEP]",
|
6 |
+
"errors": "replace",
|
7 |
+
"mask_token": "[MASK]",
|
8 |
+
"pad_token": "[PAD]",
|
9 |
+
"sep_token": "[SEP]",
|
10 |
+
"tokenizer_class": "BartTokenizer",
|
11 |
+
"trim_offsets": true,
|
12 |
+
"unk_token": "[UNK]"
|
13 |
+
}
|
vocab.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|