Downloads · 30 days
16
0% of all-time downloads
edumunozsala/beto_sentiment_analysis_es
beto_sentiment_analysis_es is a text classification model from edumunozsala. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
This model was trained using Amazon SageMaker and the new Hugging Face Deep Learning container, The base model is BETO which is a BERT-base model pre-trained on a spanish corpus. BETO is of size similar to a BERT-Base…
Downloads · 30 days
16
0% of all-time downloads
All-time downloads
22.1K
Public
Parameters
110M
879 MB on disk
Likes
0
Public
Click a slice to open those files.
.bin440 MB · 50%
How the weights are stored.
F32110M · 100%
From the Hugging Face model README
This model was trained using Amazon SageMaker and the new Hugging Face Deep Learning container, The base model is BETO which is a BERT-base model pre-trained on a spanish corpus. BETO is of size similar to a BERT-Base and was trained with the Whole Word Masking technique.
BETO Citation
Spanish Pre-Trained BERT Model and Evaluation Data
@inproceedings{CaneteCFP2020,
title={Spanish Pre-Trained BERT Model and Evaluation Data},
author={Cañete, José and Chaperon, Gabriel and Fuentes, Rodrigo and Ho, Jou-Hui and Kang, Hojin and Pérez, Jorge},
booktitle={PML4DC at ICLR 2020},
year={2020}
}
The dataset is a collection of movie reviews in Spanish, about 50,000 reviews. The dataset is balanced and provides every review in english, in spanish and the label in both languages.
Sizes of datasets:
This model is intented for Sentiment Analysis for spanish corpus and finetuned specially for movie reviews but it can be applied to other kind of reviews.
{
"epochs": "4",
"train_batch_size": "32",
"eval_batch_size": "8",
"fp16": "true",
"learning_rate": "3e-05",
"model_name": "\"dccuchile/bert-base-spanish-wwm-uncased\"",
"sagemaker_container_log_level": "20",
"sagemaker_program": "\"train.py\"",
}
Accuracy = 0.9101333333333333
F1 Score = 0.9088450094671354
Precision = 0.9105691056910569
Recall = 0.9071274298056156
import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("edumunozsala/beto_sentiment_analysis_es")
model = AutoModelForSequenceClassification.from_pretrained("edumunozsala/beto_sentiment_analysis_es")
text ="Se trata de una película interesante, con un solido argumento y un gran interpretación de su actor principal"
input_ids = torch.tensor(tokenizer.encode(text)).unsqueeze(0)
outputs = model(input_ids)
output = outputs.logits.argmax(1)
Created by Eduardo Muñoz/@edumunozsala