Update README.md
Browse files
README.md
CHANGED
@@ -36,15 +36,15 @@ datasets:
|
|
36 |
### Usage
|
37 |
|
38 |
```python
|
39 |
-
from transformers import
|
40 |
|
41 |
-
tokenizer =
|
42 |
-
model =
|
43 |
input_ids = tokenizer("Ibukota Indonesia terletak dimana?", return_tensors='pt')["input_ids"]
|
44 |
embeddings = model(input_ids).pooler_output
|
45 |
```
|
46 |
|
47 |
-
|
48 |
|
49 |
```
|
50 |
from haystack.nodes import DensePassageRetriever
|
|
|
36 |
### Usage
|
37 |
|
38 |
```python
|
39 |
+
from transformers import DPRQuestionEncoder, DPRQuestionEncoderTokenizer
|
40 |
|
41 |
+
tokenizer = DPRQuestionEncoderTokenizer.from_pretrained('firqaaa/indo-dpr-question_encoder-single-squad-base')
|
42 |
+
model = DPRQuestionEncoder.from_pretrained('firqaaa/indo-dpr-question_encoder-single-squad-base')
|
43 |
input_ids = tokenizer("Ibukota Indonesia terletak dimana?", return_tensors='pt')["input_ids"]
|
44 |
embeddings = model(input_ids).pooler_output
|
45 |
```
|
46 |
|
47 |
+
We can use it using `haystack` as follows:
|
48 |
|
49 |
```
|
50 |
from haystack.nodes import DensePassageRetriever
|