27
10소통하는 기계 <인공지능 입문> 강의 노트 서울대학교 컴퓨터공학부 & 인지과학/뇌과학 협동과정 http://bi.snu.ac.kr/~btzhang/ Version: 20180528

제10강 소통하는 기계 - Seoul National University · 2018-05-28 · 언어, 사고, 소통 ©2018A ByoungLTak Zhang,SeoulANationalAUniversity 3! 언어" 소리,문자,기호,행동!

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 제10강 소통하는 기계 - Seoul National University · 2018-05-28 · 언어, 사고, 소통 ©2018A ByoungLTak Zhang,SeoulANationalAUniversity 3! 언어" 소리,문자,기호,행동!

제10강소통하는기계

<인공지능입문>강의노트

장 병 탁서울대학교컴퓨터공학부&인지과학/뇌과학협동과정http://bi.snu.ac.kr/~btzhang/

Version: 20180528

Page 2: 제10강 소통하는 기계 - Seoul National University · 2018-05-28 · 언어, 사고, 소통 ©2018A ByoungLTak Zhang,SeoulANationalAUniversity 3! 언어" 소리,문자,기호,행동!

목차

언어,사고,소통 …………………..….…………………………….………….. 3자연언어처리 ………………….…..………...…….…………..………………. 5음성인식 ….......................………...….…….……….…..……….……....   12정보검색 …………………….…………………………………………………..... 16기계번역 ………………………………………………………………………….... 17질의응답/챗봇 …………..……………….….…..…………..…...………….. 18스마트스피커 .….…………………..……..….……….……..…..……...….. 19대화로봇 …………………………..……………..………....…………………… 20화행론 ………………………………..…………………………………………….. 21Reading  Assignments      ….……………..….…..…….….………….….……… 27

2©  2018   Byoung-­‐Tak Zhang,  Seoul  National  University

Page 3: 제10강 소통하는 기계 - Seoul National University · 2018-05-28 · 언어, 사고, 소통 ©2018A ByoungLTak Zhang,SeoulANationalAUniversity 3! 언어" 소리,문자,기호,행동!

언어,사고, 소통

©  2018   Byoung-­‐Tak Zhang,  Seoul  National  University 3

q 언어Ø 소리,문자,기호,행동

q 언어와사고Ø 사피어-­‐워프가설

(Sapir-­‐Whorf  Hypothesis)Ø “우리는모국어의범위

안에서자연세계를판단한다”

q 언어와소통Ø 기호와소통으로서의언어Ø 화행론 (Speech  Acts)  

제10강

https://www.youtube.com/watch?v=WnzlbyTZsQY

Page 4: 제10강 소통하는 기계 - Seoul National University · 2018-05-28 · 언어, 사고, 소통 ©2018A ByoungLTak Zhang,SeoulANationalAUniversity 3! 언어" 소리,문자,기호,행동!

4

자연언어처리와 인공지능

• 자연언어처리(Natural  language  processing, NLP)– Immense  field  with  many  potential  applications,  including  translation  

from  one  language  into  another,  retrieval  of  information  from  databases,  human/computer  interaction,  and  automatic  dictation.

• AI-­‐hard문제• To  produce  a  system  as  competent  with  language  as  a  human  is  would  require  solving  “the  AI  problem”.

• 난점• Resolving  pragmatic  ambiguities  which  seems  to  require  reasoning  over  a  large  commonsense  knowledge  base  and  parsing  systems  adequate  to  handle  natural  languages.

• Ex)    P:  Well,  I’ll  need  to  see  your  printout.S:  I  can’t  unlock  the  door  to  the  small  computer  room to  get  it.P:  Here’s  the  key.

제10강

(c)  2018  Biointelligence Lab,  Seoul  National  University

Page 5: 제10강 소통하는 기계 - Seoul National University · 2018-05-28 · 언어, 사고, 소통 ©2018A ByoungLTak Zhang,SeoulANationalAUniversity 3! 언어" 소리,문자,기호,행동!

