def createMatrices(file, word2Idx, maxSentenceLen=100):
    'Creates matrices for the events and sentence for the given file'
    labels = []
    positionMatrix1 = []
    positionMatrix2 = []
    tokenMatrix = []
    for line in open(file):
        splits = line.strip().split('\t')
        label = splits[0]
        pos1 = splits[1]
        pos2 = splits[2]
        sentence = splits[3]
        tokens = sentence.split(' ')
        tokenIds = np.zeros(maxSentenceLen)
        positionValues1 = np.zeros(maxSentenceLen)
        positionValues2 = np.zeros(maxSentenceLen)
        for idx in range(0, min(maxSentenceLen, len(tokens))):
            tokenIds[idx] = getWordIdx(tokens[idx], word2Idx)
            distance1 = (idx - int(pos1))
            distance2 = (idx - int(pos2))
            if (distance1 in distanceMapping):
                positionValues1[idx] = distanceMapping[distance1]
            elif (distance1 <= minDistance):
                positionValues1[idx] = distanceMapping['LowerMin']
            else:
                positionValues1[idx] = distanceMapping['GreaterMax']
            if (distance2 in distanceMapping):
                positionValues2[idx] = distanceMapping[distance2]
            elif (distance2 <= minDistance):
                positionValues2[idx] = distanceMapping['LowerMin']
            else:
                positionValues2[idx] = distanceMapping['GreaterMax']
        tokenMatrix.append(tokenIds)
        positionMatrix1.append(positionValues1)
        positionMatrix2.append(positionValues2)
        labels.append(labelsMapping[label])
    return (np.array(labels, dtype='int32'), np.array(tokenMatrix, dtype='int32'), np.array(positionMatrix1, dtype='int32'), np.array(positionMatrix2, dtype='int32'))
Creates matrices for the events and sentence for the given file
def createMatrices(file, word2Idx, maxSentenceLen=100):
    
    labels = []
    positionMatrix1 = []
    positionMatrix2 = []
    tokenMatrix = []
    for line in open(file):
        splits = line.strip().split('\t')
        label = splits[0]
        pos1 = splits[1]
        pos2 = splits[2]
        sentence = splits[3]
        tokens = sentence.split(' ')
        tokenIds = np.zeros(maxSentenceLen)
        positionValues1 = np.zeros(maxSentenceLen)
        positionValues2 = np.zeros(maxSentenceLen)
        for idx in range(0, min(maxSentenceLen, len(tokens))):
            tokenIds[idx] = getWordIdx(tokens[idx], word2Idx)
            distance1 = (idx - int(pos1))
            distance2 = (idx - int(pos2))
            if (distance1 in distanceMapping):
                positionValues1[idx] = distanceMapping[distance1]
            elif (distance1 <= minDistance):
                positionValues1[idx] = distanceMapping['LowerMin']
            else:
                positionValues1[idx] = distanceMapping['GreaterMax']
            if (distance2 in distanceMapping):
                positionValues2[idx] = distanceMapping[distance2]
            elif (distance2 <= minDistance):
                positionValues2[idx] = distanceMapping['LowerMin']
            else:
                positionValues2[idx] = distanceMapping['GreaterMax']
        tokenMatrix.append(tokenIds)
        positionMatrix1.append(positionValues1)
        positionMatrix2.append(positionValues2)
        labels.append(labelsMapping[label])
    return (np.array(labels, dtype='int32'), np.array(tokenMatrix, dtype='int32'), np.array(positionMatrix1, dtype='int32'), np.array(positionMatrix2, dtype='int32'))