fhirfly commited on
Commit
89dbadc
1 Parent(s): 8edf2b7

fixed typos

Browse files
Files changed (1) hide show
  1. README.md +16 -8
README.md CHANGED
@@ -41,16 +41,24 @@ How well the generated sentences adhere to FHIR standards.
41
  ## Usage
42
  Here's a simple Python code snippet to use this model:
43
 
44
- ```from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
 
45
  tokenizer = AutoTokenizer.from_pretrained("rapidfhir-procedures")
46
- model = AutoModelForSeq2SeqLM.from_pretrained("rapidfhir-procedures")
47
- input_text = "Procedure code: 1234, Description: Appendectomy"
48
- input_tokenized = tokenizer(input_text, return_tensors="pt")
49
- output = model.generate(**input_tokenized)
50
- output_text = tokenizer.decode(output[0], skip_special_tokens=True)
51
- print(output_text)
 
 
 
 
 
 
 
 
52
  ```
53
-
54
  ## Responsible AI Practices
55
  Transparency: This model card aims to provide a transparent view of the model's capabilities, limitations, and intended use-cases.
56
 
 
41
  ## Usage
42
  Here's a simple Python code snippet to use this model:
43
 
44
+ ```
45
+ from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
46
  tokenizer = AutoTokenizer.from_pretrained("rapidfhir-procedures")
47
+ model = AutoModelForSeq2SeqLM.from_pretrained("rapidfhir-procedures")
48
+ prompt = "SQM9PZ2545XHC4TE9RS27V183DD9KPW6JOI53UU5NYY8XRGIW6NZ0227WOAAW6NDNO79SR2K75T6J104XSAKMITKD8B8GPHGLQY424SHKI8OKQXXQN8BG435OKAMLFEN"
49
+ input_ids = tokenizer.encode(prompt, return_tensors="pt").to(device)
50
+ # Generate text with a maximum length of 4096 tokens
51
+ max_length = 4096
52
+ output = model.generate(input_ids, max_length=max_length)
53
+ # Move the output tensor back to CPU and decode the generated output
54
+ # Decode the generated output
55
+ generated_fhir = tokenizer.decode(output[0], skip_special_tokens=True)
56
+ print("Generated Summary:", generated_fhir)
57
+ ```
58
+ The outputted Gneerated FHIR will look like this:
59
+ ```
60
+ [resourceType] Procedure [id] efffddd8-effa-effa-ffaa-ffaffffffff [meta][profile][0] http://hl7.org/fhir/us/core/StructureDefinition/us-core-procedure [status] completed [code][coding][0][system] http://snomed.info/sct [code][coding][0][code] 430193006 [code][coding][0][display] Medication Reconciliation (procedure) [code][text] Medication Reconciliation (procedure) [subject][reference] Patient/fffffffd-fffa-fffa-fffa-fffffffffff [encounter][reference] Encounter/ffffffff-fffa-fffa-fffa-fffffffffff [performedPeriod][start] 2020-03-09T11:38:21-05:00 [performedPeriod][end] 2020-03-09T11:36:21-05:00 [location][reference] Location?identifier=https://github.com/synthetichealth/synthea|fffd0bf3-ffaa-3efd-affa-fffdfffffff [location][display] afffd0d-faed-bffa-fffa-fffffffffff [location][display] PCP237a3-faed-ffaa-ffffffffff [location][reference] Location?identifier=https://github.com/synthea|fff0bff9-ffaa-dfdd-ffc5-ffffffffff [location][display] PCP23757
61
  ```
 
62
  ## Responsible AI Practices
63
  Transparency: This model card aims to provide a transparent view of the model's capabilities, limitations, and intended use-cases.
64