Giter VIP home page Giter VIP logo

relation_classification's Introduction

relation_classification

Attention based Bi-LSTM model & bert

Dataset

SemEval 2010 Task 8

environment:

python==3.6
pytorch==1.5.0
transformers==2.1.0
tqdm
nltk
numpy
pandas

glove embedding

place pretrained glove embedding in folder "code/vector_cache/" for att_bilstm model. example: "relation_classification/code/vector_cache/glove.6B.200d.txt"

run

att_bilstm:

python main.py --model att_bilstm --nums_train_epochs 50 --train_batch_size 64 --learning_rate 0.005 --embedding_dim 200 --hidden_dim 400 --save_model ./model/ --output_dir ./out/

bert:

python main.py --model bert --num_train_epochs 10 --learning_rate 0.00005 --train_batch_size 64 --save_model ./model/ --output_dir ./out/

metrics

att_bilstm

Micro-averaged result (excluding Other): P = 1822/2281 = 79.88% R = 1822/2263 = 80.51% F1 = 80.19%

MACRO-averaged result (excluding Other): P = 79.43% R = 79.25% F1 = 79.10%

bert

Micro-averaged result (excluding Other): P = 2014/2339 = 86.11% R = 2014/2263 = 89.00% F1 = 87.53%

MACRO-averaged result (excluding Other): P = 85.45% R = 88.93% F1 = 87.02%

relation_classification's People

Contributors

asfalas avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 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.