Downloads · 30 days
11
4% of all-time downloads
saadamin2k13/urdu_text_generation
urdu_text_generation is a machine learning model from saadamin2k13. 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.
This model card lists fine-tuned byT5 model for the task of Text Generation from Meaning Representation (DRS).
Downloads · 30 days
11
4% of all-time downloads
All-time downloads
288
Public
Repo size
4.7 GB
Likes
0
Public
Click a slice to open those files.
.bin2.3 GB · 100%
From the Hugging Face model README
This model card lists fine-tuned byT5 model for the task of Text Generation from Meaning Representation (DRS).
We worked on a pre-trained byt5-base model and fine-tuned it with the Parallel Meaning Bank dataset (DRS-Text pairs dataset). Furthermore, we enriched the gold_silver flavors of PMB (release 5.0.0) with different augmentation strategies.
To use the model, follow the code below for a quick response.
from transformers import ByT5Tokenizer, T5ForConditionalGeneration
# Initialize the tokenizer and model
tokenizer = ByT5Tokenizer.from_pretrained('saadamin2k13/urdu_text_generation', max_length=512)
model = T5ForConditionalGeneration.from_pretrained('saadamin2k13/urdu_text_generation')
# Example sentence
example = "male.n.02 Name 'ٹام' yell.v.01 Agent -1 Time +1 time.n.08 TPR now"
# Tokenize and prepare the input
x = tokenizer(example, return_tensors='pt', padding=True, truncation=True, max_length=512)['input_ids']
# Generate output
output = model.generate(x)
# Decode and print the output text
pred_text = tokenizer.decode(output[0], skip_special_tokens=True, clean_up_tokenization_spaces=False)
print(pred_text)