Code Monkey home page Code Monkey logo

ie-bert-cnn's Introduction

项目目录

|—— models      # 存放模型目录 存放网页相关前端配置
|—— modules     # 存放自己封装的encoder
|—— out         
|—— bert-base-chinese 
|—— |—— bert-base-chinese.tar.gz # bert预训练参数
|—— |—— vocab.txt # bert词典库
|—— data        # 存放数据
|—— |—— Data.py
|—— |—— small #自己合并了实体类型的数据
|—— |——|—— json_data  
|—— |——|—— npy_data  
|—— |——|——|——train
|—— |——|——|——dev
|—— |——|——|——test1
|—— |——|——|——test2
|—— |——|—— origin_data  # 存放原始数据
|—— analysis_result.ipynb  # 用来分析错误结果
|—— checkpoints # 存放训练模型参数
|—— config.py     
|—— helpData.py # 数据预处理函数
|—— mian.py     # 主函数
|—— metrics.py  # 测评函数
|—— README.md

项目环境(主要环境)

  • Ubuntu 16.04
  • Pytorch 1.x
  • Python 3.x

运行方式

  • 克隆项目
git clone https://github.com/Wangpeiyi9979/IE-Bert-CNN.git
  • 准备数据
    • 在这里下载数据,提取码59fg
    • 解压数据,放在data/small/origin_data/文件夹下
  • 准备Bert预训练模型
    • 在这里下载, 提取码uolz。将下载后的压缩文件放在bert-base-chinese文件夹下
  • 在data/small/目录下按项目结构中所示创建所需目录
  • 回到主目录,执行
python helpData.py
  • 开始训练
python main train
  • 预测

    • 将config.py中的ckpt_path更改为训练后的模型地址. 执行:
    python main tofile --case=1
    

    预测结果存放在out文件夹下.

  • 结果: f1:0.81(线上结果),线下约在0.76的样子。

ie-bert-cnn's People

Contributors

wangpeiyi9979 avatar

Watchers

James Cloos 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.