Downloads · 30 days
38
0% of all-time downloads
Narrativaai/bloom-560m-finetuned-totto-table-to-text
bloom-560m-finetuned-totto-table-to-text is a table to text model from Narrativaai. Use it for the table to text task on the model card, and read the license before you ship it in a product. It is set up for transformers.
This model is a fine-tuned version of bigscience/bloom-560m on the ToTTo dataset.
Downloads · 30 days
38
0% of all-time downloads
All-time downloads
38.6K
Public
Parameters
559M
4.5 GB on disk
Likes
18
Public
Click a slice to open those files.
.bin2.2 GB · 50%
From the Hugging Face model README
This model is a fine-tuned version of bigscience/bloom-560m on the ToTTo dataset.
It is a 560M params version of BLOOM 🌸
ToTTo is an open-domain English table-to-text dataset with over 120,000 training examples that proposes a controlled generation task: given a Wikipedia table and a set of highlighted table cells, produce a one-sentence description.
During the dataset creation process, tables from English Wikipedia are matched with (noisy) descriptions. Each table cell mentioned in the description is highlighted and the descriptions are iteratively cleaned and corrected to faithfully reflect the content of the highlighted cells.
| Metric | Value |
|---|---|
| rouge1 | 0.56 |
| rouge2 | 0.33 |
| rougeL | 0.48 |
| rougeLsum | 0.48 |
| sacrebleu | 20.87 |
| meteor | 0.49 |
from datasets import load_dataset
from transformers import BloomTokenizerFast, BloomForCausalLM
valid_dataset = load_dataset('totto', split='validation')
from preprocess import preprocess # This file is included in the repo
# Now we linearize the tables
valid_dataset = valid_dataset.map(preprocess)
model_ckpt = "mrm8488/bloom-560m-finetuned-totto-table-to-text"
tokenizer = BloomTokenizerFast.from_pretrained(ckpt)
model = BloomForCausalLM.from_pretrained(ckpt).to("cuda")
def explain_hl_cells(text):
inputs = tokenizer(text, return_tensors='pt')
input_ids = inputs.input_ids.to("cuda")
attention_mask = inputs.attention_mask.to("cuda")
output = model.generate(input_ids, attention_mask=attention_mask, max_length=2048, eos_token_id=tokenizer.eos_token_id)
return tokenizer.decode(output[0], skip_special_tokens=False)
example = valid_dataset[1]
print(explain_hl_cells(example['linearized_table'])
<video loop="" autoplay="" controls="" src="https://huggingface.co/Narrativaai/bloom-560m-finetuned-totto-table-to-text/resolve/main/video_totto.mp4"></video>
Created by: Narrativa
Narrativa is an internationally recognized content services company that uses its proprietary artificial intelligence and machine learning platforms to build and deploy digital content solutions for enterprises. Its technology suite, consisting of data extraction, data analysis, natural language processing (NLP) and natural language generation (NLG) tools, all seamlessly work together to power a lineup of smart content creation, automated business intelligence reporting and process optimization products for a variety of industries. Contact us to learn more about our solutions!