German Sentiment Classification with Bert
This model was trained for sentiment classification of German language texts. To achieve the best results all model inputs needs to be preprocessed with the same procedure, that was applied during the training. To simplify the usage of the model,
we provide a Python package that bundles the code need for the preprocessing and inferencing.
The model uses the Googles Bert architecture and was trained on 1.834 million German-language samples. The training data contains texts from various domains like Twitter, Facebook and movie, app and hotel reviews.
You can find more information about the dataset and the training process in the paper.
Using the Python package
To get started install the package from pypi:
pip install germansentiment<br />
from germansentiment import SentimentModel<br /> model = SentimentModel()<br /> texts = [<br /> "Mit keinem guten Ergebniss","Das ist gar nicht mal so gut",<br /> "Total awesome!","nicht so schlecht wie erwartet",<br /> "Der Test verlief positiv.","Sie fährt ein grünes Auto."]<br /> result = model.predict_sentiment(texts)<br /> print(result)<br />
The code above will output following list:
["negative","negative","positive","positive","neutral", "neutral"]<br />
Output class probabilities
from germansentiment import SentimentModel<br /> model = SentimentModel()<br /> classes, probabilities = model.predict_sentiment(["das ist super"], output_probabilities = True)<br /> print(classes, probabilities)<br />
['positive'] [[['positive', 0.9761366844177246], ['negative', 0.023540444672107697], ['neutral', 0.00032294404809363186]]]<br />
Model and Data
If you are interested in code and data that was used to train this model please have a look at this repository and our paper. Here is a table of the F1 scores that this model achieves on different datasets. Since we trained this model with a newer version of the transformer library, the results are slightly better than reported in the paper.
Dataset | F1 micro Score |
---|---|
holidaycheck | 0.9568 |
scare | 0.9418 |
filmstarts | 0.9021 |
germeval | 0.7536 |
PotTS | 0.6780 |
emotions | 0.9649 |
sb10k | 0.7376 |
Leipzig Wikipedia Corpus 2016 | 0.9967 |
all | 0.9639 |
收录说明:
1、本网页并非 oliverguhr/german-sentiment-bert 官网网址页面,此页面内容编录于互联网,只作展示之用;2、如果有与 oliverguhr/german-sentiment-bert 相关业务事宜,请访问其网站并获取联系方式;3、本站与 oliverguhr/german-sentiment-bert 无任何关系,对于 oliverguhr/german-sentiment-bert 网站中的信息,请用户谨慎辨识其真伪。4、本站收录 oliverguhr/german-sentiment-bert 时,此站内容访问正常,如遇跳转非法网站,有可能此网站被非法入侵或者已更换新网址,导致旧网址被非法使用,5、如果你是网站站长或者负责人,不想被收录请邮件删除:i-hu#Foxmail.com (#换@)
前往AI网址导航
2、本站所有文章、图片、资源等如果未标明原创,均为收集自互联网公开资源;分享的图片、资源、视频等,出镜模特均为成年女性正常写真内容,版权归原作者所有,仅作为个人学习、研究以及欣赏!如有涉及下载请24小时内删除;
3、如果您发现本站上有侵犯您的权益的作品,请与我们取得联系,我们会及时修改、删除并致以最深的歉意。邮箱: i-hu#(#换@)foxmail.com