yuanxiaosc / Multiple-Relations-Extraction-Only-Look-Once

Multiple-Relations-Extraction-Only-Look-Once. Just look at the sentence once and extract the multiple pairs of entities and their corresponding relations. 端到端联合多关系抽取模型,可用于 http://lic2019.ccf.org.cn/kg 信息抽取。
https://yuanxiaosc.github.io/2019/05/28/信息抽取任务相关论文发展脉络/
346 stars 69 forks source link

单条文本预测? #18

Closed liutianling closed 4 years ago

liutianling commented 4 years ago

非常感谢您的开源精神! 我想利用您的项目尝试单条文本预测?该如何做? 我尝试改了下run_multiple_relations_extraction.py代码,最后再这个函数的时候,对单条文本这里要怎么输入? d = tf.data.TFRecordDataset(input_file)

def input_fn(params):
    """The actual input function."""
    batch_size = params["batch_size"]

    # For training, we want a lot of parallel reading and shuffling.
    # For eval, we want no shuffling and parallel reading doesn't matter.
    d = tf.data.TFRecordDataset(input_file)
    if is_training:
        d = d.repeat()
        d = d.shuffle(buffer_size=100)

    d = d.apply(
        tf.contrib.data.map_and_batch(
            lambda record: _decode_record(record, name_to_features),
            batch_size=batch_size,
            drop_remainder=drop_remainder))

    return d
yuanxiaosc commented 4 years ago

@liutianling 最简单的方法就是把单条样本扩充成minibatch条样本

liutianling commented 4 years ago

@yuanxiaosc 谢谢,这个办法还是想过的,哈哈