Spaces:
Running
Running
Commit
·
916a500
1
Parent(s):
a7ea906
Update README.md
Browse files
README.md
CHANGED
|
@@ -9,81 +9,13 @@ license: cc-by-4.0
|
|
| 9 |
---
|
| 10 |
|
| 11 |
---
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
**Eval data:** SQuAD 2.0
|
| 23 |
-
**Code:** See [an example QA pipeline on Haystack](https://haystack.deepset.ai/tutorials/first-qa-system)
|
| 24 |
-
**Infrastructure**: 4x Tesla v100
|
| 25 |
-
|
| 26 |
-
## Hyperparameters
|
| 27 |
-
|
| 28 |
-
```
|
| 29 |
-
batch_size = 4
|
| 30 |
-
n_epochs = 50
|
| 31 |
-
base_LM_model = "roberta-base"
|
| 32 |
-
max_seq_len = 512
|
| 33 |
-
learning_rate = 9e-5
|
| 34 |
-
lr_schedule = LinearWarmup
|
| 35 |
-
warmup_proportion = 0.2
|
| 36 |
-
doc_stride=128
|
| 37 |
-
max_query_length=64
|
| 38 |
-
```
|
| 39 |
-
|
| 40 |
-
## Usage
|
| 41 |
-
|
| 42 |
-
### In Haystack
|
| 43 |
-
Haystack is an NLP framework by deepset. You can use this model in a Haystack pipeline to do question answering at scale (over many documents). To load the model in [Haystack](https://github.com/deepset-ai/haystack/):
|
| 44 |
-
```python
|
| 45 |
-
reader = FARMReader(model_name_or_path="AVISHKAARAM/avishkaarak-ekta-hindi")
|
| 46 |
-
# or
|
| 47 |
-
reader = TransformersReader(model_name_or_path="AVISHKAARAM/avishkaarak-ekta-hindi",tokenizer="deepset/roberta-base-squad2")
|
| 48 |
-
```
|
| 49 |
-
For a complete example of ``AVISHKAARAM/avishkaarak-ekta-hindi`` being used for Question Answering, check out the [Tutorials in Haystack Documentation](https://haystack.deepset.ai/tutorials/first-qa-system)
|
| 50 |
-
|
| 51 |
-
### In Transformers
|
| 52 |
-
```python
|
| 53 |
-
from transformers import AutoModelForQuestionAnswering, AutoTokenizer, pipeline
|
| 54 |
-
|
| 55 |
-
model_name = "AVISHKAARAM/avishkaarak-ekta-hindi"
|
| 56 |
-
|
| 57 |
-
# a) Get predictions
|
| 58 |
-
nlp = pipeline('question-answering', model=model_name, tokenizer=model_name)
|
| 59 |
-
QA_input = {
|
| 60 |
-
'question': 'Why is model conversion important?',
|
| 61 |
-
'context': 'The option to convert models between FARM and transformers gives freedom to the user and let people easily switch between frameworks.'
|
| 62 |
-
}
|
| 63 |
-
res = nlp(QA_input)
|
| 64 |
-
|
| 65 |
-
# b) Load model & tokenizer
|
| 66 |
-
model = AutoModelForQuestionAnswering.from_pretrained(model_name)
|
| 67 |
-
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 68 |
-
```
|
| 69 |
-
|
| 70 |
-
## Performance
|
| 71 |
-
Evaluated on the SQuAD 2.0 dev set with the [official eval script](https://worksheets.codalab.org/rest/bundles/0x6b567e1cf2e041ec80d7098f031c5c9e/contents/blob/).
|
| 72 |
-
|
| 73 |
-
```
|
| 74 |
-
"exact": 79.87029394424324,
|
| 75 |
-
"f1": 82.91251169582613,
|
| 76 |
-
|
| 77 |
-
"total": 11873,
|
| 78 |
-
"HasAns_exact": 77.93522267206478,
|
| 79 |
-
"HasAns_f1": 84.02838248389763,
|
| 80 |
-
"HasAns_total": 5928,
|
| 81 |
-
"NoAns_exact": 81.79983179142137,
|
| 82 |
-
"NoAns_f1": 81.79983179142137,
|
| 83 |
-
"NoAns_total": 5945
|
| 84 |
-
```
|
| 85 |
-
|
| 86 |
-
## Authors
|
| 87 |
-
**Shashwat Bindal:** optimus.coders.@ai
|
| 88 |
-
|
| 89 |
-
**Sanoj:** optimus.coders.@ai
|
|
|
|
| 9 |
---
|
| 10 |
|
| 11 |
---
|
| 12 |
+
<div class="grid lg:grid-cols-2 gap-x-4 gap-y-3">
|
| 13 |
+
<div style="position: relative; width: 100%; height: 0; padding-top: 56.2500%;
|
| 14 |
+
padding-bottom: 0; box-shadow: 0 2px 8px 0 rgba(63,69,81,0.16); margin-top: 1.6em; margin-bottom: 0.9em; overflow: hidden;
|
| 15 |
+
border-radius: 8px; will-change: transform;">
|
| 16 |
+
<iframe loading="lazy" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0; border: none; padding: 0;margin: 0;"
|
| 17 |
+
src="https://www.canva.com/design/DAFmtpAkiBE/view?embed" allowfullscreen="allowfullscreen" allow="fullscreen">
|
| 18 |
+
</iframe>
|
| 19 |
+
</div>
|
| 20 |
+
<a href="https://www.canva.com/design/DAFmtpAkiBE/view?utm_content=DAFmtpAkiBE&utm_campaign=designshare&utm_medium=embeds&utm_source=link" target="_blank" rel="noopener">Avishkaar Karta</a> by Sanoj Kumar
|
| 21 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|