Skip to content

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

License

Notifications You must be signed in to change notification settings

AndreFCruz/han-attention-plot

Repository files navigation

han-attention-plot

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

The blue 🔵 shades on the left represent sentence-level attention, and the red 🔴 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.

    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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published