Downloads · 30 days
10
1% of all-time downloads
ybracke/transnormer-19c-beta-v01
transnormer-19c-beta-v01 is a machine learning model from ybracke. 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.
This model normalizes spelling variants in historical German text to the modern spelling. It is a fine-tuned version of google/byt5-small on a modified version of the DTA EvalCorpus (1780-1901).
Downloads · 30 days
10
1% of all-time downloads
All-time downloads
928
Public
Parameters
300M
2.5 GB on disk
Likes
1
Public
Click a slice to open those files.
.bin1.2 GB · 50%
From the Hugging Face model README
This model normalizes spelling variants in historical German text to the modern spelling. It is a fine-tuned version of google/byt5-small on a modified version of the DTA EvalCorpus (1780-1901).
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
from transformers.generation import GenerationConfig
tokenizer = AutoTokenizer.from_pretrained("ybracke/transnormer-19c-beta-v01")
model = AutoModelForSeq2SeqLM.from_pretrained("ybracke/transnormer-19c-beta-v01")
gen_cfg = GenerationConfig.from_model_config(model.config)
gen_cfg.max_new_tokens = 512
sentence = "Der Officier mußte ſich dazu setzen, man trank und ließ ſich’s wohl ſeyn."
inputs = tokenizer(sentence, return_tensors="pt",)
outputs = model.generate(**inputs, generation_config=gen_cfg)
print(tokenizer.batch_decode(outputs, skip_special_tokens=True))
# >>> ['Der Offizier musste sich dazusetzen, man trank und ließ sich es wohl sein.'
Here is how to use this model with the pipeline API:
from transformers import pipeline
transnormer = pipeline('text2text-generation', model='ybracke/transnormer-19c-beta-v01')
sentence = "Der Officier mußte ſich dazu setzen, man trank und ließ ſich’s wohl ſeyn."
print(transnormer(sentence))
# >>> [{'generated_text': 'Der Offizier musste sich dazusetzen, man trank und ließ sich es wohl sein.'}]
The following hyperparameters were used during training: