10.08.2015 Views

谢 炯 坤 中 国 科 学 技 术 大 学 多 智 能 体 系 统 实 验 室

第四章Kejia工程中的应用

第四章Kejia工程中的应用

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>谢</strong> <strong>炯</strong> <strong>坤</strong><strong>中</strong> <strong>国</strong> <strong>科</strong> <strong>学</strong> <strong>技</strong> <strong>术</strong> <strong>大</strong> <strong>学</strong><strong>多</strong> <strong>智</strong> <strong>能</strong> <strong>体</strong> <strong>系</strong> <strong>统</strong> <strong>实</strong> <strong>验</strong> <strong>室</strong>


Kejia 工 程 <strong>中</strong> 的 应 用• 组 织 结 构• NLP 模 块• parser• world• vocabulary• interpreter


Kejia 工 程 <strong>中</strong> 的 应 用• 组 织 结 构• NLP 模 块• parser• world• vocabulary• interpreter


组 织 结 构The green bottle is on the cupboard.Give it to Jim.NLPbottle(x0) green(x0) cupboard(x1) on(x0, x1)give(x2, x3, x0) Jim(x3) agent(x2)move(1)catch(13)affectmove(7)putdown(13)ASP 底 层 环 境loc(13, 1)loc(13, 0)loc(13, 7)WorldModelquery(1)query(13)query(7)query(16)sense


组 织 结 构• World Model <strong>中</strong> 的 世 界 描 述• tuple 1(attribute 1, attribute 2, …)tuple 2(…)…• 一 个 tuple 表 示 一 个 场 景 <strong>中</strong> 出 现 的 <strong>实</strong> <strong>体</strong>• attribute 表 示 <strong>实</strong> <strong>体</strong> 所 具 有 的 属 性 , 如 名 字 , 位 置 , 颜色 等


Kejia 工 程 <strong>中</strong> 的 应 用• 组 织 结 构• NLP 模 块• parser• world• vocabulary• interpreter


NLP 模 块The milk is on the table and give it to James.vocabularyparserStanfordParserinterpreterworld(information (milk x1)(on x1 x3)(table x3))(atask 1 (give x8 x1 x6)(milk x1)(James x6)(agent x8))


Kejia 工 程 <strong>中</strong> 的 应 用• 组 织 结 构• NLP 模 块• parser• world• vocabulary• interpreter


parser• 通 过 JNI 调 用 Stanford Parser• 将 Stanford Parser 生 成 的 结 果 , 翻 译 成 内 部 表 示Dependency TreeThe milk is on the table and give it to James.parserStanfordParser('is' VBZ(nsubj ('milk' NN(det ('the' DT))))(prep ('on' IN(pobj ('table' NN(det ('the' DT))))))(cc ('and' CC))(conj ('give' VBP(dobj ('it' PRP))(prep ('to' TO(pobj ('James' NNP)))))))


parseris/VBZmilk/NNnsubjon/INprepccand/CCconjgive/VBPdetpobjdobjprepthe/DTtable/NNit/PRPto/TOdetthe/DTpobjJames/NNP


Kejia 工 程 <strong>中</strong> 的 应 用• 组 织 结 构• NLP 模 块• parser• world• vocabulary• interpreter


worldworldimportconceptentity action ……obj_actionTHEME : entityput_actionTHEME : nonlivingTO_LOC : locationput_1THEME : food_4TO_LOC : table_2put_2THEME : food_3TO_LOC : table_2……


Kejia 工 程 <strong>中</strong> 的 应 用• 组 织 结 构• NLP 模 块• parser• world• vocabulary• interpreter


vocabularypath := dir {[‘/’dir]*} {‘/’role}dir := [node][category]c_edge := ‘~’CHILD_EDGE_NAMEp_edge := ‘..’[PARENT_EDGE_NAME]node := ‘!’NODE_NAMEcategory := ‘@’POS_TYPErole := ROLE_TYPE


Kejia 工 程 <strong>中</strong> 的 应 用• 组 织 结 构• NLP 模 块• parser• world• vocabulary• interpreter


interpreter• 解 释 过 程 :• 对 语 法 树 每 个 节 点 , 相 应 生 成 一 个 分 析 节 点 A• 对 A 的 所 有 子 节 点 先 进 行 解 释 , 令 每 个 子 节 点 得 到 一 个 语 义 <strong>实</strong> 例• 查 找 词 典 , 找 出 A 对 应 的 单 词 的 所 有 语 义 词 条• 对 每 个 词 条 <strong>中</strong> 所 有 的 论 旨 角 色 赋 值 ( 通 过 词 条 定 义 的 规 则 找 到 论 旨角 色 的 <strong>实</strong> 例 ), 赋 值 都 没 冲 突 , 则 该 词 条 <strong>中</strong> 的 语 义 为 单 词 的 语 义• 代 词 处 理 :• 每 次 解 释 过 后 都 会 保 存 分 析 出 来 的 分 析 树 , 查 找 之 前 的 分 析 节 点 ,进 行 类 型 选 择 ( 如 果 是 代 词 it, 则 滤 掉 不 属 于 ”smallobj” 类 型 的 <strong>实</strong> <strong>体</strong> )• 产 生 ASP 所 需 的 逻 辑 表 达 式 :• 每 个 分 析 节 点 使 用 词 条 <strong>中</strong> 的 predgen 规 则 生 成 相 应 的 逻 辑 表 达 式

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!