YAML Metadata
Warning:
The pipeline tag "text2text-generation" is not in the official list: text-classification, token-classification, table-question-answering, question-answering, zero-shot-classification, translation, summarization, feature-extraction, text-generation, fill-mask, sentence-similarity, text-to-speech, text-to-audio, automatic-speech-recognition, audio-to-audio, audio-classification, audio-text-to-text, voice-activity-detection, depth-estimation, image-classification, object-detection, image-segmentation, text-to-image, image-to-text, image-to-image, image-to-video, unconditional-image-generation, video-classification, reinforcement-learning, robotics, tabular-classification, tabular-regression, tabular-to-text, table-to-text, multiple-choice, text-ranking, text-retrieval, time-series-forecasting, text-to-video, image-text-to-text, visual-question-answering, document-question-answering, zero-shot-image-classification, graph-ml, mask-generation, zero-shot-object-detection, text-to-3d, image-to-3d, image-feature-extraction, video-text-to-text, keypoint-detection, visual-document-retrieval, any-to-any, video-to-video, other
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:
- Loss: 0.40
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 2e-05
- train_batch_size: 64
- eval_batch_size: 64
- seed: 42
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- num_epochs: 3
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
- Transformers 4.18.0
- Pytorch 1.11.0+cu113
- Datasets 2.1.0
- Tokenizers 0.12.1
- Downloads last month
- 7