├── README.md ├── __init__.py ├── data ├── ner │ ├── test.txt │ ├── train.txt │ └── valid.txt ├── relation_extract │ ├── NYT │ │ └── test.json │ ├── SemEval2010 │ │ ├── label.txt │ │ ├── test.tsv │ │ └── train.tsv │ ├── relation2id.txt │ └── train.txt └── vocab.txt ├── models ├── cbow_w2v.pkl └── pretrained │ └── albert_tiny_zh_google │ ├── albert_config.json │ ├── albert_model.ckpt.data-00000-of-00001 │ ├── albert_model.ckpt.index │ ├── albert_model.ckpt.meta │ ├── checkpoint │ └── vocab.txt ├── ner ├── __init__.py ├── __pycache__ │ ├── config.cpython-36.pyc │ ├── config.cpython-37.pyc │ ├── crf.cpython-36.pyc │ ├── data_helper.cpython-36.pyc │ └── data_helper.cpython-37.pyc ├── bert_bilstm_crf.py ├── bilstm.py ├── bilstm_attention.py ├── bilstm_crf.py ├── config.py ├── crf.py └── data_helper.py ├── relation_extract ├── __pycache__ │ ├── bilstm_attention_tf.cpython-36.pyc │ ├── config.cpython-36.pyc │ └── data_helper.cpython-36.pyc ├── bilstm_attention_re │ ├── __init__.py │ ├── bilstm_attention_pytorch.py │ ├── bilstm_attention_tf.py │ ├── config.py │ ├── data_helper.py │ └── train.py ├── joint_re_bilstm_ntc │ ├── __init__.py │ ├── config.py │ ├── data_helper.py │ ├── model.py │ ├── readme.md │ └── train.py └── rbert_tf │ ├── __init__.py │ ├── data_loader.py │ ├── model_tf.py │ └── trainer.py └── w2v ├── __init__.py ├── __pycache__ ├── data_helper.cpython-36.pyc └── data_helper.cpython-37.pyc ├── data_helper.py ├── w2v_cbow_pytorch.py └── w2v_cbow_tf.py /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/README.md -------------------------------------------------------------------------------- /__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /data/ner/test.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/data/ner/test.txt -------------------------------------------------------------------------------- /data/ner/train.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/data/ner/train.txt -------------------------------------------------------------------------------- /data/ner/valid.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/data/ner/valid.txt -------------------------------------------------------------------------------- /data/relation_extract/NYT/test.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/data/relation_extract/NYT/test.json -------------------------------------------------------------------------------- /data/relation_extract/SemEval2010/label.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/data/relation_extract/SemEval2010/label.txt -------------------------------------------------------------------------------- /data/relation_extract/SemEval2010/test.tsv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/data/relation_extract/SemEval2010/test.tsv -------------------------------------------------------------------------------- /data/relation_extract/SemEval2010/train.tsv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/data/relation_extract/SemEval2010/train.tsv -------------------------------------------------------------------------------- /data/relation_extract/relation2id.txt: -------------------------------------------------------------------------------- 1 | unknown 0 2 | 父母 1 3 | 夫妻 2 4 | 师生 3 5 | 兄弟姐妹 4 6 | 合作 5 7 | 情侣 6 8 | 祖孙 7 9 | 好友 8 10 | 亲戚 9 11 | 同门 10 12 | 上下级 11 -------------------------------------------------------------------------------- /data/relation_extract/train.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/data/relation_extract/train.txt -------------------------------------------------------------------------------- /data/vocab.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/data/vocab.txt -------------------------------------------------------------------------------- /models/cbow_w2v.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/models/cbow_w2v.pkl -------------------------------------------------------------------------------- /models/pretrained/albert_tiny_zh_google/albert_config.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/models/pretrained/albert_tiny_zh_google/albert_config.json -------------------------------------------------------------------------------- /models/pretrained/albert_tiny_zh_google/albert_model.ckpt.data-00000-of-00001: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/models/pretrained/albert_tiny_zh_google/albert_model.ckpt.data-00000-of-00001 -------------------------------------------------------------------------------- /models/pretrained/albert_tiny_zh_google/albert_model.ckpt.index: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/models/pretrained/albert_tiny_zh_google/albert_model.ckpt.index -------------------------------------------------------------------------------- /models/pretrained/albert_tiny_zh_google/albert_model.ckpt.meta: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/models/pretrained/albert_tiny_zh_google/albert_model.ckpt.meta -------------------------------------------------------------------------------- /models/pretrained/albert_tiny_zh_google/checkpoint: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/models/pretrained/albert_tiny_zh_google/checkpoint -------------------------------------------------------------------------------- /models/pretrained/albert_tiny_zh_google/vocab.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/models/pretrained/albert_tiny_zh_google/vocab.txt -------------------------------------------------------------------------------- /ner/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ner/__pycache__/config.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/ner/__pycache__/config.cpython-36.pyc -------------------------------------------------------------------------------- /ner/__pycache__/config.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/ner/__pycache__/config.cpython-37.pyc -------------------------------------------------------------------------------- /ner/__pycache__/crf.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/ner/__pycache__/crf.cpython-36.pyc -------------------------------------------------------------------------------- /ner/__pycache__/data_helper.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/ner/__pycache__/data_helper.cpython-36.pyc -------------------------------------------------------------------------------- /ner/__pycache__/data_helper.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/ner/__pycache__/data_helper.cpython-37.pyc -------------------------------------------------------------------------------- /ner/bert_bilstm_crf.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/ner/bert_bilstm_crf.py -------------------------------------------------------------------------------- /ner/bilstm.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/ner/bilstm.py -------------------------------------------------------------------------------- /ner/bilstm_attention.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/ner/bilstm_attention.py -------------------------------------------------------------------------------- /ner/bilstm_crf.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/ner/bilstm_crf.py -------------------------------------------------------------------------------- /ner/config.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/ner/config.py -------------------------------------------------------------------------------- /ner/crf.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/ner/crf.py -------------------------------------------------------------------------------- /ner/data_helper.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/ner/data_helper.py -------------------------------------------------------------------------------- /relation_extract/__pycache__/bilstm_attention_tf.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/relation_extract/__pycache__/bilstm_attention_tf.cpython-36.pyc -------------------------------------------------------------------------------- /relation_extract/__pycache__/config.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/relation_extract/__pycache__/config.cpython-36.pyc -------------------------------------------------------------------------------- /relation_extract/__pycache__/data_helper.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/relation_extract/__pycache__/data_helper.cpython-36.pyc -------------------------------------------------------------------------------- /relation_extract/bilstm_attention_re/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /relation_extract/bilstm_attention_re/bilstm_attention_pytorch.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/relation_extract/bilstm_attention_re/bilstm_attention_pytorch.py -------------------------------------------------------------------------------- /relation_extract/bilstm_attention_re/bilstm_attention_tf.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/relation_extract/bilstm_attention_re/bilstm_attention_tf.py -------------------------------------------------------------------------------- /relation_extract/bilstm_attention_re/config.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/relation_extract/bilstm_attention_re/config.py -------------------------------------------------------------------------------- /relation_extract/bilstm_attention_re/data_helper.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/relation_extract/bilstm_attention_re/data_helper.py -------------------------------------------------------------------------------- /relation_extract/bilstm_attention_re/train.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/relation_extract/bilstm_attention_re/train.py -------------------------------------------------------------------------------- /relation_extract/joint_re_bilstm_ntc/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /relation_extract/joint_re_bilstm_ntc/config.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/relation_extract/joint_re_bilstm_ntc/config.py -------------------------------------------------------------------------------- /relation_extract/joint_re_bilstm_ntc/data_helper.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/relation_extract/joint_re_bilstm_ntc/data_helper.py -------------------------------------------------------------------------------- /relation_extract/joint_re_bilstm_ntc/model.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/relation_extract/joint_re_bilstm_ntc/model.py -------------------------------------------------------------------------------- /relation_extract/joint_re_bilstm_ntc/readme.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/relation_extract/joint_re_bilstm_ntc/readme.md -------------------------------------------------------------------------------- /relation_extract/joint_re_bilstm_ntc/train.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/relation_extract/joint_re_bilstm_ntc/train.py -------------------------------------------------------------------------------- /relation_extract/rbert_tf/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /relation_extract/rbert_tf/data_loader.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/relation_extract/rbert_tf/data_loader.py -------------------------------------------------------------------------------- /relation_extract/rbert_tf/model_tf.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/relation_extract/rbert_tf/model_tf.py -------------------------------------------------------------------------------- /relation_extract/rbert_tf/trainer.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/relation_extract/rbert_tf/trainer.py -------------------------------------------------------------------------------- /w2v/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /w2v/__pycache__/data_helper.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/w2v/__pycache__/data_helper.cpython-36.pyc -------------------------------------------------------------------------------- /w2v/__pycache__/data_helper.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/w2v/__pycache__/data_helper.cpython-37.pyc -------------------------------------------------------------------------------- /w2v/data_helper.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/w2v/data_helper.py -------------------------------------------------------------------------------- /w2v/w2v_cbow_pytorch.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/w2v/w2v_cbow_pytorch.py -------------------------------------------------------------------------------- /w2v/w2v_cbow_tf.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chongzicbo/KG_Tutorial/HEAD/w2v/w2v_cbow_tf.py --------------------------------------------------------------------------------