Text Classification
Keras
English
chemistry
scientific-literature
multilabel
classification
embeddings
Eval Results (legacy)
Instructions to use Bocklitz-Lab/lit2vec-subfield-classifier-model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use Bocklitz-Lab/lit2vec-subfield-classifier-model with Keras:
# !pip install -U keras tensorflow huggingface_hub # Keras needs TensorFlow installed to read "hf://" paths, so the tensorflow backend is selected here; # "jax" and "torch" also work for computation once TensorFlow is installed. import os os.environ["KERAS_BACKEND"] = "tensorflow" import keras model = keras.saving.load_model("hf://Bocklitz-Lab/lit2vec-subfield-classifier-model") - Notebooks
- Google Colab
- Kaggle
Mahmoud Amiri commited on
Commit ·
4a8a51a
1
Parent(s): 2d2f688
the example in readme file is tested
Browse files- README.md +1 -1
- requirements.txt +9 -1
README.md
CHANGED
|
@@ -170,7 +170,7 @@ If included in the repo, the plot `f1_vs_freq.png` shows F1 vs. training label f
|
|
| 170 |
### Quick start (load from Hub, inference)
|
| 171 |
|
| 172 |
```python
|
| 173 |
-
# pip install
|
| 174 |
import json
|
| 175 |
import numpy as np
|
| 176 |
from typing import List, Tuple
|
|
|
|
| 170 |
### Quick start (load from Hub, inference)
|
| 171 |
|
| 172 |
```python
|
| 173 |
+
# pip install -r requirements.txt
|
| 174 |
import json
|
| 175 |
import numpy as np
|
| 176 |
from typing import List, Tuple
|
requirements.txt
CHANGED
|
@@ -1,7 +1,15 @@
|
|
| 1 |
numpy==1.26
|
| 2 |
scikit-learn==1.2
|
| 3 |
-
tensorflow==2.15
|
| 4 |
matplotlib==3.7
|
| 5 |
wandb==0.16
|
| 6 |
datasets==2.19
|
| 7 |
pyarrow==12
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
numpy==1.26
|
| 2 |
scikit-learn==1.2
|
| 3 |
+
tensorflow==2.15.0
|
| 4 |
matplotlib==3.7
|
| 5 |
wandb==0.16
|
| 6 |
datasets==2.19
|
| 7 |
pyarrow==12
|
| 8 |
+
sentence-transformers==2.7.0
|
| 9 |
+
huggingface_hub>=0.23.0
|
| 10 |
+
# Torch is required by sentence-transformers
|
| 11 |
+
# CPU-only build (safer if you don’t need GPU)
|
| 12 |
+
torch==2.3.1+cpu
|
| 13 |
+
torchvision==0.18.1+cpu
|
| 14 |
+
torchaudio==2.3.1+cpu
|
| 15 |
+
--index-url https://download.pytorch.org/whl/cpu
|