Instructions to use google-t5/t5-large with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use google-t5/t5-large with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "translation" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # 'pip install "transformers<5.0.0' from transformers import pipeline pipe = pipeline("translation", model="google-t5/t5-large")# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("google-t5/t5-large") model = AutoModelForMultimodalLM.from_pretrained("google-t5/t5-large") - Inference
- Notebooks
- Google Colab
- Kaggle
Determining probability of result when checking whether a premise and hypothesis are related
I am using the t5-large to determine whether a premise and hypothesis are related. That is whether the answer is an entailment, contradiction, or neutral.
I am trying to reproduce the first step of this paper (https://research.google/pubs/pub51307/) where they used the t5-11b and predicted whether a premise and hypothesis are related. They also calculated a score. For example, if a pair gave entailment, they also calculated P(entailment). They used the checkpoints from Google's repository directly.
I tried to find out whether this can be done using the model from HugginfFace. This is the code I am currently using. This just gives textual representation, whether something is entailment or contradiction, or neutral. I also was able to get some scores but not sure how to use them to calculate probability.
Any help to calculate the probability would be appreciated!
