Description
This Spanish NER model will identify the label TARGET
from a financial statement. 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
TARGET
How to use
documentAssembler = nlp.DocumentAssembler()\
.setInputCol("text")\
.setOutputCol("document")
tokenizer = nlp.Tokenizer()\
.setInputCols("document")\
.setOutputCol("token")
tokenClassifier = finance.BertForTokenClassification.pretrained("finner_bert_target","es","finance/models")\
.setInputCols("token", "document")\
.setOutputCol("label")\
.setCaseSensitive(True)
converter = finance.NerConverterInternal()\
.setInputCols(["document", "token", "label"])\
.setOutputCol("ner")
pipeline = nlp.Pipeline(
stages=[
documentAssembler,
tokenizer,
tokenClassifier,
converter
]
)
Results
+-----------+------+
|chunk |entity|
+-----------+------+
|Presupuesto|TARGET|
|populista |TARGET|
+-----------+------+
Model Information
Model Name: | finner_bert_target |
Compatibility: | Finance NLP 1.0.0+ |
License: | Licensed |
Edition: | Official |
Input Labels: | [sentence, token] |
Output Labels: | [ner] |
Language: | es |
Size: | 406.6 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
B-TARGET 0.76 0.82 0.79 435
micro-avg 0.76 0.82 0.79 435
macro-avg 0.76 0.82 0.79 435
weighted-avg 0.76 0.82 0.79 435