All Projects → guillaumegenthial → Im2latex

guillaumegenthial / Im2latex

Licence: apache-2.0
Image to LaTeX (Seq2seq + Attention with Beam Search) - Tensorflow

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Im2latex

Seq2seq chatbot new
基于seq2seq模型的简单对话系统的tf实现,具有embedding、attention、beam_search等功能,数据集是Cornell Movie Dialogs
Stars: ✭ 144 (-57.89%)
Mutual labels:  beam-search, seq2seq
Seq2seq chatbot
基于seq2seq模型的简单对话系统的tf实现,具有embedding、attention、beam_search等功能,数据集是Cornell Movie Dialogs
Stars: ✭ 308 (-9.94%)
Mutual labels:  beam-search, seq2seq
Tf Seq2seq
Sequence to sequence learning using TensorFlow.
Stars: ✭ 387 (+13.16%)
Mutual labels:  beam-search, seq2seq
Seq2seq
基于Pytorch的中文聊天机器人 集成BeamSearch算法
Stars: ✭ 200 (-41.52%)
Mutual labels:  beam-search, seq2seq
minimal-nmt
A minimal nmt example to serve as an seq2seq+attention reference.
Stars: ✭ 36 (-89.47%)
Mutual labels:  seq2seq, beam-search
neural-chat
An AI chatbot using seq2seq
Stars: ✭ 30 (-91.23%)
Mutual labels:  seq2seq, beam-search
Poetry Seq2seq
Chinese Poetry Generation
Stars: ✭ 159 (-53.51%)
Mutual labels:  beam-search, seq2seq
Nlp made easy
Explains nlp building blocks in a simple manner.
Stars: ✭ 232 (-32.16%)
Mutual labels:  beam-search, seq2seq
beam search
Beam search for neural network sequence to sequence (encoder-decoder) models.
Stars: ✭ 31 (-90.94%)
Mutual labels:  seq2seq, beam-search
transformer
Neutron: A pytorch based implementation of Transformer and its variants.
Stars: ✭ 60 (-82.46%)
Mutual labels:  seq2seq, beam-search
Pytorch Chatbot
Pytorch seq2seq chatbot
Stars: ✭ 336 (-1.75%)
Mutual labels:  beam-search, seq2seq
Seq2seq Summarizer
Pointer-generator reinforced seq2seq summarization in PyTorch
Stars: ✭ 306 (-10.53%)
Mutual labels:  seq2seq
Quick Nlp
Pytorch NLP library based on FastAI
Stars: ✭ 279 (-18.42%)
Mutual labels:  seq2seq
Seq2seq chatbot links
Links to the implementations of neural conversational models for different frameworks
Stars: ✭ 270 (-21.05%)
Mutual labels:  seq2seq
Encoder decoder
Four styles of encoder decoder model by Python, Theano, Keras and Seq2Seq
Stars: ✭ 269 (-21.35%)
Mutual labels:  seq2seq
Seq2seq Chatbot For Keras
This repository contains a new generative model of chatbot based on seq2seq modeling.
Stars: ✭ 322 (-5.85%)
Mutual labels:  seq2seq
Dynamic Seq2seq
seq2seq中文聊天机器人
Stars: ✭ 303 (-11.4%)
Mutual labels:  seq2seq
Keras Text Summarization
Text summarization using seq2seq in Keras
Stars: ✭ 260 (-23.98%)
Mutual labels:  seq2seq
Deepqa
My tensorflow implementation of "A neural conversational model", a Deep learning based chatbot
Stars: ✭ 2,811 (+721.93%)
Mutual labels:  seq2seq
Bert seq2seq
pytorch实现bert做seq2seq任务,使用unilm方案,现在也可以做自动摘要,文本分类,情感分析,NER,词性标注等任务,支持GPT2进行文章续写。
Stars: ✭ 298 (-12.87%)
Mutual labels:  seq2seq

Im2Latex

Seq2Seq model with Attention + Beam Search for Image to LaTeX, similar to Show, Attend and Tell and Harvard's paper and dataset.

Check the blog post.

Install

Install pdflatex (latex to pdf) and ghostsript + magick (pdf to png) on Linux

make install-linux

(takes a while ~ 10 min, installs from source)

On Mac, assuming you already have a LaTeX distribution installed, you should have pdflatex and ghostscript installed, so you just need to install magick. You can try

make install-mac

Getting Started

We provide a small dataset just to check the pipeline. To build the images, train the model and evaluate

make small

You should observe that the model starts to produce reasonable patterns of LaTeX after a few minutes.

Data

We provide the pre-processed formulas from Harvard but you'll need to produce the images from those formulas (a few hours on a laptop).

make build

Alternatively, you can download the prebuilt dataset from Harvard and use their preprocessing scripts found here

Training on the full dataset

If you already did make build you can just train and evaluate the model with the following commands

make train
make eval

Or, to build the images from the formulas, train the model and evaluate, run

make full

Details

  1. Build the images from the formulas, write the matching file and extract the vocabulary. Run only once for a dataset
python build.py --data=configs/data.json --vocab=configs/vocab.json
  1. Train
python train.py --data=configs/data.json --vocab=configs/vocab.json --training=configs/training.json --model=configs/model.json --output=results/full/
  1. Evaluate the text metrics
python evaluate_txt.py --results=results/full/
  1. Evaluate the image metrics
python evaluate_img.py --results=results/full/

(To get more information on the arguments, run)

python file.py --help
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].