Description
Pretrained AlbertForQuestionAnswering model, adapted from Hugging Face and curated to provide scalability and production-readiness using Spark NLP.albert_persian_farsi_base_v2_pquad_and_persian_qa
is a English model originally trained by mohsenfayyaz.
How to use
document_assembler = MultiDocumentAssembler() \
.setInputCol(["question", "context"]) \
.setOutputCol(["document_question", "document_context"])
spanClassifier = AlbertForQuestionAnswering.pretrained("albert_persian_farsi_base_v2_pquad_and_persian_qa","en") \
.setInputCols(["document_question","document_context"]) \
.setOutputCol("answer")
pipeline = Pipeline().setStages([document_assembler, spanClassifier])
pipelineModel = pipeline.fit(data)
pipelineDF = pipelineModel.transform(data)
val document_assembler = new MultiDocumentAssembler()
.setInputCol(Array("question", "context"))
.setOutputCol(Array("document_question", "document_context"))
val spanClassifier = AlbertForQuestionAnswering
.pretrained("albert_persian_farsi_base_v2_pquad_and_persian_qa", "en")
.setInputCols(Array("document_question","document_context"))
.setOutputCol("answer")
val pipeline = new Pipeline().setStages(Array(document_assembler, spanClassifier))
val pipelineModel = pipeline.fit(data)
val pipelineDF = pipelineModel.transform(data)
Model Information
Model Name: | albert_persian_farsi_base_v2_pquad_and_persian_qa |
Compatibility: | Spark NLP 5.1.2+ |
License: | Open Source |
Edition: | Official |
Input Labels: | [document_question, document_context] |
Output Labels: | [answer] |
Language: | en |
Size: | 66.3 MB |
References
https://huggingface.co/mohsenfayyaz/albert-fa-base-v2_pquad_and_persian_qa