자연언어처리

(c)  2018  Biointelligence Lab,  Seoul  National  University 5

자연언어처리(NLP)1. 자연언어이해 (Natural  Language  Understanding,  NLU)

Taking  some  spoken/typed  sentence  and  working  out  what  it  means

2. 자연언어생성 (Natural  Language  Generation,  NLG)Taking  some  formal  representation  of  what  you  want  to  say  and  working  out  a  way  to  express  it  in  a  natural  (human)  language  (e.g.,  English)

자연언어처리의단계• 음성언어,문자언어• 단어,문장,대화,텍스트• 형태론,구문론,의미론,화용론

제10강

Page 6: 제10강 소통하는 기계 - Seoul National University · 2018-05-28 · 언어, 사고, 소통 ©2018A ByoungLTak Zhang,SeoulANationalAUniversity 3! 언어" 소리,문자,기호,행동!

6

자연언어처리의 어려움

• 자연언어처리의어려움– 다의성 (Polysemy)

• I  keep  the  money  in  the  bank.• I  walk  along  the  bank  of  the  river.

– 중의성 (ambiguity)• Time  flies  like  an  arrow.• I  saw  a  man  with  a  telescope.

– 다양성 (Diversity)• She  sold  him  a  book  for  five  dollars.• He  bought  a  book  for  five  dollars  from  her.

• 관련지식– 어휘적지식– 문법적지식– 상황/문맥지식

제10강

Page 7: 제10강 소통하는 기계 - Seoul National University · 2018-05-28 · 언어, 사고, 소통 ©2018A ByoungLTak Zhang,SeoulANationalAUniversity 3! 언어" 소리,문자,기호,행동!

• Input/output  data         Processing  stage     Other  data  used

Frequency  spectrogram freq.  of  diff.speech  recognition sounds

Word  sequence grammar  of“He  loves  Mary” syntactic  analysis language

Sentence  structure meanings  ofsemantic  analysis words

He    loves    MaryPartial  meaning context  ofΞx  loves(x,mary)                         pragmatics utterance

Sentence  meaningloves(john,mary)

자연언어이해제10강

Page 8: 제10강 소통하는 기계 - Seoul National University · 2018-05-28 · 언어, 사고, 소통 ©2018A ByoungLTak Zhang,SeoulANationalAUniversity 3! 언어" 소리,문자,기호,행동!

구문분석 -­‐문법

• sentence -> noun_phrase, verb_phrase• noun_phrase -> proper_noun• noun_phrase -> determiner, noun• verb_phrase -> verb, noun_phrase• proper_noun -> [mary]• noun -> [apple]• verb -> [ate]• determiner -> [the]

제10강

Page 9: 제10강 소통하는 기계 - Seoul National University · 2018-05-28 · 언어, 사고, 소통 ©2018A ByoungLTak Zhang,SeoulANationalAUniversity 3! 언어" 소리,문자,기호,행동!

구문분석 -­‐파싱

sentence

noun_phrase verb_phrase

proper_noun verb            noun_phrase

determiner          noun

“Mary” “ate” “the” “apple”

제10강

Page 10: 제10강 소통하는 기계 - Seoul National University · 2018-05-28 · 언어, 사고, 소통 ©2018A ByoungLTak Zhang,SeoulANationalAUniversity 3! 언어" 소리,문자,기호,행동!

(C)  2000  SNU  CSE  Artificial  Intelligence  Lab   (SCAI)10

파싱

• Parsing– Deciding  whether  or  not  an  arbitrary  string  of  symbols   is  a  legal  sentence

• Syntactic  analysis– The  parsing  process

• Various  parsing  algorithm– Top-­‐down  algorithm– Bottom-­‐up  algorithm• Usually  proceeds  in  left-­‐to-­‐right  fashion  along  the  string

제10강

Page 11: 제10강 소통하는 기계 - Seoul National University · 2018-05-28 · 언어, 사고, 소통 ©2018A ByoungLTak Zhang,SeoulANationalAUniversity 3! 언어" 소리,문자,기호,행동!

