Lecture 19 Question Answering

news2024/11/27 23:44:19

目录

      • introduction
      • IR-based QA (dominant approach)
      • Knowledge-based QA
      • Hybrid QA
      • Conclusion

introduction

  • Definition: question answering (“QA”) is the task of automatically determining the answer for a natural language question
  • Mostly focus on “factoid” questions
  • factoid question(not ambiguious)
    • Factoid questions, have short precise answers:
      • What war involved the battle of Chapultepec?
      • What is the date of Boxing Day?
      • What are some fragrant white climbing roses?
      • What are tannins?
  • non-factoid question
    • General non-factoid questions require a longer answer, critical analysis, summary, calculation and more:
      • Why is the date of Australia Day contentious?
      • What is the angle 60 degrees in radians?
  • why focus on factoid questions
    • They are easier
    • They have an objective answer
    • Current NLP technologies cannot handle non-factoid answers(under developing)
  • 2 key approaches
    • Information retrieval-based QA
      • Given a query, search relevant documents
      • extract answers within these relevant documents
    • Knowledge-based QA
      • Builds semantic representation of the query
      • Query database of facts to find answers

IR-based QA (dominant approach)

  • IR-based factoid QA: TREC-QA 在这里插入图片描述

    1. Use question to make query for IR engine
      • query formulation: extract key terms to search for documents in the database
      • answer type detection: guess what type of answer is the question looking for
    2. Find document, and passage(段,章) within document(find most relevant passages)
    3. Extract short answer string(use relevant passages and answer type information)
  • question processing

    • Find key parts of question that will help retrieval
      • Discard non-content words/symbols (wh-word, ?, etc)
      • Formulate as tf-idf query, using unigrams or bigrams
      • Identify entities and prioritise match
    • May reformulate question using templates
      • E.g. “Where is Federation Square located?”
      • Query = “Federation Square located”
      • Query = “Federation Square is located [in/at]”
    • Predict expected answer type (here = LOCATION)
  • answer types

    • Knowing the type of answer can help in:
      • finding the right passage containing the answer
      • finding the answer string
    • Treat as classification (a closed set of answer types)
      • given question, predict answer type
      • key feature is question headword
      • What are the animals on the Australian coat of arms?
      • Generally not a difficult task 在这里插入图片描述在这里插入图片描述
  • retrieval

    • Find top n documents matching query (standard IR)
    • Next find passages (paragraphs or sentences) in these documents (also driven by IR)
    • a good passage should contain:
      • many instances of the question keywords
      • several named entities of the answer type
      • close proximity(靠近) of these terms in the passage
      • high ranking by IR engine
    • Re-rank IR outputs to find best passage (e.g., using supervised learning)
  • answer extraction

    • Find a concise answer to the question, as a span in the passage

      • “Who is the federal MP for Melbourne?”
      • The Division of Melbourne is an Australian Electoral Division in Victoria, represented since the 2010 election by Adam Bandt, a member of the Greens.
      • “How many Australian PMs have there been since 2013?”
      • Australia has had five prime ministers in five years. No wonder Merkel needed a cheat sheet at the G-20.
    • how?

      • Use a neural network to extract answer
      • AKA reading comprehension task(assuming query and evidence passage are given, and find the span)
      • But deep learning models require lots of data
      • Do we have enough data to train comprehension models?
    • dataset

      • MCTest(a dataset)

        • Crowdworkers write fictional stories, questions and answers
        • 500 stories, 2000 questions
        • Multiple choice questions 在这里插入图片描述
      • SQuAD

        • Use Wikipedia passages(easier to create than MCTest)
        • First set of crowdworkers create questions (given passage)
        • Second set of crowdworkers label the answer
        • 150K questions (!)
        • Second version includes unanswerable questions(no answer in the passage) 在这里插入图片描述
    • reading comprehension

      • Given a question and context passage, predict where the answer span starts and end in passage?

      • Compute:

        • P s t a r t ( i ) P_{start}(i) Pstart(i): prob. of token i is the starting token
        • P e n d ( i ) P_{end}(i) Pend(i): prob. of token i is the ending token 在这里插入图片描述
      • LSTM-based model

        • Feed question tokens to a bidirectional LSTM

        • Aggregate LSTM outputs via weighted sum to produce q, the final question embedding 在这里插入图片描述

        • Process passage in a similar way, using another bidirectional LSTM

        • More than just word embeddings as input

          • A feature to denote whether the word matches a question word
          • POS feature
          • Weighted question embedding: produced by attending to each question words 在这里插入图片描述
        • { p 1 , . . . , p m p_1,...,p_m p1,...,pm}: one vector for each passage token from bidirectional LSTM

        • To compute start and end probability for each token

          • p s t a r t ( i ) ∝ e x p ( p i W s q ) p_{start}(i) \propto exp(p_iW_sq) pstart(i)exp(piWsq)
          • P e n d ( i ) ∝ e x p ( p i W e q ) P_{end}(i) \propto exp(p_iW_eq) Pend(i)exp(piWeq) 在这里插入图片描述
      • BERT-based model

        • Fine-tune BERT to predict answer span

          • p s t a r t ( i ) ∝ e x p ( S T T i ′ ) p_{start}(i) \propto exp(S^TT_i') pstart(i)exp(STTi)
          • p e n d ( i ) ∝ e x p ( E T T i ′ ) p_{end}(i) \propto exp(E^TT_i') pend(i)exp(ETTi) 在这里插入图片描述
        • why BERT works better than LSTM

          • It’s pre-trained and so already “knows” language before it’s adapted to the task
          • Self-attention architecture allows fine-grained analysis between words in question and context paragraph

Knowledge-based QA

  • QA over structured KB
    • Many large knowledge bases
      • Freebase, DBpedia, Yago, …
    • Can we support natural language queries?
      • E.g.
        • ‘When was Ada Lovalace born?’ → \to birth-year (Ada Lovelace, ?x)
        • ‘What is the capital of England’ → \to capital-city(?x, England)
      • Link “Ada Lovelace” with the correct entity in the KB to find triple (Ada Lovelace, birth-year, 1815)
    • but
      • Converting natural language sentence into triple is not trivial
        • ‘When was Ada Lovelace born’ → \to birth-year (Ada Lovelace, ?x)
      • Entity linking also an important component
        • Ambiguity: “When was Lovelace born?”
      • Can we simplify this two-step process?
    • semantic parsing
      • Convert questions into logical forms to query KB directly

        • Predicate calculus
        • Programming query (e.g. SQL) 在这里插入图片描述
      • how to build a semantic parser

        • Text-to-text problem:
          • Input = natural language sentence
          • Output = string in logical form
        • Encoder-decoder model(but do we have enough data?) 在这里插入图片描述

Hybrid QA

  • hybrid methods

    • Why not use both text-based and knowledgebased resources for QA?
    • IBM’s Watson which won the game show Jeopardy! uses a wide variety of resources to answer questions
      • (question)THEATRE: A new play based on this Sir Arthur Conan Doyle canine classic opened on the London stage in 2007.
      • (answer)The Hound Of The Baskervilles
  • core idea of Watson

    • Generate lots of candidate answers from textbased and knowledge-based sources
    • Use a rich variety of evidence to score them
    • Many components in the system, most trained separately 在这里插入图片描述在这里插入图片描述在这里插入图片描述在这里插入图片描述
  • QA evaluation

    • IR: Mean Reciprocal Rank for systems returning matching passages or answer strings
      • E.g. system returns 4 passages for a query, first correct passage is the 3rd passage
      • MRR = 1/3
    • MCTest: Accuracy
    • SQuAD: Exact match of string against gold answer

Conclusion

  • IR-based QA: search textual resources to answer questions
    • Reading comprehension: assumes question+passage
  • Knowledge-based QA: search structured resources to answer questions
  • Hot area: many new approaches & evaluation datasets being created all the time (narratives, QA, commonsense reasoning, etc)

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/628866.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

牛客网论坛最具争议的Linux内核成神笔记,GitHub已下载量已过百万

原文地址:牛客网论坛最具争议的Linux内核成神笔记,GitHub已下载量已过百万 1、前言 Linux内核是一个操作系统(OS)内核,本质上定义为类Unix。它用于不同的操作系统,主要是以不同的Linux发行版的形式。Linu…

网红如何创建百度百科词条?

随着互联网的发展,越来越多的人开始从事网红行业。对于网红来说,提升自己的个人形象至关重要,一个提升品牌形象的快速方式就是创建百度百科词条。网红如何创建百度百科词条?如何创建一个高质量的百度百科词条?下面伯乐…

万维网服务器

一、域名解析gethostbyname函数 struct hostent {char *h_name; /* 官方域名 */char **h_aliases; /* 别名*/int h_addrtype; /* 地址族(地址类型) */int h_length; /* 地址长度 */char **h_addr_list; …

Qt扫盲-Qt事件系统概述

Qt事件系统概述 一、概述二、事件类型 - Event Types三、事件处理程序 - Event Handlers四、事件过滤器 - Event Filters五、发送事件 - Sending Events1. sendEvent()2. postEvent() 一、概述 在Qt中,事件是由抽象的QEvent类派生而来的对象,表示发生在…

凌恩全新育种分析流程!助力种质资源高分文章发表!

种质资源又称遗传资源。种质是指生物体亲代传递给子代的遗传物质,它往往存在于特定品种之中。如古老的地方品种、新培育的推广品种、重要的遗传材料,野生近缘植物以及利用上述繁殖材料创造的各种遗传材料,都属于种质资源的范围,是…

为什么要使用微软的 Application Framework?

我是荔园微风,作为一名在IT界整整25年的老兵,今天来看一下我们为什么要使用微软的 Application Framework? 虽然Application Framework 并不是新观念,它们却在最近数年才成为 PC 平台上软件开发的主流工具。面向对象语言是具体实…

【Spring Boot 初识丨三】starter

Soring Boot 初识 【Spring Boot 初识丨一】入门实战 【Spring Boot 初识丨二】maven 本篇来讲一讲 starter 依赖项 Starter 一、定义二、启动器2.1 应用启动器2.2 生产启动器2.3 技术启动器 一、定义 启动器是一组方便的依赖关系描述符,它包含了一系列可以集成到应…

并行事务会引发的三个问题

并行事务是指同时运行多个事务,每个事务独立地执行,并且不会相互影响。在数据库管理系统中,当多个用户同时对同一个数据集进行读取或者写入的时候,使用并行事务可以提高系统的吞吐量和响应时间。同时,由于并行事务可以…

c++学习之继承

目录 一,为什么需要继承 二,继承的基本概念 三,派生类的定义 四,继承中的析构预构造 1,子类中的构造与析构的顺序 2,子类调用成员对象,父类的有参构造 五,子类与父类的同名处理…

防雪崩利器之Hystrix

Hystrix作为一个容错组件,本文从它的作用、熔断设计、工作流程和应用方面一一道来,帮助大家了解如何使用。 1、什么是灾难性雪崩效应 要讲Hystrix,我们就要讲一种场景,在微服务架构中,如果底层服务出现故障&#xff0…

Ubuntu搭建APM固件编译环境

文章目录 前言一、下载源码二、配置编译环境三、编译固件 前言 Ubuntu20.04 APM 4.2.3 参考链接: https://ardupilot.org/dev/docs/building-setup-linux.html 一、下载源码 git clone https://github.com/ArduPilot/ardupilot.git下载完之后 cd ardupilotgit s…

Lecture 18 Information Extraction

目录 Named Entity RecognitionRelation ExtractionOther IE TasksConclusion information extraction Given this: “Brasilia, the Brazilian capital, was founded in 1960.”Obtain this: capital(Brazil, Brasilia)founded(Brasilia, 1960) Main goal: turn text into str…

Linux基本指令详细介绍 【Linux】

文章目录 ls 指令( list directory contents)ls -als -alls -dlls -l (ll)ls -alF文件的类型 : pwd命令(Print Working Directory)cd 命令 (change directory)cd ..cd ~cd - touch指令mkdir指令mkdir -p ( parents) treermdir指令&#xff08…

【数据结构】哈希应用

目录 一、位图 1、位图概念 2、位图实现 2.1、位图结构 2.2、比特位置1 2.3、比特位置0 2.4、检测位图中比特位 3、位图例题 3.1、找到只出现一次的整数 3.2、找到两个文件交集 3.3、找到出现次数不超过2次的所有整数 二、布隆过滤器 1、布隆过滤器提出 2、布隆过…

javaScript蓝桥杯----商城管理系统

目录 一、介绍二、准备三、目标四、代码五、完成 一、介绍 在商城管理系统中,超级管理员和普通管理员因为权限不同,登录进入后看到的菜单也会是不同的。 本题需要你完成商城管理系统中权限数据的处理。 二、准备 开始答题前,需要先打开本…

2023年,千万不要裸辞....

作为IT行业的大热岗位——软件测试,只要你付出了,就会有回报。说它作为IT热门岗位之一是完全不虚的。可能很多人回说软件测试是吃青春饭的,但放眼望去,哪个工作不是这样的呢?会有哪家公司愿意养一些闲人呢?…

硬件设计电源系列文章-LDO基础知识

文章目录 概要整体架构流程技术名词解释技术细节小结 概要 提示:这里可以添加技术概要 例如: 本文主要开始讲述电源的发展 整体架构流程 提示:这里可以添加技术整体架构 AC/DC转换基础。为什么需要AC需要DC 技术名词解释 提示&#x…

车载测试很难吗?我靠着这套面试资料拿下了16k车载测试offer!

目录 如何写简历 项目经验 如何准备面试 车载项目的实施 常见面试题 总结: 车载测试通常包含以下三个方面: 系统测试:对整车系统进行测试,如车载电子系统、底盘系统、动力系统等。系统测试主要是评估整车各项性能指标是否达到…

STM32单片机(四)第一节:OLED调试工具

❤️ 专栏简介:本专栏记录了从零学习单片机的过程,其中包括51单片机和STM32单片机两部分;建议先学习51单片机,其是STM32等高级单片机的基础;这样再学习STM32时才能融会贯通。 ☀️ 专栏适用人群 :适用于想要…

深入聊一下机械硬盘的相关内容

本文是《数据存储通识课》合集的一部分,本合集希望通过一系列文章科普数据存储相关技术内容。同时,本系列文章不仅仅是科普,还会进行有深度解析,理论结合实现,从代码实现层面进行剖析​ 介绍存储技术当然要从存储技术最基本的组件磁盘开始介绍了。目前市面上我们见得最多的…