Compositional Distributional Semantics With Compact Closed Categories And Frobenius Algebras