Spaces:
Runtime error
Runtime error
A newer version of the Gradio SDK is available:
5.9.1
metadata
title: Sentiment Analysis
emoji: 🤔
colorFrom: purple
colorTo: yellow
sdk: gradio
sdk_version: 3.1.7
app_file: app.py
pinned: false
This space provides a gradio demo and an easy-to-run wrapper of the pre-trained model for structured sentiment analysis in Norwegian language, pre-trained on the NoReC dataset. This model is an implementation of the paper "Direct parsing to sentiment graphs" (Samuel et al., ACL 2022). The main repository that also contains the scripts for training the model, can be found on the project github.
The current model uses the 'labeled-edge' graph encoding, and achieves the following results on the NoReC dataset:
Unlabeled sentiment tuple F1 | Target F1 | Relative polarity precision |
---|---|---|
0.393 | 0.468 | 0.939 |
The model can be easily used for predicting sentiment tuples as follows:
>>> import model_wrapper
>>> model = model_wrapper.PredictionModel()
>>> model.predict(['vi liker svart kaffe'])
[{'sent_id': '0',
'text': 'vi liker svart kaffe',
'opinions': [{'Source': [['vi'], ['0:2']],
'Target': [['svart', 'kaffe'], ['9:14', '15:20']],
'Polar_expression': [['liker'], ['3:8']],
'Polarity': 'Positive'}]}]