Downloads · 30 days
13
0% of all-time downloads
CarlaSoe/personal-noun-detection-german-bert
personal-noun-detection-german-bert is a token classification model from CarlaSoe. Use it when you need labels on individual words, such as names. It is set up for transformers.
This is a fine-tuned model based on bert-base-german-cased to detect personal nouns (i.e. common nouns denoting human beings like Lehrer 'teacher', Besucher 'visitor') in German text.
Downloads · 30 days
13
0% of all-time downloads
All-time downloads
13.3K
Public
Repo size
1.7 GB
Likes
1
Public
Click a slice to open those files.
.pt868 MB · 67%
From the Hugging Face model README
This is a fine-tuned model based on bert-base-german-cased to detect personal nouns (i.e. common nouns denoting human beings like Lehrer 'teacher', Besucher 'visitor') in German text.
Personal nouns are defined as including all nouns referring to natural person(s) regardless of reference type (generic, non-generic, predicative). Not included in this definition are:
The model conducts a binary token classification. Labels are PERS_N for personal nouns and O for all other tokens. Performance on a test set during training achieved an f1-score of 0.94. For more information on the training data and evaluation, see Sökefeld et al. (2023).
The model can be used to detect personal nouns in German texts. This can be useful for studying the variety of morphological forms currently used in German. A particular use case is in the field of genderlinguistics: The model can be used to detect all personal nouns in a text or corpus and thus quantify the amount of gender-inclusive forms (Lehrer:innen, Lehrer*innen) with regard to the basic population.
Use the code below to get started with the model.
from transformers import pipeline
model_checkpoint = '/your/file_path/to_the_model'
token_classifier = pipeline( "token-classification", model=model_checkpoint, aggregation_strategy="simple" )
example_sentence = 'Die Lehrerin macht mit ihren Schüler:innen einen Ausflug.'
print(token_classifier(example_sentence))
The training data consisted of a corpus of roughly 130.000 tokens comprised of newspaper and blog texts from 2019. An overview of the texts with dates, author information and links to the newspaper articles/blog posts is provided in the file overview_training_data.xlsx.
We applied the transformer tokenizer on already tokenized sentences. We used the default hyperparameters specified in the Huggingface token classification tutorial (https://huggingface.co/learn/nlp-course/chapter7/2?fw=pt#processing-the-data) for training and evaluated the model on token-level on the remaining 10% of the corpus.