# German Sentiment (tokenizer)?

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgerman-sentiment-tokenizer%2F31448%3E%5C
**Category:** 🤗Transformers\
**Created:** [February 10, 2023, 12:10pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgerman-sentiment-tokenizer%2F31448 "2023-02-10T12:10:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Al3ksandra](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/al3ksandra/32/14073_2.png) [@Al3ksandra](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FAl3ksandra)%5C
**Post date:** [February 10, 2023, 12:10pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgerman-sentiment-tokenizer%2F31448%2F1 "2023-02-10T12:10:09Z")

</div>

Hi,

I want to use German Sentiment (" German Sentiment Classification with Bert") repository (Link: [GitHub - oliverguhr/german-sentiment-lib: An easy to use python package for deep learning-based german sentiment classification.](https://github.com/oliverguhr/german-sentiment-lib)).

I have a dataset of tweets in German language. Do I need to use tokenizer before applying this model? And if yes which one?

In the repository as an example no tokenizer is being used.

Thank you!

---

<div class="post-metadata">

**Author:** ![stefan-it](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/stefan-it/32/20175_2.png) [@stefan-it](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fstefan-it)%5C
**Post date:** [February 10, 2023, 12:36pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgerman-sentiment-tokenizer%2F31448%2F2 "2023-02-10T12:36:06Z")

</div>

Hi @Al3ksandra ,

the repo uses the `oliverguhr/german-sentiment-bert` model:

> <https://github.com/oliverguhr/german-sentiment-lib/blob/master/germansentiment/sentimentmodel.py#L7>

Which is basically a fine-tuned model of the `bert-base-german-cased` on sentiment datasets. This can be verified when comparing the vocab of the original German BERT model and the fine-tuned one:

```bash
$ curl https://huggingface.co/oliverguhr/german-sentiment-bert/resolve/main/vocab.txt > vocab_sentiment.txt
$ curl https://huggingface.co/bert-base-german-cased/resolve/main/vocab.txt > vocab_german_bert.txt

$ diff vocab_sentiment.txt vocab_german_bert.txt

```

It has no difference.

You do not need to use your own tokenizer/cleanup steps, because it has built-in methods. So when calling the `predict_sentiment` method, your input text will be tokenized and cleaned before:

> <https://github.com/oliverguhr/german-sentiment-lib/blob/367f8f55d92fd85e6cde8bc59dc8dbad7ec88071/germansentiment/sentimentmodel.py#L25>

I hope this helps 🙂

---

<div class="post-metadata">

**Author:** ![Al3ksandra](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/al3ksandra/32/14073_2.png) [@Al3ksandra](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FAl3ksandra)%5C
**Post date:** [February 10, 2023, 3:29pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgerman-sentiment-tokenizer%2F31448%2F3 "2023-02-10T15:29:24Z")

</div>

Thanks Stefan! It helps 😃
