Larisa Kolesnichenko commited on
Commit
7ded684
1 Parent(s): 7cf1737

Update README/model card

Browse files
Files changed (1) hide show
  1. README.md +23 -1
README.md CHANGED
@@ -9,4 +9,26 @@ app_file: app.py
9
  pinned: false
10
  ---
11
 
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  pinned: false
10
  ---
11
 
12
+ 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](https://huggingface.co/datasets/norec).
13
+ 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](https://github.com/jerbarnes/direct_parsing_to_sent_graph).
14
+
15
+ The current model uses the 'labeled-edge' graph encoding, and achieves the following results on the NoReC dataset:
16
+
17
+ | Unlabeled sentiment tuple F1 | Target F1 | Relative polarity precision |
18
+ |:----------------------------:|:----------:|:---------------------------:|
19
+ | 0.393 | 0.468 | 0.939 |
20
+
21
+
22
+ The model can be easily used for predicting sentiment tuples as follows:
23
+
24
+ ```python
25
+ >>> import model_wrapper
26
+ >>> model = model_wrapper.PredictionModel()
27
+ >>> model.predict(['vi liker svart kaffe'])
28
+ [{'sent_id': '0',
29
+ 'text': 'vi liker svart kaffe',
30
+ 'opinions': [{'Source': [['vi'], ['0:2']],
31
+ 'Target': [['svart', 'kaffe'], ['9:14', '15:20']],
32
+ 'Polar_expression': [['liker'], ['3:8']],
33
+ 'Polarity': 'Positive'}]}]
34
+ ```