如果用户的一个查询包含属于不同类别的多个问题,如何识别、分割和解析它们?
例如 –
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 $300 but not less than $200 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 $300 but not less than $200", "pet friendly have a gym and a pool", "with 3 or 4 stars", "staying for 2 nights", "with wifi"]}
解析器识别出仅属于一个类别的提问,但有额外的步骤来微调答案,并创建了一个按照步骤顺序排列的数组
据我所知,这需要句子分割器、多标签分类器和共指解析
但我所遇到的句子分割器在很大程度上依赖于语法和标点符号。
多标签分类器,如经过良好训练的朴素贝叶斯分类器在大多数情况下都能工作,但由于它们是多标签的,大多数时候会为明显属于一个类别的句子输出多个类别。仅依赖数组输出来检查存在的标签将会失败。
如果使用多类别分类器,这也可以很好地检查可能类别的数组输出,但显然它们并不能准确地告诉句子的不同部分,更不用说以何种方式进行下一步操作了。
作为第一步,我如何调整句子分割器以在没有严格语法规则的情况下正确分割句子? 这方面的良好准确性将对分类大有帮助。
回答:
作为第一步,我如何调整句子分割器以在没有严格语法规则的情况下正确分割句子?
我建议你直接使用解析树(无论是依存解析还是成分解析),而不是这样做。
这里我展示了依存解析的输出,你可以看到两个部分通过“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