Giter VIP home page Giter VIP logo

compact_reconstruction's Introduction

Compact Reconstruction

  • This repository is about Subword-based Compact Reconstruction of Word Embeddings. Sasaki et al. NAACL2019

Table of contents

Usage

Requirements

  • Python version >= 3.7
  • chainer
  • numpy

How to train

$ python src/train.py \
--gpu 0 \
--ref_vec_path crawl-300d-2M-subword.vec \
--freq_path resources/freq_count.crawl-300d-2M-subword.txt \
--multi_hash two \
--maxlen 200 \
--codecs_path resources/ngram_dic.max30.min3 \
--network_type 2 \
--subword_type 4 \
--limit_size 1000000 \
--bucket_size 100000 \
--result_dir ./result \
--hashed_idx \
--unique_false
network_type subword_type hashed_idx
SUM-F 2 0
SUM-H 2 0
KVQ-H 3 0
SUM-FH 2 4
KVQ-FH 3 4

How to estimate (OOV) word vectors

For estimating OOV word vectors:

$ python src/inference.py \
--gpu 0 \
--model_path \
result/sum/20190625_00_57_18/model_epoch_300 \
--codecs_path resources/ngram_dic.max30.min3 \
--oov_word_path resources/oov_words.txt

For reconstructing original word embeddings:

$ python src/save_embedding.py \
--gpu 0 \
--inference \
--model_path result/sum/20190625_00_57_18/model_epoch_300

Preprocessing of setting files

Resources

compact_reconstruction's People

Contributors

losyer avatar

Stargazers

Stephan Tulkens avatar Ivan Pereira avatar Jie Huang avatar Shawn Zhong avatar Violet Guo avatar Kian Kenyon-Dean avatar Hiroaki Funayama avatar Malik Diarra avatar Guanlin Li avatar

compact_reconstruction's Issues

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.