Update README.md
Browse files
README.md
CHANGED
@@ -29,36 +29,16 @@ model-index:
|
|
29 |
|
30 |
|
31 |
|
32 |
-
|
33 |
-
This is an implementation of the method described in
|
34 |
-
```bibtex
|
35 |
-
@misc{samuel2022direct,
|
36 |
-
title={Direct parsing to sentiment graphs},
|
37 |
-
author={David Samuel and Jeremy Barnes and Robin Kurtz and Stephan Oepen and Lilja Øvrelid and Erik Velldal},
|
38 |
-
year={2022},
|
39 |
-
eprint={2203.13209},
|
40 |
-
archivePrefix={arXiv},
|
41 |
-
primaryClass={cs.CL}
|
42 |
-
}
|
43 |
-
```
|
44 |
-
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).
|
45 |
-
The model is also available in the form of a [HF space](https://huggingface.co/spaces/ltg/ssa-perin).
|
46 |
-
|
47 |
|
48 |
-
|
49 |
-
The proposed method suggests three different ways to encode the sentiment graph: "node-centric", "labeled-edge", and "opinion-tuple".
|
50 |
-
The current model
|
51 |
-
- uses "labeled-edge" graph encoding
|
52 |
-
- does not use character-level embedding
|
53 |
-
- all other hyperparameters are set to [default values](https://github.com/jerbarnes/direct_parsing_to_sent_graph/blob/main/perin/config/edge_norec.yaml)
|
54 |
-
, and it achieves the following results on the held-out set of the dataset:
|
55 |
|
56 |
-
|
57 |
-
|:----------------------------:|:----------:|:---------------------------:|
|
58 |
-
| 0.434 | 0.541 | 0.926 |
|
59 |
|
|
|
60 |
|
61 |
-
|
62 |
|
63 |
```python
|
64 |
>>> import model_wrapper
|
@@ -70,4 +50,38 @@ The model can be easily used for predicting sentiment tuples as follows:
|
|
70 |
'Target': [['svart', 'kaffe'], ['9:14', '15:20']],
|
71 |
'Polar_expression': [['liker'], ['3:8']],
|
72 |
'Polarity': 'Positive'}]}]
|
73 |
-
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
|
30 |
|
31 |
|
32 |
+
We here release a pretrained model (and an easy-to-run wrapper) for structured sentiment analysis of Norwegian text, pre-trained on the [NoReC_fine dataset](https://github.com/ltgoslo/norec_fine).
|
33 |
+
This is an implementation of the method described in the paper [Direct parsing to sentiment graphs](https://aclanthology.org/2022.acl-short.51/) by Samuel et al., 2022.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
|
35 |
+
To see a demo of how it works, you can try the model in a [Hugging Face Space](https://huggingface.co/spaces/ltg/ssa-perin).
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
|
37 |
+
## Example usage
|
|
|
|
|
38 |
|
39 |
+
The model attempts to identify the following components for a given sentence: source expressions (the opinion holder), target expressions (what the opinion is directed towards), polar expressions (the part of the text indicating that an opinion expressed), and finally the polarity (positive or negative). For more information about the definition of these concepts, please the paper [A Fine-grained Sentiment Dataset for Norwegian](https://aclanthology.org/2020.lrec-1.618/) by Øvrelid et al. 2020. For each identified expression, the character offsets in the text are also provided.
|
40 |
|
41 |
+
Here is an eaxmple showing to use the model for predicting such sentiment tuples:
|
42 |
|
43 |
```python
|
44 |
>>> import model_wrapper
|
|
|
50 |
'Target': [['svart', 'kaffe'], ['9:14', '15:20']],
|
51 |
'Polar_expression': [['liker'], ['3:8']],
|
52 |
'Polarity': 'Positive'}]}]
|
53 |
+
```
|
54 |
+
|
55 |
+
|
56 |
+
## Details about the model configuration
|
57 |
+
|
58 |
+
The method proposed by Samuel et al. 2022 suggests three different ways to encode the sentiment graph: "node-centric", "labeled-edge", and "opinion-tuple".
|
59 |
+
The model released here
|
60 |
+
- uses "labeled-edge" graph encoding,
|
61 |
+
- does not use character-level embedding,
|
62 |
+
- all other hyperparameters are set to [default values](https://github.com/jerbarnes/direct_parsing_to_sent_graph/blob/main/perin/config/edge_norec.yaml),
|
63 |
+
- is trained on top of underlying masked language model [NorBERT 2](https://huggingface.co/ltg/norbert2).
|
64 |
+
|
65 |
+
It achieves the following results on the held-out test set of NoReC_fine:
|
66 |
+
|
67 |
+
| Unlabeled sentiment tuple F1 | Target F1 | Relative polarity precision |
|
68 |
+
|:----------------------------:|:----------:|:---------------------------:|
|
69 |
+
| 0.434 | 0.541 | 0.926 |
|
70 |
+
|
71 |
+
The scripts used for training can be found on the [github](https://github.com/jerbarnes/direct_parsing_to_sent_graph) repository accompanying the paper by Samuel et al., 2022.
|
72 |
+
|
73 |
+
|
74 |
+
## Quote us
|
75 |
+
|
76 |
+
If you use this model in your academic work, please quote the following paper:
|
77 |
+
```bibtex
|
78 |
+
@inproceedings{samuel2022,
|
79 |
+
title={Direct parsing to sentiment graphs},
|
80 |
+
author={David Samuel and Jeremy Barnes and Robin Kurtz and
|
81 |
+
Stephan Oepen and Lilja Øvrelid and Erik Velldal},
|
82 |
+
year={2022},
|
83 |
+
booktitle = "Proceedings of the 60th Annual Meeting of
|
84 |
+
the Association for Computational Linguistics",
|
85 |
+
address = "Dublin, Ireland"
|
86 |
+
}
|
87 |
+
```
|