Instructions to use traceo/DrugRecon-1.0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use traceo/DrugRecon-1.0 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="traceo/DrugRecon-1.0")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("traceo/DrugRecon-1.0") model = AutoModelForTokenClassification.from_pretrained("traceo/DrugRecon-1.0", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -50,19 +50,14 @@ The model was benchmarks across two private, manually annotated test sets:
|
|
| 50 |
## Getting Started
|
| 51 |
|
| 52 |
```python
|
| 53 |
-
from transformers import
|
| 54 |
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
model = AutoModelForTokenClassification.from_pretrained("traceo/DrugRecon-1.0")
|
| 58 |
-
|
| 59 |
-
classifier = pipeline("ner", model=model, tokenizer=tokenizer, aggregation_strategy="simple")
|
| 60 |
|
| 61 |
results = classifier("Be careful, it was advertised as ketamine but tested positive for 2-FDCK and deschloroketamine.")
|
| 62 |
|
| 63 |
print(results)
|
| 64 |
-
|
| 65 |
-
```python
|
| 66 |
[{'entity_group': 'DRUG',
|
| 67 |
'score': np.float32(0.99362385),
|
| 68 |
'word': ' ketamine',
|
|
|
|
| 50 |
## Getting Started
|
| 51 |
|
| 52 |
```python
|
| 53 |
+
from transformers import pipeline
|
| 54 |
|
| 55 |
+
classifier = pipeline("ner", model="traceo/DrugRecon-1.0", aggregation_strategy="simple")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
|
| 57 |
results = classifier("Be careful, it was advertised as ketamine but tested positive for 2-FDCK and deschloroketamine.")
|
| 58 |
|
| 59 |
print(results)
|
| 60 |
+
|
|
|
|
| 61 |
[{'entity_group': 'DRUG',
|
| 62 |
'score': np.float32(0.99362385),
|
| 63 |
'word': ' ketamine',
|