Instructions to use zhyiyang/EHR-Longformer with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use zhyiyang/EHR-Longformer with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="zhyiyang/EHR-Longformer")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForMaskedLM tokenizer = AutoTokenizer.from_pretrained("zhyiyang/EHR-Longformer") model = AutoModelForMaskedLM.from_pretrained("zhyiyang/EHR-Longformer", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download config.json from zhyiyang/EHR-Longformer: direct link, hf CLI and curl.
- Browser
- Download file 2.3 kB
-
https://huggingface.co/zhyiyang/EHR-Longformer/resolve/main/config.json
- Command line
-
hf download hf://zhyiyang/EHR-Longformer/config.json
-
curl -L -o config.json https://huggingface.co/zhyiyang/EHR-Longformer/resolve/main/config.json
2.3 kB
| { | |
| "_name_or_path": "./Clinical-Longformer", | |
| "add_cross_attention": false, | |
| "architectures": [ | |
| "LongformerForMaskedLM" | |
| ], | |
| "attention_mode": "longformer", | |
| "attention_probs_dropout_prob": 0.1, | |
| "attention_window": [ | |
| 512, | |
| 512, | |
| 512, | |
| 512, | |
| 512, | |
| 512, | |
| 512, | |
| 512, | |
| 512, | |
| 512, | |
| 512, | |
| 512 | |
| ], | |
| "bad_words_ids": null, | |
| "base_model_name": "Clinical-Longformer", | |
| "bos_token_id": 0, | |
| "cell_input_template": [ | |
| "column", | |
| "|", | |
| "type", | |
| "|", | |
| "value" | |
| ], | |
| "chunk_size_feed_forward": 0, | |
| "column_delimiter": "</s>", | |
| "column_representation": "mean_pool", | |
| "context_first": true, | |
| "decoder_start_token_id": null, | |
| "do_lower_case": false, | |
| "do_sample": false, | |
| "early_stopping": false, | |
| "eos_token_id": 2, | |
| "finetuning_task": null, | |
| "gradient_checkpointing": false, | |
| "hidden_act": "gelu", | |
| "hidden_dropout_prob": 0.1, | |
| "hidden_size": 768, | |
| "id2label": { | |
| "0": "LABEL_0", | |
| "1": "LABEL_1" | |
| }, | |
| "ignore_attention_mask": false, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 3072, | |
| "is_decoder": false, | |
| "is_encoder_decoder": false, | |
| "label2id": { | |
| "LABEL_0": 0, | |
| "LABEL_1": 1 | |
| }, | |
| "layer_norm_eps": 1e-05, | |
| "length_penalty": 1.0, | |
| "masked_column_prob": 0.2, | |
| "masked_context_prob": 0.15, | |
| "max_cell_len": 256, | |
| "max_clinical_notes_len": 3000, | |
| "max_length": 20, | |
| "max_position_embeddings": 4098, | |
| "max_predictions_per_seq": 600, | |
| "max_sequence_len": 4096, | |
| "min_length": 0, | |
| "model_type": "longformer", | |
| "no_repeat_ngram_size": 0, | |
| "num_attention_heads": 12, | |
| "num_beams": 1, | |
| "num_hidden_layers": 12, | |
| "num_return_sequences": 1, | |
| "output_attentions": false, | |
| "output_hidden_states": false, | |
| "pad_token_id": 1, | |
| "position_embedding_type": "absolute", | |
| "prefix": null, | |
| "pruned_heads": {}, | |
| "repetition_penalty": 1.0, | |
| "return_dict": false, | |
| "sep_token_id": 2, | |
| "table_mask_strategy": "value", | |
| "task_specific_params": null, | |
| "temperature": 1.0, | |
| "tie_encoder_decoder": false, | |
| "tie_word_embeddings": true, | |
| "tokenizer_class": null, | |
| "top_k": 50, | |
| "top_p": 1.0, | |
| "torch_dtype": "float32", | |
| "torchscript": false, | |
| "transformers_version": "4.9.0.dev0", | |
| "type_vocab_size": 1, | |
| "use_bfloat16": false, | |
| "use_cache": true, | |
| "vocab_size": 50265, | |
| "xla_device": null | |
| } |