gauneg commited on
Commit
1f9b5e3
1 Parent(s): 9b9ed2e

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
@@ -6,3 +6,4 @@ base_model:
6
  - FacebookAI/roberta-base
7
  pipeline_tag: token-classification
8
  ---
 
 
6
  - FacebookAI/roberta-base
7
  pipeline_tag: token-classification
8
  ---
9
+