Building the mentions matrix