File size: 2,295 Bytes
e4c59d2
acfe698
 
c5043ea
e4c59d2
acfe698
cb08002
 
7889935
cb08002
 
 
 
 
 
a0e12e4
19f7e1c
c5043ea
 
cb08002
19f7e1c
c5043ea
 
3f3e1c1
88aa26d
 
3f3e1c1
 
88aa26d
 
 
c1bd65d
3f3e1c1
 
 
c1bd65d
3f3e1c1
c5043ea
 
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
---
language: en
tags:
- fid
---

Dataset

desc: Natural Questions with contexts retrieved with DPR as 100 tokens. Inputs were truncated to 200 tokens and label is a first answer in an answer list where answers with more than 5 tokens were discarded.

input: <span style="color:#FF9800">"question: total number of death row inmates in the us title: Death row context: on death row in the United States on January 1, 2013. Since 1977, the states of Texas (464), Virginia (108) and Oklahoma (94) have executed the most death row inmates. , California (683), Florida (390), Texas (330) and Pennsylvania (218) housed more than half of all inmates pending on death row. , the longest-serving prisoner on d
eath row in the US who has been executed was Jack Alderman who served over 33 years. He was executed in Georgia in 2008. However, Alderman only holds the distinction of being the longest-serving \"executed\" inmate so far. A Florida inmate, Gary Alvord, arrived"</span>

label: <span style="color:#FF9800">"2,718"</span>

FiD Architecture
![Screenshot 2022-11-16 at 23.26.16.png](https://s3.amazonaws.com/moonup/production/uploads/1672830489933-63b52c0a889aa6707f07885b.png)


This pre-trained model achieved 1-2% increase in EM than the FiD paper's result on NQ w/ 5, 10, and 25 passages
![210333747-c001f1f0-8e3d-4f5c-ad32-4fdffdc6e17b.png](https://s3.amazonaws.com/moonup/production/uploads/1672830489959-63b52c0a889aa6707f07885b.png)


<pre><code><span style="color:#03A9F4">from</span> transformers <span style="color:#03A9F4">import</span> AutoConfig, T5Tokenizer
<pre><code><span style="color:#03A9F4">from</span> fid <span style="color:#03A9F4">import</span> FiDT5

tokenizer = T5Tokenizer.from_pretrained(<span style="color:#FF9800">"t5-base"</span>)

question = <span style="color:#FF9800">"question:"</span>
title = <span style="color:#FF9800">"title:"</span>
context = <span style="color:#FF9800">"context:"</span>
tokenizer.add_tokens([question, title, context], <span style="color:#ff0000">special_tokens</span>=<span style="color:#8BC34A">True</span>)
config = AutoConfig.from_pretrained(<span style="color:#FF9800">"t5-base"</span>)
model = FiDT5.from_pretrained(
    <span style="color:#FF9800">"xfact/FiD-NQ"</span>,
    <span style="color:#ff0000">config</span>=config
)