You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 1.9 kB

6 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # 指代消解复现
  2. ## 介绍
  3. Coreference resolution是查找文本中指向同一现实实体的所有表达式的任务。
  4. 对于涉及自然语言理解的许多更高级别的NLP任务来说,
  5. 这是一个重要的步骤,例如文档摘要,问题回答和信息提取。
  6. 代码的实现主要基于[ End-to-End Coreference Resolution (Lee et al, 2017)](https://arxiv.org/pdf/1707.07045).
  7. ## 数据获取与预处理
  8. 论文在[OntoNote5.0](https://allennlp.org/models)数据集上取得了当时的sota结果。
  9. 由于版权问题,本文无法提供数据集的下载,请自行下载。
  10. 原始数据集的格式为conll格式,详细介绍参考数据集给出的官方介绍页面。
  11. 代码实现采用了论文作者Lee的预处理方法,具体细节参见[链接](https://github.com/kentonl/e2e-coref/blob/e2e/setup_training.sh)。
  12. 处理之后的数据集为json格式,例子:
  13. ```
  14. {
  15. "clusters": [],
  16. "doc_key": "nw",
  17. "sentences": [["This", "is", "the", "first", "sentence", "."], ["This", "is", "the", "second", "."]],
  18. "speakers": [["spk1", "spk1", "spk1", "spk1", "spk1", "spk1"], ["spk2", "spk2", "spk2", "spk2", "spk2"]]
  19. }
  20. ```
  21. ### embedding 数据集下载
  22. [turian emdedding](https://lil.cs.washington.edu/coref/turian.50d.txt)
  23. [glove embedding](https://nlp.stanford.edu/data/glove.840B.300d.zip)
  24. ## 运行
  25. ```shell
  26. # 训练代码
  27. CUDA_VISIBLE_DEVICES=0 python train.py
  28. # 测试代码
  29. CUDA_VISIBLE_DEVICES=0 python valid.py
  30. ```
  31. ## 结果
  32. 原论文作者在测试集上取得了67.2%的结果,AllenNLP复现的结果为 [63.0%](https://allennlp.org/models)。
  33. 其中AllenNLP训练时没有加入speaker信息,没有variational dropout以及只使用了100的antecedents而不是250。
  34. 在与AllenNLP使用同样的超参和配置时,本代码复现取得了63.6%的F1值。
  35. ## 问题
  36. 如果您有什么问题或者反馈,请提issue或者邮件联系我:
  37. yexu_i@qq.com