Financial Question Answering (Bert, Large)

Description

Financial large Bert-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.BertForQuestionAnswering.pretrained("finqa_bert_large","en", "finance/models") \
       .setInputCols(["document_question", "document_context"]) \
       .setOutputCol("answer") \
       .setCaseSensitive(True)

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

example = spark.createDataFrame([["On which market is their common stock traded?", "Our common stock is traded on the Nasdaq Global Select Market under the symbol CDNS."]]).toDF("question", "context")

result = pipeline.fit(example).transform(example)
result.select('answer.result').show()

Results

`Nasdaq Global Select Market under the symbol CDNS`

Model Information

Model Name: finqa_bert_large
Compatibility: Finance NLP 1.0.0+
License: Licensed
Edition: Official
Input Labels: [sentence, token]
Output Labels: [embeddings]
Language: en
Size: 1.3 GB
Case sensitive: true
Max sentence length: 512

References

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