oliverguhr / german-sentiment-lib

An easy to use python package for deep learning-based german sentiment classification.
https://pypi.org/project/germansentiment/
MIT License
58 stars 7 forks source link

Irony not recognized enough by this library #15

Open nnworkspace opened 2 months ago

nnworkspace commented 2 months ago

Hi Oliver,

thank you very much for this library, this is easy to use, pretty accurate at scoring German sentiments, runs fast and we like it very much!

But now we saw that this lib is not very good at detecting the irony in the text. Examples:

{
        ...
        "text": "Wir müssen alles (!) tun um den digitalen Euro als CBDC zu verhindern. ALLES!!! Ich habe dazu einen Roman verfasst, der hoffentlich NIE wahr wird, aber mit CBDCs leicht wahr werden kann",
        "sentiment": {
            "class_type": "neutral",
            "positive_score": 0.05654817819595337,
            "negative_score": 0.39234355092048645,
            "neutral_score": 0.5511082410812378
        }
    },
    {
        ...
        "text": "Das staatliche Geldmonopol ist ein maximales Erfolgsmodell: https://www.bitrawr.com/demonetized-currencies. Das war heute an Halloween der gruseligste Post, den ich gesehen habe. Chapeau :-).",
        "sentiment": {
            "class_type": "neutral",
            "positive_score": 0.002023849170655012,
            "negative_score": 0.010454664006829262,
            "neutral_score": 0.9875214695930481
        }
    },
   {
        ...
        "text": "Ich bin zu 100% von dem digitalen EURO überzeugt und würde SOFORT wechseln. Für Aluhutträger und sonstige Schlafschafe wäre ja immer noch BTC eine gute Alternative...weil selbst im Hartgeld Ortungschips eingebaut sind.",
        "sentiment": {
            "class_type": "positive",
            "positive_score": 0.938581109046936,
            "negative_score": 0.05730881169438362,
            "neutral_score": 0.004110132809728384
        }
    },

All three above text actually expressed negative sentiments. But all of them were classified as neutral or negative.

Is there any way to fix this? :-)

Best, Nicole

oliverguhr commented 2 months ago

Hi @nnworkspace, thanks for the feedback. The model was not trained for irony. The best way would be to fine-tune it with a (small) dataset containing of irony examples.

Contact me if you need professional support :)

Best Oliver