Downloads · 30 days
7
0% of all-time downloads
EnglishVoice/t5-base-us-to-uk-english
t5-base-us-to-uk-english is a machine learning model from EnglishVoice. 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. The card lists the license as apache-2.0.
The model has been trained on a dataset containing 249525 sentences with US English spelling, along with their UK English equivalent.
Downloads · 30 days
7
0% of all-time downloads
All-time downloads
3.3K
Public
Repo size
3.6 GB
Likes
2
Public
Click a slice to open those files.
.h5892 MB · 33%
From the Hugging Face model README
The model has been trained on a dataset containing 249525 sentences with US English spelling, along with their UK English equivalent.
The purpose of the model is to rewrite sentences from US English to UK English. It is capable not only of changing the spelling of words (such as "color" to "colour") but also changes the vocabulary appropriately (for example, "subway" to "underground", "lawyer" to "solicitor" and so on).
| Input | Output |
|---|---|
| My favorite color is yellow. | My favourite colour is yellow. |
| I saw a guy in yellow sneakers at the subway station. | I saw a bloke in yellow trainers at the underground station. |
| You could have gotten hurt! | You could have got hurt! |
The dataset was developed by English Voice AI Labs. You can download it from our website: https://www.EnglishVoice.ai/
Sample Python code:
import torch
from transformers import T5ForConditionalGeneration,T5Tokenizer
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model = T5ForConditionalGeneration.from_pretrained("EnglishVoice/t5-base-us-to-uk-english")
tokenizer = T5Tokenizer.from_pretrained("EnglishVoice/t5-base-us-to-uk-english")
model = model.to(device)
input = "My favorite color is yellow."
text = "US to UK: " + input
encoding = tokenizer.encode_plus(text, return_tensors = "pt")
input_ids = encoding["input_ids"].to(device)
attention_masks = encoding["attention_mask"].to(device)
beam_outputs = model.generate(
input_ids = input_ids,
attention_mask = attention_masks,
early_stopping = True,
)
result = tokenizer.decode(beam_outputs[0], skip_special_tokens=True)
print(result)
Output:
My favourite colour is yellow.