(C)  2000  SNU  CSE  Artificial  Intelligence  Lab   (SCAI)11

의미분석

• PP  ß Prep  NP– Specify  the  semantic  association  for  PP  in  terms  of  the  semantic  

associations  for  Prep  and  NP– These  semantic  associations  are  indicated  by  expressing  each  

nonterminal  symbol  as  a  functional  expression;  for  example,  PP(sem)• At  the  conclusion  of  parsing,  the  formula  associated  with  the  

nonterminal  symbol  S  is  then  taken  to  be  the  meaning  of  the  string.

• With  these  associations,  the  grammar  is  called  an  augmented  phrase-­‐structure  grammar,  and  the  parsing  process  accomplishes  what  is  called  a semantic  analysis.

제10강

Page 12: 제10강 소통하는 기계 - Seoul National University · 2018-05-28 · 언어, 사고, 소통 ©2018A ByoungLTak Zhang,SeoulANationalAUniversity 3! 언어" 소리,문자,기호,행동!

12

음성인식

In  speech  recognition  you  observe  an  acoustic  signal  (A = a1,…,an)  and  you  want  to  determine  the  most  likely  sequence  of  words  (W = w1,…,wn):  

P(W |  A)

Problem:  A and  W are  too  specific  for  reliable  counts  on  observed  data,  and  are  very  unlikely  to  occur  in  unseen  data

제10강

Page 13: 제10강 소통하는 기계 - Seoul National University · 2018-05-28 · 언어, 사고, 소통 ©2018A ByoungLTak Zhang,SeoulANationalAUniversity 3! 언어" 소리,문자,기호,행동!

음성인식모델• P(W|A) could  be  computed  as

• Given  a  candidate  sequence  W  we  need  to  compute  P(W)  and  combine  it  with  P(W|A). Applying  Bayes’  rule:

The  denominator  P(A)  can  be  dropped,  because  it  is  constant  for  all  W.

The  decoder  combines  evidence   from  ♦ The  likelihood:  P(A|W)

♦ The  prior:  P(W)

P(W | A) = maxwiai

∏ P(wi | ai)

argmaxW

P(W | A) = argmaxW

P(A |W )P(W )P(A)

P(A |W ) ≈ P(aii=1

n∏ |wi )

P(W ) ≈ P(w1 ) P(wii= 2

n∏ |wi−1)

제10강

Page 14: 제10강 소통하는 기계 - Seoul National University · 2018-05-28 · 언어, 사고, 소통 ©2018A ByoungLTak Zhang,SeoulANationalAUniversity 3! 언어" 소리,문자,기호,행동!

자연언어처리응용

• 기계번역 (Machine  Translation)• 정보검색 (Information  Retrieval)• 인간컴퓨터상호작용 (HCI)• 질의응답시스템 (QA)• 대화시스템 (Dialogue)• 챗봇 (Chatbots)• 스마트스피커 (Smart  Speakers)• 대화로봇 (Talking  Robots)

(c)  2017  Biointelligence   Lab,  SNU 14

제10강

Page 15: 제10강 소통하는 기계 - Seoul National University · 2018-05-28 · 언어, 사고, 소통 ©2018A ByoungLTak Zhang,SeoulANationalAUniversity 3! 언어" 소리,문자,기호,행동!

n 기계번역(Machine  Translation,  MT)n 최근딥러닝을통해급격한성능향상n 구글의신경기계번역시스템 (Neural  MT,  NMT)

©  2017,  장교수의 딥러닝,  SNU  CSE  Biointelligence   Lab.,  http://bi.snu.ac.kr

기계번역

3

제10강

Page 16: 제10강 소통하는 기계 - Seoul National University · 2018-05-28 · 언어, 사고, 소통 ©2018A ByoungLTak Zhang,SeoulANationalAUniversity 3! 언어" 소리,문자,기호,행동!

