gauneg commited on
Commit
d2dd34b
1 Parent(s): 1f9b5e3

Update README.md

Browse files

## Usage

* Importing the libraries and loading the models and the pipeline
```python
from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline
model_id = "gauneg/roberta-base-absa-ate-sentiment"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForTokenClassification.from_pretrained(model_id)

ate_sent_pipeline = pipeline(task='ner',
aggregation_strategy='simple',
tokenizer=tokenizer,
model=model)



```
* Using the pipeline object:
```python
text_input = "Been here a few times and food has always been good but service really suffers when it gets crowded."
ate_sent_pipeline(text_input)
```
* pipeline output:
```bash
[{'entity_group': 'pos',
'score': 0.8447307,
'word': ' food',
'start': 26,
'end': 30},
{'entity_group': 'neg',
'score': 0.81927896,
'word': ' service',
'start': 56,
'end': 63}]

```

Files changed (1) hide show
  1. README.md +1 -0
README.md CHANGED
@@ -7,3 +7,4 @@ base_model:
7
  pipeline_tag: token-classification
8
  ---
9
 
 
 
7
  pipeline_tag: token-classification
8
  ---
9
 
10
+