Tuana commited on
Commit
d3579a1
1 Parent(s): 44f866d

draft update for the model card

Browse files
Files changed (1) hide show
  1. README.md +44 -56
README.md CHANGED
@@ -7,11 +7,8 @@ license: cc-by-4.0
7
 
8
  # roberta-base for QA
9
 
10
- NOTE: This is version 2 of the model. See [this github issue](https://github.com/deepset-ai/FARM/issues/552) from the FARM repository for an explanation of why we updated. If you'd like to use version 1, specify `revision="v1.0"` when loading the model in Transformers 3.5. For exmaple:
11
- ```
12
- model_name = "deepset/roberta-base-squad2"
13
- pipeline(model=model_name, tokenizer=model_name, revision="v1.0", task="question-answering")
14
- ```
15
 
16
  ## Overview
17
  **Language model:** roberta-base
@@ -19,7 +16,7 @@ pipeline(model=model_name, tokenizer=model_name, revision="v1.0", task="question
19
  **Downstream-task:** Extractive QA
20
  **Training data:** SQuAD 2.0
21
  **Eval data:** SQuAD 2.0
22
- **Code:** See [example](https://github.com/deepset-ai/FARM/blob/master/examples/question_answering.py) in [FARM](https://github.com/deepset-ai/FARM/blob/master/examples/question_answering.py)
23
  **Infrastructure**: 4x Tesla v100
24
 
25
  ## Hyperparameters
@@ -39,23 +36,16 @@ max_query_length=64
39
  ## Using a distilled model instead
40
  Please note that we have also released a distilled version of this model called [deepset/tinyroberta-squad2](https://huggingface.co/deepset/tinyroberta-squad2). The distilled model has a comparable prediction quality and runs at twice the speed of the base model.
41
 
42
- ## Performance
43
- Evaluated on the SQuAD 2.0 dev set with the [official eval script](https://worksheets.codalab.org/rest/bundles/0x6b567e1cf2e041ec80d7098f031c5c9e/contents/blob/).
44
-
45
- ```
46
- "exact": 79.87029394424324,
47
- "f1": 82.91251169582613,
48
 
49
- "total": 11873,
50
- "HasAns_exact": 77.93522267206478,
51
- "HasAns_f1": 84.02838248389763,
52
- "HasAns_total": 5928,
53
- "NoAns_exact": 81.79983179142137,
54
- "NoAns_f1": 81.79983179142137,
55
- "NoAns_total": 5945
56
  ```
57
-
58
- ## Usage
59
 
60
  ### In Transformers
61
  ```python
@@ -76,53 +66,51 @@ model = AutoModelForQuestionAnswering.from_pretrained(model_name)
76
  tokenizer = AutoTokenizer.from_pretrained(model_name)
77
  ```
78
 
79
- ### In FARM
80
-
81
- ```python
82
- from farm.modeling.adaptive_model import AdaptiveModel
83
- from farm.modeling.tokenization import Tokenizer
84
- from farm.infer import Inferencer
85
-
86
- model_name = "deepset/roberta-base-squad2"
87
-
88
- # a) Get predictions
89
- nlp = Inferencer.load(model_name, task_type="question_answering")
90
- QA_input = [{"questions": ["Why is model conversion important?"],
91
- "text": "The option to convert models between FARM and transformers gives freedom to the user and let people easily switch between frameworks."}]
92
- res = nlp.inference_from_dicts(dicts=QA_input, rest_api_schema=True)
93
 
94
- # b) Load model & tokenizer
95
- model = AdaptiveModel.convert_from_transformers(model_name, device="cpu", task_type="question_answering")
96
- tokenizer = Tokenizer.load(model_name)
97
  ```
 
 
98
 
99
- ### In haystack
100
- For doing QA at scale (i.e. many docs instead of single paragraph), you can load the model also in [haystack](https://github.com/deepset-ai/haystack/):
101
- ```python
102
- reader = FARMReader(model_name_or_path="deepset/roberta-base-squad2")
103
- # or
104
- reader = TransformersReader(model_name_or_path="deepset/roberta-base-squad2",tokenizer="deepset/roberta-base-squad2")
 
105
  ```
106
 
107
-
108
  ## Authors
109
- Branden Chan: `branden.chan [at] deepset.ai`
110
- Timo Möller: `timo.moeller [at] deepset.ai`
111
- Malte Pietsch: `malte.pietsch [at] deepset.ai`
112
- Tanay Soni: `tanay.soni [at] deepset.ai`
113
 
114
  ## About us
115
- ![deepset logo](https://workablehr.s3.amazonaws.com/uploads/account/logo/476306/logo)
116
- We bring NLP to the industry via open source!
117
- Our focus: Industry specific language models & large scale QA systems.
118
-
119
- Some of our work:
 
 
 
 
 
 
 
 
 
120
  - [German BERT (aka "bert-base-german-cased")](https://deepset.ai/german-bert)
121
  - [GermanQuAD and GermanDPR datasets and models (aka "gelectra-base-germanquad", "gbert-base-germandpr")](https://deepset.ai/germanquad)
122
- - [FARM](https://github.com/deepset-ai/FARM)
123
- - [Haystack](https://github.com/deepset-ai/haystack/)
124
 
125
  Get in touch:
 
 
126
  [Twitter](https://twitter.com/deepset_ai) | [LinkedIn](https://www.linkedin.com/company/deepset-ai/) | [Slack](https://haystack.deepset.ai/community/join) | [GitHub Discussions](https://github.com/deepset-ai/haystack/discussions) | [Website](https://deepset.ai)
127
 
128
  By the way: [we're hiring!](http://www.deepset.ai/jobs)
 
7
 
8
  # roberta-base for QA
9
 
10
+ This is the [roberta-base](https://huggingface.co/roberta-base) model, fine-tuned using the [SQuAD2.0](https://huggingface.co/datasets/squad_v2) dataset. It's been trained on question-answer pairs, including unanswerable questions, for the task of Question Answering.
11
+
 
 
 
12
 
13
  ## Overview
14
  **Language model:** roberta-base
 
16
  **Downstream-task:** Extractive QA
17
  **Training data:** SQuAD 2.0
18
  **Eval data:** SQuAD 2.0
19
+ **Code:** See [an example QA pipeline on Haystack](https://haystack.deepset.ai/tutorials/first-qa-system)
20
  **Infrastructure**: 4x Tesla v100
21
 
22
  ## Hyperparameters
 
36
  ## Using a distilled model instead
37
  Please note that we have also released a distilled version of this model called [deepset/tinyroberta-squad2](https://huggingface.co/deepset/tinyroberta-squad2). The distilled model has a comparable prediction quality and runs at twice the speed of the base model.
38
 
39
+ ## Usage
 
 
 
 
 
40
 
41
+ ### In Haystack
42
+ Haystack is an NLP framework by deepset. You can use this model in a Hasytack pipeline to do question answering at scale (over many documents). To load the model in [Haystack](https://github.com/deepset-ai/haystack/):
43
+ ```python
44
+ reader = FARMReader(model_name_or_path="deepset/roberta-base-squad2")
45
+ # or
46
+ reader = TransformersReader(model_name_or_path="deepset/roberta-base-squad2",tokenizer="deepset/roberta-base-squad2")
 
47
  ```
48
+ For a complete example of ``roberta-base-squad2`` being used for Question Answering, check out the [Tutorials in Haystack Documentation](https://haystack.deepset.ai/tutorials/first-qa-system)
 
49
 
50
  ### In Transformers
51
  ```python
 
66
  tokenizer = AutoTokenizer.from_pretrained(model_name)
67
  ```
68
 
69
+ ## Performance
70
+ Evaluated on the SQuAD 2.0 dev set with the [official eval script](https://worksheets.codalab.org/rest/bundles/0x6b567e1cf2e041ec80d7098f031c5c9e/contents/blob/).
 
 
 
 
 
 
 
 
 
 
 
 
71
 
 
 
 
72
  ```
73
+ "exact": 79.87029394424324,
74
+ "f1": 82.91251169582613,
75
 
76
+ "total": 11873,
77
+ "HasAns_exact": 77.93522267206478,
78
+ "HasAns_f1": 84.02838248389763,
79
+ "HasAns_total": 5928,
80
+ "NoAns_exact": 81.79983179142137,
81
+ "NoAns_f1": 81.79983179142137,
82
+ "NoAns_total": 5945
83
  ```
84
 
 
85
  ## Authors
86
+ **Branden Chan:** branden.chan@deepset.ai
87
+ **Timo Möller:** timo.moelle@deepset.ai
88
+ **Malte Pietsch:** malte.pietsch@deepset.ai
89
+ **Tanay Soni:** tanay.soni@deepset.ai
90
 
91
  ## About us
92
+ <div class="grid lg:grid-cols-2 gap-x-4 gap-y-3">
93
+ <div class="w-full h-40 object-cover mb-2 rounded-lg flex items-center justify-center">
94
+ <img alt="" src="https://huggingface.co/spaces/deepset/README/resolve/main/haystack-logo-colored.svg" class="w-40"/>
95
+ </div>
96
+ <div class="w-full h-40 object-cover mb-2 rounded-lg flex items-center justify-center">
97
+ <img alt="" src="https://huggingface.co/spaces/deepset/README/resolve/main/deepset-logo-colored.svg" class="w-40"/>
98
+ </div>
99
+ </div>
100
+
101
+ [deepset](http://deepset.ai/) is the company behind the open-source NLP framework [Haystack](https://haystack.deepset.ai/) which is designed to help you build production ready NLP systems that use: Question answering, summarization, ranking etc.
102
+
103
+
104
+ Some of our other work:
105
+ - [Distilled roberta-base-squad2 (aka "tinyroberta-squad2")]([https://huggingface.co/deepset/tinyroberta-squad2)
106
  - [German BERT (aka "bert-base-german-cased")](https://deepset.ai/german-bert)
107
  - [GermanQuAD and GermanDPR datasets and models (aka "gelectra-base-germanquad", "gbert-base-germandpr")](https://deepset.ai/germanquad)
108
+
109
+ <p>For more info on Haystack, visit our <strong><a href="https://github.com/deepset-ai/haystack">GitHub</a></strong> repo and <strong><a href="https://haystack.deepset.ai">Documentation</a></strong>. You can also <strong><a class="h-7" href="https://haystack.deepset.ai/community/join">join us on <img alt="slack" class="h-7 inline-block m-0" style="margin: 0" src="https://huggingface.co/spaces/deepset/README/resolve/main/Slack_RGB.png"/></a></strong></p>
110
 
111
  Get in touch:
112
+
113
+
114
  [Twitter](https://twitter.com/deepset_ai) | [LinkedIn](https://www.linkedin.com/company/deepset-ai/) | [Slack](https://haystack.deepset.ai/community/join) | [GitHub Discussions](https://github.com/deepset-ai/haystack/discussions) | [Website](https://deepset.ai)
115
 
116
  By the way: [we're hiring!](http://www.deepset.ai/jobs)