16(c) 2000-2007 SNU CSE Biointelligence Lab, http://bi.snu.ac.kr/

정보검색Text Data

Classification System

Information Filtering System

questionuser profile

feedback

answer

DB

LocationDate

DB Record

DB Template Filling& InformationExtraction System

Information FilteringInformation Extraction

filtered data

Text Classification

Preprocessing and Indexing

제10강

Page 17: 제10강 소통하는 기계 - Seoul National University · 2018-05-28 · 언어, 사고, 소통 ©2018A ByoungLTak Zhang,SeoulANationalAUniversity 3! 언어" 소리,문자,기호,행동!

질의응답 (QA)

IBM Watson

A technology platform that uses natural language processing and machine learning to reveal insights from large amounts of unstructured data.

제10강

Page 18: 제10강 소통하는 기계 - Seoul National University · 2018-05-28 · 언어, 사고, 소통 ©2018A ByoungLTak Zhang,SeoulANationalAUniversity 3! 언어" 소리,문자,기호,행동!

챗봇 /가상비서

18

제10강

Page 19: 제10강 소통하는 기계 - Seoul National University · 2018-05-28 · 언어, 사고, 소통 ©2018A ByoungLTak Zhang,SeoulANationalAUniversity 3! 언어" 소리,문자,기호,행동!

스마트스피커

19

SKT  Nugu

Google  Home

Amazon  Echo

제10강

Page 20: 제10강 소통하는 기계 - Seoul National University · 2018-05-28 · 언어, 사고, 소통 ©2018A ByoungLTak Zhang,SeoulANationalAUniversity 3! 언어" 소리,문자,기호,행동!

대화로봇

Jibo (MIT)Family  Robot

Buddy  (Blue  Frog  Robotics)

제10강

Page 21: 제10강 소통하는 기계 - Seoul National University · 2018-05-28 · 언어, 사고, 소통 ©2018A ByoungLTak Zhang,SeoulANationalAUniversity 3! 언어" 소리,문자,기호,행동!

(C)  2000  SNU  CSE  Artificial  Intelligence  Lab   (SCAI) 21

화행론 (Speech Acts)• Communicative  act– Communicate  with  other  agents  in  order  to  affect  another  agent’s  cognitive  structure.

• Communicative  medium– Sounds,  writing,  radio– Communicative  acts  among  humans  often  involve  spoken  language.• So,  communicative  acts  are  also  called  speech  acts.

Speaker HearerSpeech acts

제10강

Page 22: 제10강 소통하는 기계 - Seoul National University · 2018-05-28 · 언어, 사고, 소통 ©2018A ByoungLTak Zhang,SeoulANationalAUniversity 3! 언어" 소리,문자,기호,행동!

(C)  2000  SNU  CSE  Artificial  Intelligence  Lab   (SCAI) 22

발언 (Utterance)

• Physical  manifestations– Physical  motions– Acoustic  disturbance– Flashing  lights– Etc.

• The  utterance  must  both  express  the  propositional  content  and  the  type  of  the  speech  act  that  it  manifests.– E.g.  “put  block  A  on  block  B”• Request  &  On(A,B)

제10강

Page 23: 제10강 소통하는 기계 - Seoul National University · 2018-05-28 · 언어, 사고, 소통 ©2018A ByoungLTak Zhang,SeoulANationalAUniversity 3! 언어" 소리,문자,기호,행동!

(C)  2000  SNU  CSE  Artificial  Intelligence  Lab   (SCAI) 23

화행의종류

• Representatives– Those  that  state  a  proposition

• Directives– That  request  or  command

• Commissives– That  promise  or  threaten

• Declarations– That  actually  change  the  state  of  the  world,  such  as  “I  now  pronounce  you  husband  and  wife”

제10강

Page 24: 제10강 소통하는 기계 - Seoul National University · 2018-05-28 · 언어, 사고, 소통 ©2018A ByoungLTak Zhang,SeoulANationalAUniversity 3! 언어" 소리,문자,기호,행동!

