Downloads · 30 days
30
5% of all-time downloads
s-nlp/g2t-t5-xl-webnlg
g2t-t5-xl-webnlg is a machine learning model from s-nlp. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers.
T5-XL seq2seq model trained on WebNLG dataset
Downloads · 30 days
30
5% of all-time downloads
All-time downloads
649
Public
Parameters
2.8B
11.4 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors11.4 GB · 100%
From the Hugging Face model README
T5-XL seq2seq model trained on WebNLG dataset
from typing import List, Tuple
from transformers import pipeline
def prepare_text(triplets: List[Tuple[str, str, str]]):
graph = "[graph]"
for triplet in triplets:
graph += f"[head] {triplet[0]} [relation] {triplet[1]} [tail] {triplet[2]} "
graph += "[text]</s>"
return graph
g2t_model = pipeline(task="text2text-generation", model="s-nlp/g2t-t5-xl-webnlg")
graph = prepare_text([
("London", "capital_of", "United Kingdom"),
("London", "population", "8,799,728")
])
g2t_model(graph)
# [{'generated_text': 'London is the capital of the United Kingdom and has a population of 8,799,7'}]