Downloads · 30 days
36
13% of all-time downloads
tejagowda/t5-hebrew-translation
t5-hebrew-translation is a text classification model from tejagowda. Use it when you need a label for a piece of text.
Downloads · 30 days
36
13% of all-time downloads
All-time downloads
280
Public
Parameters
223M
11.6 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors892 MB · 100%
From the Hugging Face model README
language:
Model Name: T5 Hebrew-to-English Translation Tokenizer
Model Type: Tokenizer for Transformer-based models
Base Model: T5 (Text-to-Text Transfer Transformer)
Preprocessing: Custom Tokenizer using SentencePieceBPETokenizer
Training Data: Custom Hebrew-English dataset curated for translation tasks
Intended Use: This tokenizer is intended for machine translation tasks, specifically Hebrew-to-English translations.
This tokenizer was trained on a Hebrew-to-English dataset using SentencePieceBPETokenizer. It is optimized for handling Hebrew text tokenization and can be paired with a Transformer model, such as T5, for sequence-to-sequence translation tasks. It handles preprocessing tasks like tokenization, padding, and truncation effectively.
To use this tokenizer, you can load it using the Hugging Face Transformers library:
from transformers import AutoTokenizer
# Load the tokenizer
tokenizer = AutoTokenizer.from_pretrained("tejagowda/t5-hebrew-translation", use_fast=False)
# Example: Tokenizing a Hebrew sentence
hebrew_text = "\u05D0\u05EA\u05D4\u05D3 \u05E2\u05DC \u05D4\u05D7\u05D5\u05DE\u05E8\u05D4."
inputs = tokenizer(hebrew_text, return_tensors="pt")
print("Tokens:", inputs["input_ids"])
To perform translation, you can pair this tokenizer with a pretrained T5 model:
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
# Load the tokenizer and model
tokenizer = AutoTokenizer.from_pretrained("tejagowda/t5-hebrew-translation", use_fast=False)
model = AutoModelForSeq2SeqLM.from_pretrained("t5-small") # Replace with fine-tuned model if available
# Hebrew text to translate
hebrew_text = "\u05EA\u05D0\u05E8 \u05D0\u05EA \u05DE\u05D1\u05E0\u05D4 \u05E9\u05DC \u05D0\u05D8\u05D5\u05DD."
# Tokenize and translate
inputs = tokenizer(hebrew_text, return_tensors="pt")
outputs = model.generate(inputs["input_ids"], max_length=100)
# Decode the output
english_translation = tokenizer.decode(outputs[0], skip_special_tokens=True)
print("Translation:", english_translation)
This tokenizer is licensed under the Apache 2.0 License. See the LICENSE file for more details.