Unverified Commit 205bf0b7 authored by GmailB's avatar GmailB Committed by GitHub
Browse files

Update README.md (#7444)

Hi, just corrected the example code, add 2 links and fixed some typos
parent 74d8d69b
...@@ -12,15 +12,22 @@ widget: ...@@ -12,15 +12,22 @@ widget:
## Model description ## Model description
This model performs sentiment analysis on Italian political twitter sentences. It was trained starting from an instance of "bert-base-italian-uncased-xxl" and fine-tuned on an Italian dataset of tweets. This model performs sentiment analysis on Italian political twitter sentences. It was trained starting from an instance of "bert-base-italian-uncased-xxl" and fine-tuned on an Italian dataset of tweets. You can try it out at https://www.unideeplearning.com/twitter_sa/ (in italian!)
#### Hands-on #### Hands-on
```python ```python
import torch import torch
from torch import nn from torch import nn
from transformers import AutoTokenizer, AutoModelForSequenceClassification
text = "Giueseppe Rossi è un pessimo politico" tokenizer = AutoTokenizer.from_pretrained("unideeplearning/polibert_sa")
model = AutoModelForSequenceClassification.from_pretrained("unideeplearning/polibert_sa")
text = "Giuseppe Rossi è un pessimo politico"
input_ids = tokenizer.encode(text, add_special_tokens=True, return_tensors= 'pt') input_ids = tokenizer.encode(text, add_special_tokens=True, return_tensors= 'pt')
logits, = model(input_ids) logits, = model(input_ids)
...@@ -41,4 +48,6 @@ print(prob.argmax().tolist()) ...@@ -41,4 +48,6 @@ print(prob.argmax().tolist())
## Acknowledgments ## Acknowledgments
Thanks to the support from: Thanks to the support from:
the [Hugging Face](https://huggingface.co/), Unione Professionisti (https://www.unioneprofessionisti.com/) the [Hugging Face](https://huggingface.co/), https://www.unioneprofessionisti.com
https://www.unideeplearning.com/
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment