Update README.md
Browse files
README.md
CHANGED
@@ -20,6 +20,33 @@ This model has been trained on the following datasets:
|
|
20 |
|
21 |
# Use
|
22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
* Making token level inferences with Auto classes
|
24 |
```python
|
25 |
from transformers import AutoTokenizer, AutoModelForTokenClassification
|
@@ -82,33 +109,7 @@ tok_levl_pred = list(zip(tokenizer.convert_ids_to_tokens(decoded_toks), decoded_
|
|
82 |
('.', 'O')]
|
83 |
```
|
84 |
|
85 |
-
# OR
|
86 |
-
|
87 |
-
* Using the pipeline directly for end-to-end inference:
|
88 |
-
```python
|
89 |
-
from transformers import pipeline
|
90 |
-
|
91 |
-
ate_sent_pipeline = pipeline(task='ner',
|
92 |
-
aggregation_strategy='simple',
|
93 |
-
model="gauneg/roberta-base-absa-ate-sentiment")
|
94 |
-
|
95 |
-
text_input = "Been here a few times and food has always been good but service really suffers when it gets crowded."
|
96 |
-
ate_sent_pipeline(text_input)
|
97 |
-
```
|
98 |
-
* pipeline output:
|
99 |
-
```bash
|
100 |
-
[{'entity_group': 'pos', #sentiment polarity
|
101 |
-
'score': 0.8447307,
|
102 |
-
'word': ' food', # aspect term
|
103 |
-
'start': 26,
|
104 |
-
'end': 30},
|
105 |
-
{'entity_group': 'neg', #sentiment polarity
|
106 |
-
'score': 0.81927896,
|
107 |
-
'word': ' service', #aspect term
|
108 |
-
'start': 56,
|
109 |
-
'end': 63}]
|
110 |
|
111 |
-
```
|
112 |
|
113 |
# Evaluation on Benchmark Test Datasets
|
114 |
|
|
|
20 |
|
21 |
# Use
|
22 |
|
23 |
+
* Using the pipeline directly for end-to-end inference:
|
24 |
+
```python
|
25 |
+
from transformers import pipeline
|
26 |
+
|
27 |
+
ate_sent_pipeline = pipeline(task='ner',
|
28 |
+
aggregation_strategy='simple',
|
29 |
+
model="gauneg/roberta-base-absa-ate-sentiment")
|
30 |
+
|
31 |
+
text_input = "Been here a few times and food has always been good but service really suffers when it gets crowded."
|
32 |
+
ate_sent_pipeline(text_input)
|
33 |
+
```
|
34 |
+
* pipeline output:
|
35 |
+
```bash
|
36 |
+
[{'entity_group': 'pos', #sentiment polarity
|
37 |
+
'score': 0.8447307,
|
38 |
+
'word': ' food', # aspect term
|
39 |
+
'start': 26,
|
40 |
+
'end': 30},
|
41 |
+
{'entity_group': 'neg', #sentiment polarity
|
42 |
+
'score': 0.81927896,
|
43 |
+
'word': ' service', #aspect term
|
44 |
+
'start': 56,
|
45 |
+
'end': 63}]
|
46 |
+
|
47 |
+
```
|
48 |
+
|
49 |
+
# OR
|
50 |
* Making token level inferences with Auto classes
|
51 |
```python
|
52 |
from transformers import AutoTokenizer, AutoModelForTokenClassification
|
|
|
109 |
('.', 'O')]
|
110 |
```
|
111 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
|
|
|
113 |
|
114 |
# Evaluation on Benchmark Test Datasets
|
115 |
|