Enlightening patients using Medical Question Answering

What is automatic question answering?

Automatic question-answering is a classical problem in natural language processing, which aims at designing systems that can automatically answer a question, in the same way as human does.

DEMO FIRST

Types of Q&A systems based on approach:

  1. Rule based Q&A systems.
  2. Machine Learning based systems.
  3. Rule based systems that incorporate ML here and there (hybrid).

Today we will be focusing on Machine Learning based (specifically Deep Learning based) Q&A systems

Problem Statement #1

"Reading comprehension"

The machine has been given a paragraph, and questions will be asked from that paragraph only. The machine should be able to answer questions.

Problem Formulation

 

Create a model that 'reads' the paragraph and extracts the answer from that para itself by giving as output the starting index and the end index of the answer.

For Example:

Paragraph: Lily was a little girl, afraid of the big wide world, she grew up within her castle walls. Now and then she tried to run, Now and then she tried to run and then on the night with the setting sun, she went in the woods away so afraid, all alone.

Question: Where did lily grow up?

OUTPUT FROM MODEL: Starting index: 14 , End index: 17

Answer: Within her castle walls.

Solution #1

Bi Directional Attention Flow (BiDAF)

  • Research Paper available at https://arxiv.org/abs/1611.01603
  • Trained on huge SQuAD dataset, which contains pairs of question-answers and paragraphs.
  • Character Embedding Layer maps each word to a vector space using character-level CNNs.
  • Word Embedding Layer maps each word to a vector space using a pre-trained word em-
    bedding model.
  • Contextual Embedding Layer utilizes contextual cues from surrounding words to refine
    the embedding of the words. These first three layers are applied to both the query and
    context.
  • Context-to-query Attention. Context-to-query (C2Q) attention signifies which query words are
    most relevant to each context word
  • Query-to-context Attention. Query-to-context (Q2C) attention signifies which context words
    have the closest similarity to one of the query words and are hence critical for answering the query.
  • Modeling Layer employs a Recurrent Neural Network to scan the context.
  • Output Layer provides an answer to the query.

Taken from the research paper of BiDAF

Solution #2

BERT (Bidirectional Encoder Representations from Transformers)

Solution #2

BERT (Bidirectional Encoder Representations from Transformers)

Problem Statement #2

"Similar Question Selection"

The machine has been given a large corpus of questions and their corresponding answers. Given a new question, give the best answer possible from the list of answers.

Problem Formulation #1

 

Create a model that takes a question as an input and gets the most similar question from the corpus and returns its corresponding answer. It is similar to semantic search.

Solution

Universal Sentence Encoder

Question Answer
What is Malaria? It is a parasitic disease.
How to impress girls? Be rich :P

Universal Sentence Encoder

Vector1

Vector2

While Training

Vector1

Vector2

Universal Sentence Encoder

"Tell me what is Malaria?"

Vector3

cosine sim.

similarity 1

= 0.9

similarity 2

= 0.01

>

Found most similar question: "What is malaria?"

During inference:

Problem Formulation #2

 

Train a model that takes a question as an input and retrieves the most similar answer from the corpus and returns it, i.e. question to answer similarity matching.

Question model

What is malaria?

Answer model

Answer model

Answer model

Malaria is a parasitic infection, caused by female anopheles mosquito.

Symptoms of malaria are fever, headache, shivering etc.

Covid-19 is the name of the disease caused by the novel coronavirus.

Fixed length question vector(q)

Fixed length answer vector (a_1)

Fixed length answer vector (a_2)

Fixed length answer vector (a_3)

sigmoid(qMa_1)
sigmoid(qMa_1)
sigmoid(qMa_1)

}

Find maximum number (similarity)

Question Answering from free text, like online articles, text documents etc.

  • First use an information retrieval mechanism, for example, use Tf-IDF based methods to retrieve relevant paragraphs.

 

  • We can use another neural network trained in the previous section to rank the above retrieved paragraphs.

 

  • Then use the comprehension model on the first paragraph to get a concise answer.

Thank You

deck

By Yugal Sharma