oriram commited on
Commit
535fe18
1 Parent(s): 2771951

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +6 -4
README.md CHANGED
@@ -12,13 +12,15 @@ type ids are all 0-s.
12
  An example usage:
13
 
14
  ```python
15
- from transformers import AutoTokenizer, DPRQuestionEncoder
16
 
17
  tokenizer = AutoTokenizer.from_pretrained("NAACL2022/spider-trivia-ctx-encoder")
18
- model = DPRQuestionEncoder.from_pretrained("NAACL2022/spider-trivia-ctx-encoder")
19
 
20
- question = "Who is the villain in lord of the rings"
21
- input_dict = tokenizer(question, return_tensors="pt")
 
 
22
  del input_dict["token_type_ids"]
23
 
24
  outputs = model(**input_dict)
 
12
  An example usage:
13
 
14
  ```python
15
+ from transformers import AutoTokenizer, DPRContextEncoder
16
 
17
  tokenizer = AutoTokenizer.from_pretrained("NAACL2022/spider-trivia-ctx-encoder")
18
+ model = DPRContextEncoder.from_pretrained("NAACL2022/spider-trivia-ctx-encoder")
19
 
20
+ title = "Sauron"
21
+ context = "Sauron is the title character and main antagonist of J. R. R. Tolkien's \"The Lord of the Rings\"."
22
+
23
+ input_dict = tokenizer(title, context, return_tensors="pt")
24
  del input_dict["token_type_ids"]
25
 
26
  outputs = model(**input_dict)