aps6992 commited on
Commit
a436c31
1 Parent(s): 043b5ac

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +11 -9
README.md CHANGED
@@ -11,6 +11,7 @@ language:
11
 
12
  SPECTER 2.0 is the successor to [SPECTER](allenai/specter) and is capable of generating task specific embeddings for scientific tasks when paired with [adapters](https://huggingface.co/models?search=allenai/specter-2_).
13
  Given the combination of title and abstract of a scientific paper or a short texual query, the model can be used to generate effective embeddings to be used in downstream applications.
 
14
 
15
  # Model Details
16
 
@@ -50,13 +51,14 @@ It builds on the work done in [SciRepEval: A Multi-Format Benchmark for Scientif
50
 
51
  ## Direct Use
52
 
53
- |Model|Type|Name and HF link|
54
  |--|--|--|
55
- |Base|Transformer|[allenai/specter2](https://huggingface.co/allenai/specter2)|
56
- |Classification|Adapter|[allenai/specter2_classification](https://huggingface.co/allenai/specter2_classification)|
57
- |Regression|Adapter|[allenai/specter2_regression](https://huggingface.co/allenai/specter2_regression)|
58
- |Retrieval|Adapter|[allenai/specter2_proximity](https://huggingface.co/allenai/specter2_proximity)|
59
- |Adhoc Query|Adapter|[allenai/specter2_adhoc_query](https://huggingface.co/allenai/specter2_adhoc_query)|
 
60
 
61
  ```python
62
  from transformers import AutoTokenizer, AutoModel
@@ -68,7 +70,8 @@ tokenizer = AutoTokenizer.from_pretrained('allenai/specter2')
68
  model = AutoModel.from_pretrained('allenai/specter2')
69
 
70
  #load the adapter(s) as per the required task, provide an identifier for the adapter in load_as argument and activate it
71
- model.load_adapter("allenai/specter2_adhoc_query", source="hf", load_as="adhoc_query", set_active=True)
 
72
 
73
  papers = [{'title': 'BERT', 'abstract': 'We introduce a new language representation model called BERT'},
74
  {'title': 'Attention is all you need', 'abstract': ' The dominant sequence transduction models are based on complex recurrent or convolutional neural networks'}]
@@ -83,7 +86,7 @@ output = model(**inputs)
83
  embeddings = output.last_hidden_state[:, 0, :]
84
  ```
85
 
86
- ## Downstream Use [optional]
87
 
88
  <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
89
 
@@ -132,7 +135,6 @@ We also evaluate and establish a new SoTA on [MDCR](https://github.com/zoranmedi
132
  |[SPECTER](https://huggingface.co/allenai/specter)|54.7|57.4|68.0|(30.6, 25.5)|
133
  |[SciNCL](https://huggingface.co/malteos/scincl)|55.6|57.8|69.0|(32.6, 27.3)|
134
  |[SciRepEval-Adapters](https://huggingface.co/models?search=scirepeval)|61.9|59.0|70.9|(35.3, 29.6)|
135
- |[SPECTER 2.0-base](https://huggingface.co/allenai/specter2)|56.3|58.0|69.2|(38.0, 32.4)|
136
  |[SPECTER 2.0-Adapters](https://huggingface.co/models?search=allenai/specter-2)|**62.3**|**59.2**|**71.2**|**(38.4, 33.0)**|
137
 
138
  Please cite the following works if you end up using SPECTER 2.0:
 
11
 
12
  SPECTER 2.0 is the successor to [SPECTER](allenai/specter) and is capable of generating task specific embeddings for scientific tasks when paired with [adapters](https://huggingface.co/models?search=allenai/specter-2_).
13
  Given the combination of title and abstract of a scientific paper or a short texual query, the model can be used to generate effective embeddings to be used in downstream applications.
14
+ **Note:** To get the best performance on a downstream task type please load the associated adapter with the base model as [below]()
15
 
16
  # Model Details
17
 
 
51
 
52
  ## Direct Use
53
 
54
+ |Model|Name and HF link|Description|
55
  |--|--|--|
56
+ |Retrieval*|[allenai/specter2_proximity](https://huggingface.co/allenai/specter2_proximity)|Encode papers as queries and candidates eg. Link Prediction, Nearest Neighbor Search|
57
+ |Adhoc Query|[allenai/specter2_adhoc_query](https://huggingface.co/allenai/specter2_adhoc_query)|Encode short raw text queries for search tasks. (Candidate papers can be encoded with proximity)|
58
+ |Classification|[allenai/specter2_classification](https://huggingface.co/allenai/specter2_classification)|Encode papers to feed into linear classifiers as features|
59
+ |Regression|[allenai/specter2_regression](https://huggingface.co/allenai/specter2_regression)|Encode papers to feed into linear regressors as features|
60
+
61
+ *Retrieval model should suffice for downstream task types not mentioned above
62
 
63
  ```python
64
  from transformers import AutoTokenizer, AutoModel
 
70
  model = AutoModel.from_pretrained('allenai/specter2')
71
 
72
  #load the adapter(s) as per the required task, provide an identifier for the adapter in load_as argument and activate it
73
+ model.load_adapter("allenai/specter2_proximity", source="hf", load_as="proximity", set_active=True)
74
+ #other possibilities: allenai/specter2_<classification|regression|adhoc_query>
75
 
76
  papers = [{'title': 'BERT', 'abstract': 'We introduce a new language representation model called BERT'},
77
  {'title': 'Attention is all you need', 'abstract': ' The dominant sequence transduction models are based on complex recurrent or convolutional neural networks'}]
 
86
  embeddings = output.last_hidden_state[:, 0, :]
87
  ```
88
 
89
+ ## Downstream Use
90
 
91
  <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
92
 
 
135
  |[SPECTER](https://huggingface.co/allenai/specter)|54.7|57.4|68.0|(30.6, 25.5)|
136
  |[SciNCL](https://huggingface.co/malteos/scincl)|55.6|57.8|69.0|(32.6, 27.3)|
137
  |[SciRepEval-Adapters](https://huggingface.co/models?search=scirepeval)|61.9|59.0|70.9|(35.3, 29.6)|
 
138
  |[SPECTER 2.0-Adapters](https://huggingface.co/models?search=allenai/specter-2)|**62.3**|**59.2**|**71.2**|**(38.4, 33.0)**|
139
 
140
  Please cite the following works if you end up using SPECTER 2.0: