Financial Question Answering (RoBerta)

Description

Financial RoBerta-based Question Answering model, trained on squad-v2, finetuned on proprietary Financial questions and answers.

Predicted Entities

Copy S3 URI

How to use


documentAssembler = nlp.MultiDocumentAssembler()\
        .setInputCols(["question", "context"])\
        .setOutputCols(["document_question", "document_context"])

spanClassifier = nlp.RoBertaForQuestionAnswering.pretrained("finqa_roberta","en", "finance/models") \
.setInputCols(["document_question", "document_context"]) \
.setOutputCol("answer") \
.setCaseSensitive(True)


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

example = spark.createDataFrame([["What is the current total Operating Profit?", "Operating profit totaled EUR 9.4 mn , down from EUR 11.7 mn in 2004"]]).toDF("question", "context")

result = pipeline.fit(example).transform(example)

result.select('answer.result').show()

Results

`9.4 mn , down from EUR 11.7`

Model Information

Model Name: finqa_roberta
Compatibility: Finance NLP 1.0.0+
License: Licensed
Edition: Official
Input Labels: [question, context]
Output Labels: [answer]
Language: en
Size: 248.1 MB
Case sensitive: true
Max sentence length: 512

References

Trained on squad-v2, finetuned on proprietary Financial questions and answers.