All Projects → FranxYao → Dgm_latent_bow

FranxYao / Dgm_latent_bow

Licence: mit
Implementation of NeurIPS 19 paper: Paraphrase Generation with Latent Bag of Words

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Dgm latent bow

Nndial
NNDial is an open source toolkit for building end-to-end trainable task-oriented dialogue models. It is released by Tsung-Hsien (Shawn) Wen from Cambridge Dialogue Systems Group under Apache License 2.0.
Stars: ✭ 332 (+273.03%)
Mutual labels:  natural-language-generation
Simplenlg
Java API for Natural Language Generation. Originally developed by Ehud Reiter at the University of Aberdeen’s Department of Computing Science and co-founder of Arria NLG. This git repo is the official SimpleNLG version.
Stars: ✭ 708 (+695.51%)
Mutual labels:  natural-language-generation
Convai Baseline
ConvAI baseline solution
Stars: ✭ 49 (-44.94%)
Mutual labels:  natural-language-generation
Question generation
Neural question generation using transformers
Stars: ✭ 356 (+300%)
Mutual labels:  natural-language-generation
This Word Does Not Exist
This Word Does Not Exist
Stars: ✭ 640 (+619.1%)
Mutual labels:  natural-language-generation
Pqg Pytorch
Paraphrase Generation model using pair-wise discriminator loss
Stars: ✭ 33 (-62.92%)
Mutual labels:  natural-language-generation
Kenlg Reading
Reading list for knowledge-enhanced text generation, with a survey
Stars: ✭ 257 (+188.76%)
Mutual labels:  natural-language-generation
Languagetoys
Random fun with statistical language models.
Stars: ✭ 63 (-29.21%)
Mutual labels:  natural-language-generation
Pplm
Plug and Play Language Model implementation. Allows to steer topic and attributes of GPT-2 models.
Stars: ✭ 674 (+657.3%)
Mutual labels:  natural-language-generation
Worldgeneration
Generating Interactive Fiction worlds from story plots
Stars: ✭ 43 (-51.69%)
Mutual labels:  natural-language-generation
Paperrobot
Code for PaperRobot: Incremental Draft Generation of Scientific Ideas
Stars: ✭ 372 (+317.98%)
Mutual labels:  natural-language-generation
Rnnlg
RNNLG is an open source benchmark toolkit for Natural Language Generation (NLG) in spoken dialogue system application domains. It is released by Tsung-Hsien (Shawn) Wen from Cambridge Dialogue Systems Group under Apache License 2.0.
Stars: ✭ 487 (+447.19%)
Mutual labels:  natural-language-generation
Describing a knowledge base
Code for Describing a Knowledge Base
Stars: ✭ 42 (-52.81%)
Mutual labels:  natural-language-generation
Nlp Conference Compendium
Compendium of the resources available from top NLP conferences.
Stars: ✭ 349 (+292.13%)
Mutual labels:  natural-language-generation
Dips
NAACL 2019: Submodular optimization-based diverse paraphrasing and its effectiveness in data augmentation
Stars: ✭ 59 (-33.71%)
Mutual labels:  natural-language-generation
Accelerated Text
Accelerated Text is a no-code natural language generation platform. It will help you construct document plans which define how your data is converted to textual descriptions varying in wording and structure.
Stars: ✭ 256 (+187.64%)
Mutual labels:  natural-language-generation
Nlg Eval
Evaluation code for various unsupervised automated metrics for Natural Language Generation.
Stars: ✭ 822 (+823.6%)
Mutual labels:  natural-language-generation
Gpt2
PyTorch Implementation of OpenAI GPT-2
Stars: ✭ 64 (-28.09%)
Mutual labels:  natural-language-generation
Nlg Rl
Accelerated Reinforcement Learning for Sentence Generation by Vocabulary Prediction
Stars: ✭ 59 (-33.71%)
Mutual labels:  natural-language-generation
Ludwig
Data-centric declarative deep learning framework
Stars: ✭ 8,018 (+8908.99%)
Mutual labels:  natural-language-generation

**Update**: On the Interpretability of Discrete Set Representations: A Bayesian Perspective

  • The discussion about the identifiability and interpretability of the LBOW model in the unsupervised setting.
  • Work in progress

The Latent Bag of Words Model

Implementation of Yao Fu, Yansong Feng and John Cunningham, Paraphrase Generation with Latent Bag of Words. NeurIPS 2019. paper

example

As is shown in the above example, given a source sentence, our model first infers the neighbor words of each source words, then sample a bag of words from the neighbors, then generate the paraphrase based on the sampled words

For more background about deep generative models for natural language processing, see the DGM4NLP journal list.

Reproduce

mkdir models
mkdir outputs
cd src
python3 main.py 

# quicker start
python3 main.py --batch_size=5 --train_print_interval=10

# Monitor training:
loss: 9.1796  -- total loss
enc_loss: 3.1693  -- BOW NLL loss
dec_loss: 6.0103  -- Decoder loss 
precision_confident: 0.4794  -- BOW precision on confident = most confident word neighbors 
recall_confident: 0.1727  -- BOW recall on confident = most confident word neighbors
precision_topk: 0.1186  -- BOW percision on topk = tok predicted word neighbors
recall_topk: 0.2387  -- BOW recall on topk = tok predicted word neighbors

May need to install nltk stopwords first, just follow the prompt

Data

We use the MSCOCO(17) dataset and the Quora dataset. The Quora dataset is provided in the data/ folder. The MSCOCO dataset can be downloaded from its offical website

Code Structure

The core implementation is in the following files:

  • config.py
  • main.py
  • controller.py
  • latent_bow.py

Others

There are certain codes about testing the Wikibio dataset. These part of the code is not included in the paper, its just for tesing the data-to-text task. So the published part might be incomplete. If you do want to extend the model to data-to-text, feel free to contact me.

The rouge evaluation is from here: https://pypi.org/project/py-rouge/. There is also a google implementation recently: https://github.com/google-research/google-research/tree/master/rouge.

The main_test.py is not for testing the model, it is for debugging in the ipython terminal.

Embarrassingly, I cannot replicate the results in Pytorch ... I moved to Pytorch after this project and there are still many things to understand (as a many-year tfer). It seems that the pytorch LSTM does not support residual connections, which results in degraded performance when I changed the number of layers to be 2. If you happen to find a solution, or find something close, do contact me.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].