Text Classification
Transformers
PyTorch
English
bert
pubmed
arxiv
representations
scientific documents
text-embeddings-inference
Instructions to use arazd/MIReAD with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use arazd/MIReAD with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="arazd/MIReAD")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("arazd/MIReAD") model = AutoModelForSequenceClassification.from_pretrained("arazd/MIReAD") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -33,10 +33,12 @@ tokenizer = AutoTokenizer.from_pretrained(mpath)
|
|
| 33 |
|
| 34 |
To use MIReAD for feature extraction and classification:
|
| 35 |
```python
|
| 36 |
-
# sample abstract text
|
|
|
|
| 37 |
abstr = 'Learning semantically meaningful representations from scientific documents can ...'
|
|
|
|
| 38 |
source_len = 512
|
| 39 |
-
inputs = tokenizer(
|
| 40 |
max_length = source_len,
|
| 41 |
pad_to_max_length=True,
|
| 42 |
truncation=True,
|
|
|
|
| 33 |
|
| 34 |
To use MIReAD for feature extraction and classification:
|
| 35 |
```python
|
| 36 |
+
# sample abstract & title text
|
| 37 |
+
title = 'MIReAD: simple method for learning scientific representations'
|
| 38 |
abstr = 'Learning semantically meaningful representations from scientific documents can ...'
|
| 39 |
+
text = title + tokenizer.sep_token + abstr
|
| 40 |
source_len = 512
|
| 41 |
+
inputs = tokenizer(text,
|
| 42 |
max_length = source_len,
|
| 43 |
pad_to_max_length=True,
|
| 44 |
truncation=True,
|