Detecting sentence entailment
In this recipe, we will explore techniques to detect textual entailment, given a set of two sentences. The first sentence in the set is the premise
, which sets up a context. The second sentence is the hypothesis
, which serves as the claim. Textual entailment identifies the contextual relationship between the premise
and the hypothesis
. These relationships can be of three types, defined as follows:
- Entailment – The hypothesis supports the premise
- Contradiction – The hypothesis contradicts the premise
- Neutral – The hypothesis neither supports nor contradicts the premise
Getting ready
We will use the Transformers library to detect text entailment. You can use the 9.6_textual_entailment.ipynb
notebook from the code site if you need to work from an existing notebook.
How to do it...
In this recipe, we will initialize different sets of sentences that are related through each of the previously defined relationships...