项目作者: AndreFCruz

项目描述 :
Plot of the attention in a HAN (Hierarchical Attention Networks)
高级语言: Jupyter Notebook
项目地址: git://github.com/AndreFCruz/han-attention-plot.git
创建时间: 2019-08-12T16:13:55Z
项目社区:https://github.com/AndreFCruz/han-attention-plot

开源协议:MIT License

下载


han-attention-plot

Plot of the attention in a HAN (Hierarchical Attention Networks).

The blue :large_blue_circle: shades on the left represent sentence-level attention, and the red :red_circle: shades represent word-level attention.

This repository contains already parsed data from a model trained on 644 news articles to dinstiguish Hyperpartisan and Mainstream media (by-article-train_attn-data.json).
You can supply your own data as long as it follows the expected format (see here).

index.html was heavily based on this open-source repo.

How to

  1. Serve the index.html file with an HTTP server.

    1. python3 -m http.server 8080
  2. Navigate to localhost:8080

  3. Select and load the by-article-train_attn-data.json file.

  4. Choose the index of one of the loaded articles on the top-left text input (there are 644 articles in the provided data file).

  5. Click “Run”, and repeat from step 4 for different articles.

Other examples