Feature Extraction
Transformers
Safetensors
protenrich
proteins
bioinformatics
drug-discovery
custom_code
Run this model with HF Jobs
Run SaeedLab/ProtEnrich-ProtT5 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/SaeedLab/ProtEnrich-ProtT5. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/SaeedLab/ProtEnrich-ProtT5 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use SaeedLab/ProtEnrich-ProtT5 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SaeedLab/ProtEnrich-ProtT5 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="SaeedLab/ProtEnrich-ProtT5", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("SaeedLab/ProtEnrich-ProtT5", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Commit ·
5a6e6a3
1
Parent(s): a854962
update readme
Browse files123456714 unmodified lines22232425# ProtT5```pythonfrom transformers import AutoTokenizer, AutoModel, T5Tokenizer, T5EncoderModelimport torchtokenizer = T5Tokenizer.from_pretrained('Rostlab/prot_t5_xl_half_uniref50-enc')14 unmodified linesprint('H algn:', enriched.h_algn)print('Structure:', enriched.struct)print('Dynamics:', enriched.dyn)```12345678910111213141516171819202122232425262728293031323334353637383940414243444546474814 unmodified lines63646566676869707172737475767778798081828384858687888990919293949596979899100101102103104---license: cc-by-nc-nd-4.0datasets:- SaeedLab/ProtEnrichtags:- proteins- bioinformatics- drug-discovery- feature-extraction- transformers---# ProtEnrich - ProtT5This model corresponds to ProtEnrich based on ProtT5.\[[Github Repo](https://github.com/pcdslab/ProtEnrich)\] | \[[Dataset on HuggingFace](https://huggingface.co/datasets/SaeedLab/ProtEnrich)\] | \[[Model Collection](https://huggingface.co/collections/SaeedLab/protenrich)\] | \[[Cite](#citation)\]## AbstractProtein language models effectively capture evolutionary and functional signals from sequence data but lack explicit representation of the biophysical properties that govern protein structure and dynamics. Existing multimodal approaches attempt to integrate such physical information through direct fusion, often requiring multimodal inputs at inference time and distorting the sequence embedding space. Consequently, a fundamental challenge of how to incorporate structural and dynamical knowledge into sequence representations without disrupting their established semantic organization remains a field-of-research. We introduce ProtEnrich, a representation learning framework based on a residual multimodal enrichment paradigm. ProtEnrich decomposes sequence embeddings into two complementary latent subspaces, an anchor subspace that preserves sequence semantics, and an alignment subspace that encodes biophysical relationships. By converting multimodal information derived from ProstT5 and RocketSHP to a low-energy residual component, our approach injects physical representation while maintaining the original sequence embedding. Across eight diverse protein foundational models trained on 550,120 SwissProt proteins with AlphaFold structures, enriched embeddings improved zero-shot remote homology retrieval, increasing Precision@10 and MRR by up to 0.13 and 0.11, respectively. Downstream performance also improved on structure-dependent tasks, reducing fluorescence prediction error by up to 16% and increasing metal ion binding AUCROC by up to 2.4 points, while requiring only sequence input at inference.## Model DetailsProtEnrich is a family of protein language model enrichment methods designed to inject low-energy structural and dynamical representations using only the sequence at inference time. Available models:* **[ProtEnrich Ankh 3 XL](https://huggingface.co/SaeedLab/ProtEnrich-Ankh3):** Enriched model based on [Ankh 3 XL](https://huggingface.co/ElnaggarLab/ankh3-xl).* **[ProtEnrich CARP 640M](https://huggingface.co/SaeedLab/ProtEnrich-CARP-640M):** Enriched model based on [CARP 640M](https://github.com/microsoft/protein-sequence-models).* **[ProtEnrich ESM1b](https://huggingface.co/SaeedLab/ProtEnrich-ESM1b):** Enriched model based on [ESM1b](https://huggingface.co/facebook/esm1b_t33_650M_UR50S).* **[ProtEnrich ESM2 T36](https://huggingface.co/SaeedLab/ProtEnrich-ESM2-T36):** Enriched model based on [ESM2 T36](https://huggingface.co/facebook/esm2_t36_3B_UR50D).* **[ProtEnrich ESM Cambrian 600M](https://huggingface.co/SaeedLab/ProtEnrich-ESMC-600M):** Enriched model based on [ESM Cambrian 600M](https://www.evolutionaryscale.ai/blog/esm-cambrian).* **[ProtEnrich ProGen2](https://huggingface.co/SaeedLab/ProtEnrich-ProGen2):** Enriched model based on [ProGen2](https://huggingface.co/hugohrban/progen2-base).* **[ProtEnrich ProtBERT](https://huggingface.co/SaeedLab/ProtEnrich-ProtBERT):** Enriched model based on [ProtBERT](https://huggingface.co/Rostlab/prot_bert).* **[ProtEnrich ProtT5](https://huggingface.co/SaeedLab/ProtEnrich-ProtT5):** Enriched model based on [ProtT5](https://huggingface.co/Rostlab/prot_t5_xl_half_uniref50-enc).## Model UsageYou can use this model for feature extraction (embeddings) or fine-tune it for downstream prediction tasks. The embeddings may be used for similarity measurements, visualization, or training predictor models.### Embedding ExtractionUse the code below to get started with the model for embedding extraction:```pythonfrom transformers import AutoModel, T5Tokenizer, T5EncoderModelimport torchtokenizer = T5Tokenizer.from_pretrained('Rostlab/prot_t5_xl_half_uniref50-enc')14 unmodified linesprint('H algn:', enriched.h_algn)print('Structure:', enriched.struct)print('Dynamics:', enriched.dyn)```### Downstream Prediction TaskUse the code below to get started with the model for downstream prediction tasks:```pythonfrom transformers import T5Tokenizer, T5EncoderModel, AutoConfig, AutoModelForSequenceClassificationimport torchtokenizer = T5Tokenizer.from_pretrained('Rostlab/prot_t5_xl_half_uniref50-enc')encoder = T5EncoderModel.from_pretrained('Rostlab/prot_t5_xl_half_uniref50-enc')config = AutoConfig.from_pretrained("SaeedLab/ProtEnrich-ProtT5", trust_remote_code=True)config.num_labels = 10protenrich = AutoModelForSequenceClassification.from_config(config, trust_remote_code=True)seqs = ["MKTFFVLLL"]seqs = [" ".join(i) for i in seqs]inputs = tokenizer(seqs, return_tensors="pt", add_special_tokens=True)with torch.no_grad():outputs = encoder(**inputs)pooled = outputs.last_hidden_state[0, :-1].mean(axis=0)enriched = protenrich(pooled)print('Logits:', enriched.logits)```## CitationThe paper is under review. As soon as it is accepted, we will update this section.## LicenseThis model and associated code are released under the CC-BY-NC-ND 4.0 license and may only be used for non-commercial, academic research purposes with proper attribution. Any commercial use, sale, or other monetization of this model and its derivatives, which include models trained on outputs from the model or datasets created from the model, is prohibited and requires prior approval. Downloading the model requires prior registration on Hugging Face and agreeing to the terms of use. By downloading this model, you agree not to distribute, publish or reproduce a copy of the model. If another user within your organization wishes to use the model, they must register as an individual user and agree to comply with the terms of use. Users may not attempt to re-identify the deidentified data used to develop the underlying model. If you are a commercial entity, please contact the corresponding author.## ContactFor any additional questions or comments, contact Fahad Saeed (fsaeed@fiu.edu).
README.md+82-3