Downloads · 30 days
12
0% of all-time downloads
EnglishVoice/t5-base-uk-to-us-english
t5-base-uk-to-us-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 264519 sentences with UK English spelling, along with their US English equivalent.
Downloads · 30 days
12
0% of all-time downloads
All-time downloads
9.8K
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 264519 sentences with UK English spelling, along with their US English equivalent.
The purpose of the model is to rewrite sentences from UK English to US English. It is capable not only of changing the spelling of words (such as "colour" to "color") but also changes the vocabulary appropriately (for example, "underground" to "subway", "solicitor" to "lawyer" and so on).
| Input | Output |
|---|---|
| My favourite colour is yellow. | My favorite color is yellow. |
| I saw a bloke in yellow trainers at the underground station. | I saw a guy in yellow sneakers at the subway station. |
| You could have got hurt! | You could have gotten 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-uk-to-us-english")
tokenizer = T5Tokenizer.from_pretrained("EnglishVoice/t5-base-uk-to-us-english")
model = model.to(device)
input = "My favourite colour is yellow."
text = "UK to US: " + 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 favorite color is yellow.