Instructions to use Neperl/bilingual-sentiment-comparison with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use Neperl/bilingual-sentiment-comparison with Keras:
# Available backend options are: "jax", "torch", "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" import keras model = keras.saving.load_model("hf://Neperl/bilingual-sentiment-comparison") - Notebooks
- Google Colab
- Kaggle
File size: 2,227 Bytes
552c080 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | {
"experiment": "bilingual-sentiment-comparison",
"sample_size": 30000,
"best_model": "XLM-RoBERTa",
"best_f1": 0.695640803447516,
"metrics": [
{
"Metric": "Overall Accuracy",
"Baseline LSTM": 0.681,
"XLM-RoBERTa": 0.748
},
{
"Metric": "Macro F1",
"Baseline LSTM": 0.6194696729841381,
"XLM-RoBERTa": 0.695640803447516
},
{
"Metric": "Weighted F1",
"Baseline LSTM": 0.672862679937181,
"XLM-RoBERTa": 0.7470792508149281
},
{
"Metric": "Negative F1",
"Baseline LSTM": 0.7376116978066612,
"XLM-RoBERTa": 0.8036605657237936
},
{
"Metric": "Neutral F1",
"Baseline LSTM": 0.3525046382189239,
"XLM-RoBERTa": 0.43844856661045534
},
{
"Metric": "Positive F1",
"Baseline LSTM": 0.7682926829268293,
"XLM-RoBERTa": 0.8448132780082988
},
{
"Metric": "English Macro F1",
"Baseline LSTM": 0.6188346258661638,
"XLM-RoBERTa": 0.6959503203269959
},
{
"Metric": "Spanish Macro F1",
"Baseline LSTM": 0.6200182612567712,
"XLM-RoBERTa": 0.6952735701544848
}
],
"inference_examples": [
{
"Text": "I absolutely love this new translation tool, it works flawlessly!",
"LSTM Prediction": "Positive",
"XLM-R Prediction": "Positive"
},
{
"Text": "El servicio al cliente fue terrible y el producto lleg\u00f3 roto.",
"LSTM Prediction": "Negative",
"XLM-R Prediction": "Negative"
},
{
"Text": "The movie was okay, not great but not bad either.",
"LSTM Prediction": "Neutral",
"XLM-R Prediction": "Neutral"
},
{
"Text": "Esta pel\u00edcula es una obra de arte, me encant\u00f3 cada segundo.",
"LSTM Prediction": "Positive",
"XLM-R Prediction": "Positive"
},
{
"Text": "I am not sure how to feel about this update, it has some good and bad aspects.",
"LSTM Prediction": "Neutral",
"XLM-R Prediction": "Neutral"
}
],
"config": {
"lstm_embedding_dim": 128,
"lstm_units": 64,
"max_seq_length": 128,
"xlmr_model": "xlm-roberta-base",
"epochs": 3,
"batch_size": 16,
"seed": 42
}
} |