Upload folder using huggingface_hub
Browse filesFiles changed (6)
- README.mdAdded+64
- config.jsonAdded+31
- model.safetensorsAdded+3
- tokenizer.jsonAdded
- tokenizer_config.jsonAdded+19
- training_info.jsonAdded+15
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364---license: cc-by-4.0language:- enbase_model: deepset/roberta-base-squad2datasets:- rajpurkar/squad_v2pipeline_tag: question-answeringtags:- extractive-qa- squad2- memory- recallic---
# Recallic reader (case-augmented roberta-base-squad2)
The extractive question-answering model that [Recallic](https://github.com/Recallic/Recallic) uses to read recalledmemories, find the answer span, and decline when no memory answers the question.
It is [deepset/roberta-base-squad2](https://huggingface.co/deepset/roberta-base-squad2) trained for one more passon SQuAD 2.0 data shaped like chat messages:
* 40,000 SQuAD 2.0 training examples and 39,975 lowercased copies;* 30,001 sentence-level examples: the single sentence that holds the answer (answerable), and another sentence of the same paragraph that does not (unanswerable, same topic), plus 29,995 lowercased copies.
People text an assistant in short, often lowercase messages; the base model was trained on edited Wikipediaparagraphs. One epoch, learning rate 1e-5, batch 16, on a Kaggle T4 (42 minutes). Training script:[training/reader/train_case_aug.py](https://github.com/Recallic/Recallic/tree/main/training/reader).
## Results (Recallic end to end, decline threshold -2.721 on the null-answer margin)
Against the base model in the same system and threshold:
| | base model | this model ||---|---|---|| LoCoMo test, trick questions declined | 66 / 209 | **121 / 209** || LoCoMo test, real questions declined | 70 / 778 | 114 / 778 || LoCoMo test, answer token F1 | 0.3449 | **0.3567** || Fact-update scenarios (120, texting style), correct / wrong | 76 / 8 | **92** / 9 |
It answers fewer trick questions and gives better answers, at the cost of declining more real questions. Allfigures and how they were produced: `eval/results/reader_case_aug_v2/` in the Recallic repository.
## Use
```pythonfrom transformers import pipelineqa = pipeline("question-answering", model="Recallic/recallic-reader")qa(question="where do i work now?", context="moved to infosys last month, left tcs finally", handle_impossible_answer=True)```
## Limitations
Trained on English Wikipedia question answering only. Within Recallic it can still pick a value about someone elsewhen the message says whose it is only implicitly (an extra wrong answer of this kind appeared on the fact-updatescenarios). Thresholds should be checked on the deployment's own data.
## Licence and attribution
CC BY 4.0, as the base model. Base model by deepset (CC BY 4.0); training data from SQuAD 2.0 by Rajpurkar et al.(CC BY-SA 4.0).12345678910111213141516171819202122232425262728293031{ "add_cross_attention": false, "architectures": [ "RobertaForQuestionAnswering" ], "attention_probs_dropout_prob": 0.1, "bos_token_id": 0, "classifier_dropout": null, "dtype": "float32", "eos_token_id": 2, "gradient_checkpointing": false, "hidden_act": "gelu", "hidden_dropout_prob": 0.1, "hidden_size": 768, "initializer_range": 0.02, "intermediate_size": 3072, "is_decoder": false, "language": "english", "layer_norm_eps": 1e-05, "max_position_embeddings": 514, "model_type": "roberta", "name": "Roberta", "num_attention_heads": 12, "num_hidden_layers": 12, "pad_token_id": 1, "tie_word_embeddings": true, "transformers_version": "5.24.1", "type_vocab_size": 1, "use_cache": true, "vocab_size": 50265}123version https://git-lfs.github.com/spec/v1oid sha256:ca3f7e17966db913a7b7fcb457f6b8dbc0b738169f0d8f16faa251b78490321esize 49625023212345678910111213141516171819{ "add_prefix_space": false, "backend": "tokenizers", "bos_token": "<s>", "cls_token": "<s>", "do_lower_case": false, "eos_token": "</s>", "errors": "replace", "full_tokenizer_file": null, "is_local": false, "local_files_only": false, "mask_token": "<mask>", "model_max_length": 512, "pad_token": "<pad>", "sep_token": "</s>", "tokenizer_class": "RobertaTokenizer", "trim_offsets": true, "unk_token": "<unk>"}123456789101112131415{ "base": "deepset/roberta-base-squad2", "n_original": 40000, "n_lowercased": 39975, "n_sentence": 30001, "n_sentence_lowercased": 29995, "windows": 141062, "steps": 8817, "lr": 1e-05, "batch": 16, "epochs": 1.0, "seed": 13, "device": "cuda", "minutes": 42.0}README.mdAdded+64
config.jsonAdded+31
model.safetensorsAdded+3
tokenizer.jsonAdded
tokenizer_config.jsonAdded+19
training_info.jsonAdded+15