baseline_PPMI1.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:EventStoryLine 作者: tommasoc80 项目源码 文件源码
def cross_sentence(event_lemma_dict):
    """
    function to create all possible pairs between event mentions in a file
    :param event_lemma_dict: dictionary of event lemmas in file
    :return: counter dictionary of event pairs in a file
    """

    full_event_file = []
    pairs_circumstantial_corpus = Counter([])

    for k, v in event_lemma_dict.items():
        full_event_file.append(k)

    event_pairs_full = list(product(full_event_file, repeat=2))

    for i in event_pairs_full:
        pairs_circumstantial_corpus.update([i])

    return pairs_circumstantial_corpus
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号