Update README.md
Browse files
README.md
CHANGED
|
@@ -8,7 +8,7 @@ datasets:
|
|
| 8 |
|
| 9 |
# Adapter `allenai/specter2_classification` for allenai/specter2
|
| 10 |
|
| 11 |
-
An [adapter](https://adapterhub.ml) for the `allenai/specter2` model that was trained on the [allenai/scirepeval](https://huggingface.co/datasets/allenai/scirepeval/) dataset.
|
| 12 |
|
| 13 |
This adapter was created for usage with the **[adapter-transformers](https://github.com/Adapter-Hub/adapter-transformers)** library.
|
| 14 |
|
|
@@ -26,7 +26,7 @@ Now, the adapter can be loaded and activated like this:
|
|
| 26 |
```python
|
| 27 |
from transformers import AutoAdapterModel
|
| 28 |
|
| 29 |
-
model = AutoAdapterModel.from_pretrained("allenai/
|
| 30 |
adapter_name = model.load_adapter("allenai/specter2_classification", source="hf", set_active=True)
|
| 31 |
```
|
| 32 |
|
|
@@ -87,7 +87,7 @@ It builds on the work done in [SciRepEval: A Multi-Format Benchmark for Scientif
|
|
| 87 |
|
| 88 |
|Model|Name and HF link|Description|
|
| 89 |
|--|--|--|
|
| 90 |
-
|Retrieval*|[allenai/specter2_proximity](https://huggingface.co/allenai/
|
| 91 |
|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)|
|
| 92 |
|Classification|[allenai/specter2_classification](https://huggingface.co/allenai/specter2_classification)|Encode papers to feed into linear classifiers as features|
|
| 93 |
|Regression|[allenai/specter2_regression](https://huggingface.co/allenai/specter2_regression)|Encode papers to feed into linear regressors as features|
|
|
@@ -98,10 +98,10 @@ It builds on the work done in [SciRepEval: A Multi-Format Benchmark for Scientif
|
|
| 98 |
from transformers import AutoTokenizer, AutoModel
|
| 99 |
|
| 100 |
# load model and tokenizer
|
| 101 |
-
tokenizer = AutoTokenizer.from_pretrained('allenai/
|
| 102 |
|
| 103 |
#load base model
|
| 104 |
-
model = AutoModel.from_pretrained('allenai/
|
| 105 |
|
| 106 |
#load the adapter(s) as per the required task, provide an identifier for the adapter in load_as argument and activate it
|
| 107 |
model.load_adapter("allenai/specter2_classification", source="hf", load_as="classification", set_active=True)
|
|
|
|
| 8 |
|
| 9 |
# Adapter `allenai/specter2_classification` for allenai/specter2
|
| 10 |
|
| 11 |
+
An [adapter](https://adapterhub.ml) for the [`allenai/specter2`](https://huggingface.co/allenai/specter2_base) model that was trained on the [allenai/scirepeval](https://huggingface.co/datasets/allenai/scirepeval/) dataset.
|
| 12 |
|
| 13 |
This adapter was created for usage with the **[adapter-transformers](https://github.com/Adapter-Hub/adapter-transformers)** library.
|
| 14 |
|
|
|
|
| 26 |
```python
|
| 27 |
from transformers import AutoAdapterModel
|
| 28 |
|
| 29 |
+
model = AutoAdapterModel.from_pretrained("allenai/specter2_base")
|
| 30 |
adapter_name = model.load_adapter("allenai/specter2_classification", source="hf", set_active=True)
|
| 31 |
```
|
| 32 |
|
|
|
|
| 87 |
|
| 88 |
|Model|Name and HF link|Description|
|
| 89 |
|--|--|--|
|
| 90 |
+
|Retrieval*|[allenai/specter2_proximity](https://huggingface.co/allenai/specter2)|Encode papers as queries and candidates eg. Link Prediction, Nearest Neighbor Search|
|
| 91 |
|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)|
|
| 92 |
|Classification|[allenai/specter2_classification](https://huggingface.co/allenai/specter2_classification)|Encode papers to feed into linear classifiers as features|
|
| 93 |
|Regression|[allenai/specter2_regression](https://huggingface.co/allenai/specter2_regression)|Encode papers to feed into linear regressors as features|
|
|
|
|
| 98 |
from transformers import AutoTokenizer, AutoModel
|
| 99 |
|
| 100 |
# load model and tokenizer
|
| 101 |
+
tokenizer = AutoTokenizer.from_pretrained('allenai/specter2_base')
|
| 102 |
|
| 103 |
#load base model
|
| 104 |
+
model = AutoModel.from_pretrained('allenai/specter2_base')
|
| 105 |
|
| 106 |
#load the adapter(s) as per the required task, provide an identifier for the adapter in load_as argument and activate it
|
| 107 |
model.load_adapter("allenai/specter2_classification", source="hf", load_as="classification", set_active=True)
|