def load_sentence_data(source_path, labels_path, activations):
    """Loads sentence-annotated text-label pairs. This function loads the source
    text, target labels, and activations and tries to make them perfectly
    parallel, i.e. number of tokens in line N of source would
    match the number of activations at index N. The method will delete
    non-matching activation/source pairs. The activations will be modified
    in place.

    Parameters
    ----------
    source_path : str
        Path to the source text file, one sentence per line
    labels_path : str
        Path to the annotated labels file, one sentence per line corresponding to
        the sentences in the ``source_path`` file.
    activations : list of numpy.ndarray
        Activations returned from ``loader.load_activations``

    Returns
    -------
    tokens : dict
        Dictionary containing two lists, ``source`` and ``target``. ``source``
        contains all of the sentences from ``source_path`` that were not ignored.
        ``target`` contains the parallel set of annotated labels.

    """
    tokens = {"source": [], "target": []}

    with open(source_path) as source_fp:
        for line_idx, line in enumerate(source_fp):
            tokens["source"].append(["sentence_%d" % (line_idx)])

    with open(labels_path) as labels_fp:
        for line in labels_fp:
            line_tokens = line.strip().split()
            tokens["target"].append(line_tokens)

    assert len(tokens["source"]) == len(tokens["target"]), (
        "Number of lines do not match (source: %d, target: %d)!"
        % (len(tokens["source"]), len(tokens["target"]))
    )

    assert len(activations) == len(tokens["source"]), (
        "Number of lines do not match (activations: %d, source: %d)!"
        % (len(activations), len(tokens["source"]))
    )

    # Check if all data is well formed (whether we have activations + labels for
    # each and every word)
    for idx, activation in enumerate(activations):
        assert activation.shape[0] == len(tokens["source"][idx])

    return tokens