Giter VIP home page Giter VIP logo

drawfigureforpaper's Introduction

DrawFigureForPaper

This repo stores some python scripts for drawing figures in scientific papers, i.e., "Microblog Hashtag Generation via Encoding Conversation Contexts " and "Topic-Aware Neural Keyphrase Generation for Social Media Language".

Here I do not intend to give detailed tutorials on how to draw figures using python, but just share some examples, including heatmap, histogram with error bar, and line figure. This repo will be kept updating hopefully:)

Dependencies

  • Python 3.6
  • matplotlib
  • pickle
  • numpy

Heatmap

Heatmap is a kind of common figures for visualizing attention scores. There are three inputs for drawing one heatmap, including column labels, row labels, and the weights to decide the darkness of color in each grid. Here I give two examples below: (plotted by heatmap.py and double_heatmap.py respectively)

blue heatmap

As the attention weights may be in large size, you can dump it in the format of csv (e.g., bi_attn.csv) and read it as input in the program heatmap.py later.

red heatmap

Histogram

Histogram with error bar is a very good choice for demonstrating your model performance. Here I give two examples: (plotted by hist_error_bar.py and frequency_hist.py respectively). Acknowledge Wang Chen for his help.

double vertical histogram with error bar

The error bar is computed by the standard deviation of your multiple model evaluation results. It is fed into the yerr argument of the method matplotlib.pyplot.bar().

double horizontal histogram

Line Figure

Here I show two examples on line figures: (plotted by dist_line.py and absent_rate_lines.py respectively)

line figure for distributions

You can first prepare the data statistics in the a collections python object and dump them as pickle object, e.g., tw_seg_data.pickle and wb_seg_data.pickle. dist_line.py reads these pickle data as input and compute its distribution for each bin.

lline figure for absent rates

drawfigureforpaper's People

Contributors

yuewang-cuhk avatar

Stargazers

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