Giter Site home page Giter Site logo

jin-guangyin / informationextractiondemo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wangpeiyi9979/informationextractiondemo

0.0 0.0 0.0 132 KB

一个关于百度2019语言与智能技术竞赛信息抽取 (http://lic2019.ccf.org.cn/kg) 的简单Demo, 模型采用BERT+CNN ( https://github.com/Wangpeiyi9979/IE-Bert-CNN )。 Demo使用Flask搭建

Python 78.82% JavaScript 6.18% HTML 5.90% Jupyter Notebook 9.11%

informationextractiondemo's Introduction

效果图片

效果截图

所需环境

  • Ubuntu 16.04
  • Python 3.6
  • Pytorch 1.x
  • Flask

项目目录

├── static      # 存放网页相关前端配置
│ ├── css       # css相关配置
│ ├── js        # js文件
├── templates   # 存放html文件
├── utils       # 存放模型相关文件
│ ├── bert-base-chinese 
│ ├── |—— bert-base-chinese.tar.gz # bert预训练参数
│ ├── |—— vocab_unk.txt # bert词典库
│ ├──  checkpoints # 存放已训练好的模型
│ ├──  json_data # 存放各种标签到数字的装换数据  
│ ├──  BERT_MUL_CNN.py # 模型
│ ├──  config.py     # 存放配置文件 
│ ├── encoder.py  # 封装了cnn层
│ ├── findTriple.py # 提供句子加工以及三元组处理函数
│ ├──  metrics.py # 提供实体切割函数
├── app.py # Flask程序主入口
├── README.md

使用说明

  • 克隆项目
git clone https://github.com/Wangpeiyi9979/InformationExtractionDemo.git
  • 安装相关库
pip3 install https://download.pytorch.org/whl/cu100/torch-1.1.0-cp36-cp36m-linux_x86_64.whl
pip3 intall flask
  • 下载训练好的模型
    • 下载bert预训练参数, 提取码:lizu
      • 将下载的文件放入uitls/bert-base-chinese/目录下
    • 下载预训练模型, 提取码:40jh
      • 创建目录
      cd utils
      mkdir checkpoints
      *mv ../ckpt checkpoints/(将下载的ckpt放入checkpoins下)
      
  • 切换到主目录,运行flask
python app.py
  • 打开浏览器,输入
localhost:5000

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.