Instructions to use tsilva/clinical-field-mapper-causal_lm with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tsilva/clinical-field-mapper-causal_lm with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tsilva/clinical-field-mapper-causal_lm")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("tsilva/clinical-field-mapper-causal_lm") model = AutoModelForCausalLM.from_pretrained("tsilva/clinical-field-mapper-causal_lm") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use tsilva/clinical-field-mapper-causal_lm with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tsilva/clinical-field-mapper-causal_lm" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tsilva/clinical-field-mapper-causal_lm", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/tsilva/clinical-field-mapper-causal_lm
- SGLang
How to use tsilva/clinical-field-mapper-causal_lm with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "tsilva/clinical-field-mapper-causal_lm" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tsilva/clinical-field-mapper-causal_lm", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "tsilva/clinical-field-mapper-causal_lm" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tsilva/clinical-field-mapper-causal_lm", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use tsilva/clinical-field-mapper-causal_lm with Docker Model Runner:
docker model run hf.co/tsilva/clinical-field-mapper-causal_lm
Model Card for tsilva/clinical-field-mapper-causal_lm
This model is a fine-tuned version of distilbert/distilgpt2 on the tsilva/clinical-field-mappings dataset.
Its purpose is to normalize healthcare database column names to a standardized set of target column names.
Task
This is a causal language model designed to map free-text field names to standardized schema terms.
Usage
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("tsilva/clinical-field-mapper-causal_lm") model = AutoModelForCausalLM.from_pretrained("tsilva/clinical-field-mapper-causal_lm")
def predict(input_text): inputs = tokenizer(input_text + "|", return_tensors="pt") outputs = model.generate(**inputs, max_new_tokens=50) print(tokenizer.decode(outputs[0], skip_special_tokens=True))
predict('cardi@')
Evaluation Results
- train accuracy: 98.24%
- validation accuracy: 89.84%
- test accuracy: 89.35%
Training Details
- Seed: 42
- Epochs scheduled: 50
- Epochs completed: 14
- Early stopping triggered: Yes
- Final training loss: 1.3344
- Final evaluation loss: 1.1981
- Optimizer: adamw_bnb_8bit
- Learning rate: 0.0005
- Batch size: 512
- Precision: fp16
- DeepSpeed enabled: True
- Gradient accumulation steps: 1
License
Specify your license here (e.g., Apache 2.0, MIT, etc.)
Limitations and Bias
- Model was trained on a specific clinical mapping dataset.
- Performance may vary on out-of-distribution column names.
- Ensure you validate model outputs in production environments.
- Downloads last month
- 4
Model tree for tsilva/clinical-field-mapper-causal_lm
Evaluation results
- train Accuracy on tsilva/clinical-field-mappingsself-reported0.982
- validation Accuracy on tsilva/clinical-field-mappingsself-reported0.898
- test Accuracy on tsilva/clinical-field-mappingsself-reported0.893