health FHIR

bart-large

This model is a fine-tuned version of bart-large on a manually created dataset. It achieves the following results on the evaluation set:

Training hyperparameters

The following hyperparameters were used during training:

Training results

Training Loss Epoch Step Validation Loss
- 1.0 47 4.5156
...
- 10 490 0.4086

How to use

def generate_text(input_text):
    # Tokenize the input text
    input_tokens = tokenizer(input_text, return_tensors='pt')

    # Move the input tokens to the same device as the model
    input_tokens = input_tokens.to(model.device)

    # Generate text using the fine-tuned model
    output_tokens = model.generate(**input_tokens)

    # Decode the generated tokens to text
    output_text = tokenizer.decode(output_tokens[0], skip_special_tokens=True)

    return output_text

from transformers import BartForConditionalGeneration

# Load the pre-trained BART model from the Hugging Face model hub
model = BartForConditionalGeneration.from_pretrained('rasta/BART-FHIR-question')

input_text = "List all procedures with reason reference to resource with ID 24680135."
output_text = generate_text(input_text)
print(output_text)

Framework versions