Difficult samples
This section will run samples that contain problems that the BERT-based transformer will first solve. Finally, we will end with an intractable sample.
Let’s start with a complex sample that the BERT-based transformer can analyze.
Sample 4
Sample 4 takes us into more tricky SRL territory. The sample separates Alice
from the verb liked
, creating a long-term dependency that has to jump over whose husband went jogging every Sunday.
The sentence is:
Alice, whose husband went jogging every Sunday, liked to go to a dancing class in the meantime.
A human can isolate Alice
and find the predicate:
Alice liked to go to a dancing class in the meantime.
Can the BERT model find the predicate like us?
Let’s find out by first running the code in SRL.ipynb
:
prediction=predictor.predict(
sentence="Alice, whose husband went jogging every Sunday, liked to go to a dancing class in the meantime."
)
head(prediction)
...