(C)  2000  SNU  CSE  Artificial  Intelligence  Lab  (SCAI) 24

Perlocution and Illocution• Speech  acts  are  presumed  to  have  an  effect  on  the  

hearer’s  knowledge– If  our  agent  A1  commits  a  representative  speech act  informing  a  

hearer  A2  that  a  proposition  q  is  true,  then  A1  can  assume  that  the  effect  of  this  act  is  that  A2  knows  that  A1  intended  to  informA2  that  q.

• Perlocutionary  effect– The  effect  on  the  hearer  intended  by  the  speaker

• Illocutionary  effect– The  effect   the  speech  actually  has

• Indirect  speech  acts– Speech  acts  whose  perlocutionary  effects  are  different  from  what  

they  appear  to  be.– E.g.  You  left  the  refrigerator  door  open

제10강

Page 25: 제10강 소통하는 기계 - Seoul National University · 2018-05-28 · 언어, 사고, 소통 ©2018A ByoungLTak Zhang,SeoulANationalAUniversity 3! 언어" 소리,문자,기호,행동!

(C)  2000  SNU  CSE  Artificial  Intelligence  Lab  (SCAI) 25

효과적인 소통(Communication)

• Substantial  efficiency  of  communication– Can  often  be  achieved  by  relying  on  the  hearer  to  use  its  own  knowledge  to  help  determine  the  meaning  of  an  utterance.

– If  a  speaker  knows  that  a  hearer  can  figure  out  what  the  speaker  means,  then• The  speaker  can  send  shorter,  less  self-­‐contained    messages.

• One  of  the  main  reasons  why  it  is  so  difficult  for  computers  to  understand  natural  languages  is– NL  understanding  requires  many  sources  of  knowledge  including  knowledge  about  the  context.

제10강

Page 26: 제10강 소통하는 기계 - Seoul National University · 2018-05-28 · 언어, 사고, 소통 ©2018A ByoungLTak Zhang,SeoulANationalAUniversity 3! 언어" 소리,문자,기호,행동!

(C)  2000  SNU  CSE  Artificial  Intelligence  Lab  (SCAI) 26

문맥의역할

• If  the  hearer  and  speaker  share  the  same  context– Then  that  context  can  be  used  as  a  source  of  knowledge  in  determining  the  meaning  of  an  utterance.

– Use  of  context• Allows  the  language  to  have  pronouns.• Can  include  previous  communication.• Current  environment  situation.

– Ex)  “Block  A  is  clear  and  it  is  on  block  B.”• Hearer  can  under  stand  “it”  means  the  “block  A”  from  context.

– Ex)  “I  know  that  block  A  is  on  block  B”• The  hearer  can  understand  which  person  (or  machine)  the  word  “I”  refers  from  context  of  the  utterance.

제10강

Page 27: 제10강 소통하는 기계 - Seoul National University · 2018-05-28 · 언어, 사고, 소통 ©2018A ByoungLTak Zhang,SeoulANationalAUniversity 3! 언어" 소리,문자,기호,행동!

Reading   (Watching)  Assignments

©  2018   Byoung-­‐Tak Zhang,  Seoul  National  University 27

• Google’s  AI  Assistant  Can  Now  Make  Real  Phone  Calls,  2018.  (비디오)• SKYPE  Voice-­‐call  Translator  (Automatic),  2016. (비디오)• Real-­‐time  Skype  Traslator  by  Microsoft  Research,  2014 (비디오)• 'AI비서의실수'  아마존알렉사,  가족대화외부에잘못전송,연합뉴스,

2018.5.25 (신문기사)• AI계의반항아,  '테이'  16시간만에운영중단,더기어, 2016.3.28 (신문기사)

• Q:  위의비디오데모와신문기사를참조하여인간의언어를이해하는인공지능기술의현재수준을논하시오.기계가사람의말을보다완전히이해하기위해서는앞으로어떤연구가더진행되어야할것인가?

제10강