Coder Social home page Coder Social logo

gxulmh / ner-multimodal-pytorch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from monologg/ner-multimodal-pytorch

0.0 1.0 0.0 648 KB

Pytorch Implementation of "Adaptive Co-attention Network for Named Entity Recognition in Tweets" (AAAI 2018)

Python 100.00%

ner-multimodal-pytorch's Introduction

NER-Multimodal-pytorch

(Unofficial) Pytorch Implementation of "Adaptive Co-attention Network for Named Entity Recognition in Tweets" (AAAI 2018)

Model

Dependencies

  • python>=3.5
  • torch==1.3.1
  • torchvision==0.4.2
  • pillow==7.0.0
  • pytorch-crf==0.7.2
  • seqeval==0.0.12
  • gdown>=3.10.1
$ pip3 install -r requirements.txt

Data

Train Dev Test
# of Data 4,000 1,000 3,257

1. Pretrained Word Vectors

  • Original code's pretrained word embedding can be downloaded at here.
  • But it takes quite long time to download, so I take out the word vectors that are only in word vocab.
  • It will be downloaded automatically when you run main.py.

2. Extracted VGG Features

  • Image features are extracted from last pooling layer of VGG16.

  • If you want to extract the feature by yourself, follow as below.

    1. Clone the repo of original code.
    2. Copy data/ner_img from original code to this repo.
    3. Run as below. (img_vgg_features.pt will be saved in data dir)
    $ python3 save_vgg_feature.py
  • Extracted features will be downloaded automatically when you run main.py.

Detail

  • There are some differences between the paper and the original code, so I tried to follow the paper's equations as possible.
  • Build the vocab with train, dev, and test dataset. (same as the original code)
    • Making the vocab only with train dataset decreases performance a lot. (about 5%)
  • Use Adam optimizer instead of RMSProp.

How to run

$ python3 main.py --do_train --do_eval

Result

F1 (%)
Re-implementation 67.10
Baseline (paper) 70.69

References

ner-multimodal-pytorch's People

Contributors

monologg 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.