NLP 解析单个查询中包含的多个问题

NLP parsing multiple questions contained in one single query

如果用户的单个查询包含属于不同类别的多个问题,如何识别、拆分和解析它们?

例如 -

User - what is the weather now and tell me my next meeting  
Parser - {:weather => "what is the weather", :schedule => "tell me my next meeting"}  

解析器识别问题属于两个不同类别的句子部分

User - show me hotels in san francisco for tomorrow that are less than 0 but not less than 0 are pet friendly have a gym and a pool with 3 or 4 stars staying for 2 nights and dont include anything that doesnt have wifi  
Parser - {:hotels => ["show me hotels in san francisco",  
          "for tomorrow", "less than 0 but not less than 0",
          "pet friendly have a gym and a pool",
          "with 3 or 4 stars", "staying for 2 nights", "with wifi"]}

解析器识别出只属于一个类别的问题,但有额外的步骤来微调答案,并创建了一个根据要采取的步骤排序的数组

据我所知,这需要一个 句子分割器 多标签 classifier共同参考分辨率

但我遇到的句子分割器严重依赖语法、标点符号。

多标签 classifiers,就像训练有素的朴素贝叶斯 classifier 在大多数情况下都有效,但由于它们是多标签的,大多数times 为明显属于一个 class 的句子输出多个类别。仅依靠数组输出来检查存在的标签会失败。

如果使用 multi-class classifier,这也可以很好地检查可能类别的数组输出,但显然它们不能准确地告诉句子的不同部分,更不用说以何种方式进行下一步。

作为第一步,我如何调整句子分割器以在没有任何严格的语法规则的情况下正确地分割句子。 良好的准确性将对 class化.

如果您想要 segmentation 不严重依赖语法的东西,那么 chunking 就会浮现在脑海中。 NLTK书中有a fragment on that。作者在这里采用的方法仅取决于词性标签。

顺便说一下,Jurafsky 和 ​​Martin 的 Speech and Language processing 第 3 版在解析章节中包含有关分块的信息,并且还包含有关信息检索和聊天机器人的章节。

As a first step, how can I tune sentence segmenter to correctly split the sentence without any strict grammar rules.

我建议您直接使用解析树(依赖解析器或选区解析)而不是这样做。

这里我展示了依赖解析的输出,你可以看到这两个部分通过 "CONJ" 箭头分开:

(来自这里:http://deagol.cs.illinois.edu:8080/

我尝试的另一个解决方案是 ClausIE: https://gate.d5.mpi-inf.mpg.de/ClausIEGate/ClausIEGate?inputtext=what+is+the+weather+now+and+tell+me+my+next+meeting++&processCcAllVerbs=true&processCcNonVerbs=true&type=true&go=Extract