Run this model with HF Jobs
Run harshil10/bert_small on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/harshil10/bert_small. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/harshil10/bert_small on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use harshil10/bert_small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use harshil10/bert_small with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "question-answering" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # pip install "transformers<5.0.0" from transformers import pipeline pipe = pipeline("question-answering", model="harshil10/bert_small")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForQuestionAnswering tokenizer = AutoTokenizer.from_pretrained("harshil10/bert_small") model = AutoModelForQuestionAnswering.from_pretrained("harshil10/bert_small", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload 10 files
Browse filesFiles changed (10)
- README.mdAdded+99
- config.jsonAdded+24
- gitattributes (1).txtAdded+34
- model.safetensorsAdded+3
- pytorch_model.binAdded+3
- pytorch_model.zipAdded+3
- special_tokens_map.jsonAdded+7
- tokenizer.jsonAdded
- tokenizer_config.jsonAdded+14
- vocab.txtAdded
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899---datasets:- squad_v2language:- enmetrics:- accuracylibrary_name: transformerspipeline_tag: question-answeringtags:- question-answering---# QA-BERTQA-BERT is a Question Answering Model. This model is a lighter version of any of the question-answering models out there.
## DatasetThe Stanford Question Answering Dataset (SQuAD) is a widely used benchmark dataset for the task of machine reading comprehension. It consists of over 100,000 question-answer pairs based on a set of Wikipedia articles. The goal is to train models that can answer questions based on their understanding of the given text passages. SQuAD has played a significant role in advancing the state-of-the-art in this field and remains a popular choice for researchers and practitioners alike.Due to GPU limitations, this version is trained on `30k samples` from the Stanford Question Answering Dataset.
<details> <summary><i>Structure of the Data Dictonary</i></summary><!--All you need is a blank line-->
{ "data":[ { "title":"Article Title", "paragraphs":[ { "context":"The context text of the paragraph", "qas":[ { "question":"The question asked about the context", "id":"A unique identifier for the question", "answers":[ { "text":"The answer to the question", "answer_start":"The starting index of the answer in the context" } ] } ] } ] } ], "version":"The version of the SQuAD dataset" }</details>
## ModelBERT (Bidirectional Encoder Representations from Transformers) is a pre-trained transformer-based model for natural language processing tasks such as question answering. BERT is fine-tuned for question answering by adding a linear layer on top of the pre-trained BERT representations to predict the start and end of the answer in the input context. BERT has achieved state-of-the-art results on multiple benchmark datasets, including the Stanford Question Answering Dataset (SQuAD). The fine-tuning process allows BERT to effectively capture the relationships between questions and answers and generate accurate answers.<img src="https://imgs.search.brave.com/F8m-nwp6EIG5vq--OmJLrCDpIkuX6tEQ_kyFKQjlUTs/rs:fit:1200:1200:1/g:ce/aHR0cHM6Ly9ibG9n/LmdyaWRkeW5hbWlj/cy5jb20vY29udGVu/dC9pbWFnZXMvMjAy/MC8xMC9TbGljZS0x/OC5wbmc">For more detail about this read [Understanding QABERT](https://github.com/SRDdev/AnswerMind)
## Inference_Load model_```pythonfrom transformers import AutoTokenizer, AutoModelForQuestionAnswering
QAtokenizer = AutoTokenizer.from_pretrained("SRDdev/QABERT-small")
QAmodel = AutoModelForQuestionAnswering.from_pretrained("SRDdev/QABERT-small")```
_context_```textExtractive Question Answering is the task of extracting an answer from a text given a question. An example of aquestion-answering dataset is the SQuAD dataset, which is entirely based on that task. If you would like to fine-tunea model on a SQuAD task, you may leverage the examples/pytorch/question-answering/run_squad.py script.```
_Build Pipeline_```pythonfrom transformers import pipeline
ask = pipeline("question-answering", model= QAmodel , tokenizer = QAtokenizer)
result = ask(question="What is a good example of a question answering dataset?", context=context)
print(f"Answer: '{result['answer']}'")```
## Contributing
Pull requests are welcome. For major changes, please open an issue firstto discuss what you would like to change.Please make sure to update tests as appropriate.
## Citations```@citation{ QA-BERT-small, author = {Shreyas Dixit}, year = {2023}, url = {https://huggingface.co/SRDdev/QA-BERT-small}}```123456789101112131415161718192021222324{ "_name_or_path": "distilbert-base-uncased", "activation": "gelu", "architectures": [ "DistilBertForQuestionAnswering" ], "attention_dropout": 0.1, "dim": 768, "dropout": 0.1, "hidden_dim": 3072, "initializer_range": 0.02, "max_position_embeddings": 512, "model_type": "distilbert", "n_heads": 12, "n_layers": 6, "pad_token_id": 0, "qa_dropout": 0.1, "seq_classif_dropout": 0.2, "sinusoidal_pos_embds": false, "tie_weights_": true, "torch_dtype": "float32", "transformers_version": "4.26.1", "vocab_size": 30522}12345678910111213141516171819202122232425262728293031323334*.7z filter=lfs diff=lfs merge=lfs -text*.arrow filter=lfs diff=lfs merge=lfs -text*.bin filter=lfs diff=lfs merge=lfs -text*.bz2 filter=lfs diff=lfs merge=lfs -text*.ckpt filter=lfs diff=lfs merge=lfs -text*.ftz filter=lfs diff=lfs merge=lfs -text*.gz filter=lfs diff=lfs merge=lfs -text*.h5 filter=lfs diff=lfs merge=lfs -text*.joblib filter=lfs diff=lfs merge=lfs -text*.lfs.* filter=lfs diff=lfs merge=lfs -text*.mlmodel filter=lfs diff=lfs merge=lfs -text*.model filter=lfs diff=lfs merge=lfs -text*.msgpack filter=lfs diff=lfs merge=lfs -text*.npy filter=lfs diff=lfs merge=lfs -text*.npz filter=lfs diff=lfs merge=lfs -text*.onnx filter=lfs diff=lfs merge=lfs -text*.ot filter=lfs diff=lfs merge=lfs -text*.parquet filter=lfs diff=lfs merge=lfs -text*.pb filter=lfs diff=lfs merge=lfs -text*.pickle filter=lfs diff=lfs merge=lfs -text*.pkl filter=lfs diff=lfs merge=lfs -text*.pt filter=lfs diff=lfs merge=lfs -text*.pth filter=lfs diff=lfs merge=lfs -text*.rar filter=lfs diff=lfs merge=lfs -text*.safetensors filter=lfs diff=lfs merge=lfs -textsaved_model/**/* filter=lfs diff=lfs merge=lfs -text*.tar.* filter=lfs diff=lfs merge=lfs -text*.tflite filter=lfs diff=lfs merge=lfs -text*.tgz filter=lfs diff=lfs merge=lfs -text*.wasm filter=lfs diff=lfs merge=lfs -text*.xz filter=lfs diff=lfs merge=lfs -text*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text123version https://git-lfs.github.com/spec/v1oid sha256:e6cf53ada81236b3988e49e4c5e41e0cf7add596f5a4c0156f2bc8a16be22d34size 265470032123version https://git-lfs.github.com/spec/v1oid sha256:9158014e99ae0a268d4174d495b047e2459d929a5111cc5ac3e03c42c2346050size 265492517123version https://git-lfs.github.com/spec/v1oid sha256:9488dac0960ab9d8f7473e258353baa619925b684c2ab726ce65774d9f1cb12bsize 2448049351234567{ "cls_token": "[CLS]", "mask_token": "[MASK]", "pad_token": "[PAD]", "sep_token": "[SEP]", "unk_token": "[UNK]"}1234567891011121314{ "cls_token": "[CLS]", "do_lower_case": true, "mask_token": "[MASK]", "model_max_length": 512, "name_or_path": "distilbert-base-uncased", "pad_token": "[PAD]", "sep_token": "[SEP]", "special_tokens_map_file": null, "strip_accents": null, "tokenize_chinese_chars": true, "tokenizer_class": "DistilBertTokenizer", "unk_token": "[UNK]"}README.mdAdded+99
config.jsonAdded+24
gitattributes (1).txtAdded+34
model.safetensorsAdded+3
pytorch_model.binAdded+3
pytorch_model.zipAdded+3
special_tokens_map.jsonAdded+7
tokenizer.jsonAdded
tokenizer_config.jsonAdded+14
vocab.txtAdded