Views
No views yet
1from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
2
3tokenizer = AutoTokenizer.from_pretrained("DTanzillo/medclear-v2-base")
4model = AutoModelForSeq2SeqLM.from_pretrained("DTanzillo/medclear-v2-base")
5
6text = "simplify: Patient underwent laparoscopic cholecystectomy for acute cholecystitis. EBL minimal. POD1: afebrile, tolerating PO diet."
7inputs = tokenizer(text, return_tensors="pt", max_length=512, truncation=True)
8outputs = model.generate(**inputs, max_new_tokens=256, num_beams=4)
9print(tokenizer.decode(outputs[0], skip_special_tokens=True))| Level | Examples | % |
|---|---|---|
| Terms | 4,989 | 21.5% |
| Phrases | 6,660 | 28.8% |
| Sentences | 8,000 | 34.5% |
| Flashcards | 2,689 | 11.6% |
| Paragraphs | 574 | 2.5% |
| RAG-augmented | 245 | 1.1% |
| Metric | Raw FLAN-T5 | MedClear |
|---|---|---|
| ROUGE-1 F1 | 0.13 | 0.36 |
| ROUGE-2 F1 | 0.05 | 0.13 |
| ROUGE-L F1 | 0.10 | 0.22 |
| Eval Loss | -- | 1.712 |