Giter VIP home page Giter VIP logo

re-svm's Introduction

Relation Extraction Based on SVM

This is the last project of our course: Internet-based Information Extraction. We need to extract all employee relations from a text.

Configure Environment

  1. install anaconda3

  2. create a new environment with python2.7 in anaconda

    • conda create -n re-py27 python=2.7

    • conda activate re-py27

  3. install pyltp

    • pip install pyltp (会自动编译,所以会花十来分钟)
  4. download LTP 3.4 model for pyltp
    把模型解压到项目文件夹下,并重命名为ltp_data

  5. install libsvm
    linux 平台无法使用conda/pip直接安装,也无法通过wheel文件安装,windows平台可以通过wheel安装

    • download source code
    • compile
      • cd libsvm
      • make
      • cd python
      • make
    • copy files to re-py27 environment
      • copy

        • libsvm/python/commonutil.py
        • libsvm/python/svm.py
        • libsvm/python/svmtil.py

        to /home/zhouyiyuan/anaconda3/envs/re-py27/lib/python2.7/

    • copy libsvm/libsvm.so.2 to /home/zhouyiyuan/anaconda3/envs/re-py27/lib/
  6. download Chinese word vectors list

    • choose any one txt file from the github, then make a new dir and extract the txt file there
      • mkdir word_list
      • mv \your path\download_wordlist.txt \word_list

Function

Use Steps

  1. run the following command to train and test:

bash train_and_test.sh

  1. to train only:

    bash train.sh

  2. to test only:

    bash test.sh

Pipeline

  • train

image

  • test

image

  • feature extraction

image

re-svm's People

Contributors

mondayyuan avatar

Stargazers

达文西 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.