Financial Consumer Sentiments (Codalab)

Description

This Spanish Text Classifier will identify from the viewpoint of a target whether a financial statement is positive, neutral or negative. This model is trained from the competition - IBERLEF 2023 Task - FinancES. Financial Targeted Sentiment Analysis in Spanish. We have used the participation dataset which is a small subset of the main one to train this model.

Predicted Entities

positive, neutral, negative

Copy S3 URI

How to use

documentAssembler = nlp.DocumentAssembler()\
  .setInputCol("text")\
  .setOutputCol("document")

tokenizer = nlp.Tokenizer()\
  .setInputCols("document")\
  .setOutputCol("token")
  
sequenceClassifier = finance.BertForSequenceClassification.pretrained("finclf_bert_consumer_sentiments","es","finance/models")\
  .setInputCols("token", "document")\
  .setOutputCol("class")\
  .setCaseSensitive(True)

pipeline =  nlp.Pipeline(
    stages=[
  documentAssembler,
  tokenizer,
  sequenceClassifier
    ]
)

Results

+-------------------------------------------------------------------------+----------+
|text                                                                     |result    |
+-------------------------------------------------------------------------+----------+
|Renfe afronta mañana un nuevo día de paros parciales de los maquinistas|[negative]|
+-------------------------------------------------------------------------+----------+

Model Information

Model Name: finclf_bert_consumer_sentiments
Compatibility: Finance NLP 1.0.0+
License: Licensed
Edition: Official
Input Labels: [document, token]
Output Labels: [class]
Language: es
Size: 408.7 MB
Case sensitive: true
Max sentence length: 128

References

https://codalab.lisn.upsaclay.fr/competitions/10052#learn_the_details

Benchmarking

 
labels            precision    recall  f1-score   support
    negative       0.59      0.72      0.66        36
     neutral       0.77      0.79      0.80        80
    positive       0.72      0.55      0.64        42
    accuracy        -         -        0.73       158
   macro-avg       0.69      0.69      0.70       158
weighted-avg       0.71      0.71      0.72       158