Skip to content

msb1/flask-nlp-question-answer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flask-nlp-question-answer

Trained question answer model integrated into Flask demo app
  1. Training data set is provided by Google's Natural Questions
  2. Data is cleaned and stored in MongoDB - notebooks: TFQA-bilstm-attn.ipynb
  3. Model is parallel bi-directional lstm for both question and answer text; the second lstm layer is followed by a multihead attention layer
  4. The parallel models are concatenated into dense layers with a sigmoid activation at the final layer
  5. The Spacy large vocabulary model is used for token ID's and vectors for each word
  6. Model is in notebooks: TFQA-bilstm-attn.ipynb
  7. Weights from trained model are saved in file which is too large to upload but can be readily regenerated
  8. A Flask demo app is included with Bootstrap 4 styling:
    • Weights from trained model are imported on demo app startup
    • Start page has input boxes for question and text corpus.
    • Text corpus is parsed into potential one, two and three sentence answers which are fed into the trained model
    • The highest three scores are listed as potential answers with scores in [0, 1)
    • Named entities are also displayed for the text corpus.

About

Trained question answer model integrated into Flask demo app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors