Spaces:
Runtime error
Runtime error
Update README.md
Browse files
README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
---
|
2 |
-
title: Sentiment Analysis
|
3 |
emoji: 🤔
|
4 |
colorFrom: purple
|
5 |
colorTo: yellow
|
@@ -8,23 +8,3 @@ sdk_version: 3.1.7
|
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
---
|
11 |
-
|
12 |
-
This space provides a gradio demo of a [pretrained model](https://huggingface.co/ltg/ssa-perin) (with an easy-to-run wrapper) for structured sentiment analysis (SSA) of Norwegian text, trained on the [NoReC_fine](https://github.com/ltgoslo/norec_fine) dataset. It implements a method described in the paper [Direct parsing to sentiment graphs](https://aclanthology.org/2022.acl-short.51/) by Samuel et al. 2022.
|
13 |
-
|
14 |
-
The model will attempt to identify the following components for a given sentence it deems to be sentiment-bearing: _source expressions_ (the opinion holder), _target expressions_ (what the opinion is directed towards), _polar expressions_ (the part of the text indicating that an opinion is expressed), and finally the _polarity_ (positive or negative).
|
15 |
-
|
16 |
-
See the code below for an example of how you can use the model yourself for predicting such sentiment tuples (along with character offsets in the text):
|
17 |
-
|
18 |
-
```python
|
19 |
-
>>> import model_wrapper
|
20 |
-
>>> model = model_wrapper.PredictionModel()
|
21 |
-
>>> model.predict(['vi liker svart kaffe'])
|
22 |
-
[{'sent_id': '0',
|
23 |
-
'text': 'vi liker svart kaffe',
|
24 |
-
'opinions': [{'Source': [['vi'], ['0:2']],
|
25 |
-
'Target': [['svart', 'kaffe'], ['9:14', '15:20']],
|
26 |
-
'Polar_expression': [['liker'], ['3:8']],
|
27 |
-
'Polarity': 'Positive'}]}]
|
28 |
-
```
|
29 |
-
|
30 |
-
To download the model and find more in-depth documentation, please see (https://huggingface.co/ltg/ssa-perin)[https://huggingface.co/ltg/ssa-perin]
|
|
|
1 |
---
|
2 |
+
title: Structured Sentiment Analysis for Norwegian
|
3 |
emoji: 🤔
|
4 |
colorFrom: purple
|
5 |
colorTo: yellow
|
|
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|