Skip to content

Adya-Prasad/Missing-Word-Prediction-and-Attention-Visualizer-with-BERT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧠 Missing Word Prediction & Attention Visualizer with BERT

Welcome to the Missing Word Prediction and Attention Visualizer!
This interactive web app lets you explore how BERT predicts missing words in sentences and visually understand its attention mechanisms.

Missing-Word-Prediction-and-Attention-Visualizer-with-BERT.png

⌘ Features

  • Masked Word Prediction:
    Enter a sentence with the [MASK] token and see BERT's top 3 predictions for the missing word.

  • Attention Visualization:
    View attention heatmaps for every layer and head in BERT, showing how the model focuses on different words.

  • User-Friendly Interface:
    Clean, responsive design with example prompts and instant feedback.


☍ Live URL

coming very soon... (currently searching for free deployment)

How to use

  • Enter a prompt in input section with the [MASK] token.
  • Click predict ✦
  • Voila! You will have got the 3 best Predicton
  • To see attention images, click view attention images button at bottom, it will drop down with images grid

⏯ Quick Start

1. Clone the Repository

git clone https://github.com/Adya-Prasad/Missing-Word-Prediction-and-Attention-Visualizer-with-BERT.git

2. Move the application directory

cd Missing-Word-Prediction-and-Attention-Visualizer-with-BERT

3.Install dependencies I recommend to use a virtual environment

pip install -r requirements.txt

4. Finally! run the application (test it rigorously)

python app.py

☭ Contribute this application

This repo is open for contribution, I would love to have you onboard

  1. Repeat the same above ⏯ Quick Start step
  2. Create a new branch contri
  3. Do experiments, and test it. After correction implementation, PR it.

About

Missing Word Prediction and Attention Visualizer with BERT

Topics

Resources

Stars

Watchers

Forks