Downloads · 30 days
35
5% of all-time downloads
chaojiang06/medreadme_medical_sentence_readability_prediction_CWI
medreadme_medical_sentence_readability_prediction_CWI is a machine learning model from chaojiang06. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
should probably proofread and complete it, then remove this comment. --
Downloads · 30 days
35
5% of all-time downloads
All-time downloads
667
Public
Parameters
355M
1.4 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.4 GB · 100%
From the Hugging Face model README
Our paper is accepted by EMNLP 2024 main conference as an oral presentation. The paper is available at arXiv.
This is the best medical sentence readability model trained on our dataset. This checkpoint uses a standard HuggingFace sentence prediction model.
Please find more details in our repo.
# pip install transformers==4.35.2 torch --upgrade
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
MODEL_ID = "chaojiang06/medreadme_medical_sentence_readability_prediction_CWI"
MAX_LEN = 512
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
model = AutoModelForSequenceClassification.from_pretrained(
MODEL_ID,
trust_remote_code=True,
)
model.eval()
def score_sentences(sentences):
enc = tokenizer(
sentences,
padding=True, truncation=True, max_length=MAX_LEN,
return_tensors="pt"
)
with torch.no_grad():
out = model(**enc).logits.squeeze(-1) # shape: [batch]
return out.tolist()
print(score_sentences([
"Take one tablet by mouth twice daily after meals.",
"The pathophysiological sequelae of dyslipidemia necessitate..."
]))
This model is a fine-tuned version of roberta-large on the cwi dataset. It achieves the following results on the evaluation set:
The following hyperparameters were used during training: