Other
Transformers
Safetensors
English
Russian
t5
text2text-generation
text-to-graph
webnlg
bt5
text-generation-inference
Instructions to use Loria-MosAIk/bt5-webnlg-en-ru with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Loria-MosAIk/bt5-webnlg-en-ru with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("Loria-MosAIk/bt5-webnlg-en-ru") model = AutoModelForSeq2SeqLM.from_pretrained("Loria-MosAIk/bt5-webnlg-en-ru", device_map="auto") - Notebooks
- Google Colab
- Kaggle
File size: 3,955 Bytes
12b7201 be67549 12b7201 3a2c219 12b7201 81087d2 12b7201 a163a9c 12b7201 32a019a a163a9c 32a019a a163a9c 32a019a 12b7201 0e71ddb | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | ---
language:
- en
- ru
library_name: transformers
pipeline_tag: other
base_model: cointegrated/rut5-base-multitask
base_model_relation: finetune
tags:
- text-to-graph
- webnlg
- bt5
---
# BT5 English–Russian Semantic Parsing
This model converts English or Russian text into subject–relation–object triples. It follows the BT5 method of [Agarwal et al. (2020)](https://aclanthology.org/2020.webnlg-1.13/) and was initialized from `cointegrated/rut5-base-multitask` and trained with six equally sampled parsing and translation tasks.
The first author of the [XQDT paper](https://huggingface.co/papers/2608.29948) reproduced BT5 for use as a base text-to-data model in that study. The [reproduction repository](https://github.com/guihuzhang/bt5-regen-text-to-graph) contains the code, saved predictions, and evaluation scripts.
The checkpoint is step 54,000. Its saved WebNLG 2020 test predictions give Exact F1 of 67.62 for English and 93.46 for Russian, using five-beam decoding.
## Usage
```python
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
model_path = "Loria-MosAIk/bt5-webnlg-en-ru"
tokenizer = AutoTokenizer.from_pretrained(model_path, use_fast=False)
model = AutoModelForSeq2SeqLM.from_pretrained(model_path).eval()
inputs = tokenizer("Parse English Lina Dorado was born in Bogotá in 1975.", return_tensors="pt")
outputs = model.generate(**inputs, num_beams=5, max_new_tokens=256)
print(tokenizer.decode(outputs[0], skip_special_tokens=True, clean_up_tokenization_spaces=False))
```
English output (`<S>` = subject, `<P>` = relation, `<O>` = object):
```text
<S> Lina Dorado <P> birth year <O> 1975 <S> Lina Dorado <P> birth place <O> Bogotá
```
Russian example:
```text
Input: Parse Russian Валюта Индии - Индийская рупия.
Output: <S> India <P> currency <O> Indian rupee
```
The scorer counts identical predicted triples only once per input.
The [base model](https://huggingface.co/cointegrated/rut5-base-multitask) is distributed under MIT. The WebNLG data used for fine-tuning are distributed under [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/).
## Citation
Original BT5 model: [Agarwal et al. (2020)](https://aclanthology.org/2020.webnlg-1.13/).
```bibtex
@inproceedings{agarwal-etal-2020-machine,
title = "Machine Translation Aided Bilingual Data-to-Text Generation and Semantic Parsing",
author = "Agarwal, Oshin and
Kale, Mihir and
Ge, Heming and
Shakeri, Siamak and
Al-Rfou, Rami",
editor = "Castro Ferreira, Thiago and
Gardent, Claire and
Ilinykh, Nikolai and
van der Lee, Chris and
Mille, Simon and
Moussallem, Diego and
Shimorina, Anastasia",
booktitle = "Proceedings of the 3rd International Workshop on Natural Language Generation from the Semantic Web ({W}eb{NLG}+)",
month = "12",
year = "2020",
address = "Dublin, Ireland (Virtual)",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2020.webnlg-1.13/",
pages = "125--130"
}
```
This checkpoint and reproduction code: [Efimov-Zhang et al. (2026)](https://aclanthology.org/2026.emnlp-main.397/).
```bibtex
@inproceedings{efimov-zhang-etal-2026-xqdt,
title = "{XQDT}: e{X}plainable and Quantitative Data-Text Alignment Metric with Feedback Signals",
author = "Efimov-Zhang, Kun and
Song, Yifei and
Gardent, Claire",
editor = "Lee, Hung-Yi and
Dev, Sunipa and
Li, Jessy and
Elliott, Desmond",
booktitle = "Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing",
month = oct,
year = "2026",
address = "Budapest, Hungary",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2026.emnlp-main.397/",
doi = "10.18653/2026.emnlp-main.397",
pages = "9121--9157",
ISBN = "979-8-89176-459-0"
}
```
|