File size: 2,598 Bytes
bf611f0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
---
license: cc-by-4.0
language:
- en
base_model: deepset/roberta-base-squad2
datasets:
- rajpurkar/squad_v2
pipeline_tag: question-answering
tags:
- 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 recalled
memories, 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 pass
on 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 Wikipedia
paragraphs. 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. All
figures and how they were produced: `eval/results/reader_case_aug_v2/` in the Recallic repository.

## Use

```python
from transformers import pipeline
qa = 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 else
when the message says whose it is only implicitly (an extra wrong answer of this kind appeared on the fact-update
scenarios). 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).