Git Product home page Git Product logo

pytorch-pcnn's Introduction

Introduction

基于Pytorch复现PCNN (Zeng 2014)全监督关系抽取的代码.

相关博客地址: 关系抽取论文笔记

另外基于远程监督的PCNN+ONE (Zeng 2015) 代码连接: PCNN+ONE/ATT

数据集

使用Semeval 2010的9类关系(考虑方向 19类)

使用方法

  • Python环境

    • pytorch 0.3(后续会升级为0.4及以后版本)
    • python 2.7x
    • fire
  • 数据预处理: python dataset/semeval.py去生成npy文件

  • 训练, 自动保存最优模型(未设计验证集)

    python main_sem.py train
    

    其中 参数配置位于 config.py,可以直接指定修改,如: python main_sem.py train --batch_size=32

  • 模型预测的结果位于semeval文件夹,使用./test.sh使用semeval官方的脚本测试,最后结果保存于res.txt

  • F1大概可以到80-81%左右,经过fine-tuning 大概到82-83%

参考

  • PCNN: Relation Classification via Convolutional Deep Neural Network

pytorch-pcnn's People

Contributors

shomyliu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.