This is the bert-base-multilingual-cased model, fine-tuned using the KenyaCorpus dataset. It's been trained on question-answer pairs, including unanswerable questions, for the task of Question Answering in Swahili Language.
Question answering (QA) is a computer science discipline within the fields of information retrieval and NLP that help in the development of systems in such a way that, given a question in natural language, can extract relevant information from provided data and present it in the form of natural language answers.
Overview
Language model used: bert-base-multilingual-cased Language: Kiswahili
Downstream-task: Extractive Swahili QA Training data: KenyaCorpus
Eval data: KenyaCorpus
Code: See an example QA pipeline on Haystack Infrastructure: AWS NVIDIA A100 Tensor Core GPU
Haystack is an NLP framework by deepset. You can use this model in a Haystack pipeline to do question answering at scale (over many documents). To load the model in Haystack:
python
1reader = FARMReader(model_name_or_path="innocent-charles/Swahili-question-answer-latest-cased")2# or 3reader = TransformersReader(model_name_or_path="innocent-charles/Swahili-question-answer-latest-cased",tokenizer="innocent-charles/Swahili-question-answer-latest-cased")
For a complete example of Swahili-question-answer-latest-cased being used for Swahili Question Answering, check out the Tutorials in Haystack Documentation
In Transformers
python
1from transformers import AutoModelForQuestionAnswering, AutoTokenizer, pipeline
23model_name ="innocent-charles/Swahili-question-answer-latest-cased"45# a) Get predictions6nlp = pipeline('question-answering', model=model_name, tokenizer=model_name)7QA_input ={8'question':'Asubuhi ilitupata pambajioi pa hospitali gani?',9'context':'Asubuhi hiyo ilitupata pambajioni pa hospitali ya Uguzwa.'10}11res = nlp(QA_input)1213# b) Load model & tokenizer14model = AutoModelForQuestionAnswering.from_pretrained(model_name)15tokenizer = AutoTokenizer.from_pretrained(model_name)
The project is still going, hence the model is still updated after training the model in more data, Therefore pull requests are welcome to contribute to increase the performance of the model.
I build good things using Artificial Intelligence ,Data and Analytics , with over 3 Years of Experience as Applied AI Engineer & Data scientist from a strong background in Software Engineering ,with passion and extensive experience in Data and Businesses.