oliverguhr / german-sentiment

A data set and model for german sentiment classification.
MIT License
61 stars 11 forks source link

Small error that breaks example code on Hugging Face model card #7

Closed rnckp closed 2 years ago

rnckp commented 2 years ago

Hi Oliver

First of all – thanks very much for making your model available. Really helpful and very much appreciated.

I noticed a small quirk that broke your sample code on Hugging Face for me:

Bildschirmfoto 2021-11-17 um 20 31 31

In the function clean_text you start by replacing \n with spaces. If I just copy and paste the code I don't copy the invisible \n but get an actual line break in my IDE (Sublime). This leads to wrong predictions.

If I replace the line break with an actual \n I get correct predictions. It might be helpful to fix that in the sample code if possible.

Again – thanks for your work. 👍

Have a great day!

oliverguhr commented 2 years ago

Hi Patrick, thanks for the feedback and thanks for pointing this out. I literally copied the code from the sentiment python package, which does use "\n"

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

However, I fixed the model card. Thanks again!