科学网

 找回密码
  注册
科学网 标签 NLU

tag 标签: NLU

相关帖子

版块 作者 回复/查看 最后发表

没有相关内容

相关日志

《立委科普:语音交互时代是NLP的历史机遇》
热度 1 liwei999 2019-4-9 23:06
立委按:本文图片或视频如果有问题,请直接去我的NLP频道阅读: https://liweinlp.com/?p=5254 越来越喜欢语音交互 这两天玩 Siri,Google Assistant,感觉还是搜索公司做语音交互更有前景。 为什么?因为搜索公司的知识源积累雄厚,不是其他 players 可比(不知道百度是不是以自己的积累优势 推出啥 assistant)。这是问题的一面,搜索公司做交互从回答开放问题方面,有天然优势。问题的另一面是,从问题解析角度看,搜索公司传统的优势不再。这给社交媒体公司和NLP创业公司留下了机会。以前做文本NLP,虽然可以 argue NLP 赋能的SVO搜索,可以大大提高关键词搜索的精准,但总体上感觉NLP想进入搜索,是针插不进的。 白老师说:这是商业模式问题。关键词作为标的,太成熟。 商业模式之外,还有个重要原因。很多年来,受众都被搜索公司潜移默化了,通过query log 可知,搜索框里面的 queries 绝大多数不是“人话”,就是几个关键词,而且搜索的人,越来越不管语言的词序与小词,因为经验教训都是词序和小词没用。这就使得NLP失去了合适的对象,优势发挥不出来。这边厢 关键词技术以鲁棒和长尾见长,NLP 真地是难以实现价值。可是,语音交互时代不同了,人开始越来越多学会直接跟机器对话,这时候,自然语言回归“自然”,被搜索公司洗脑的坏习惯 在语音交互中难以持续。 这给了 NLP 以机会。 以前老觉得NLP做文本比较成熟,来了语音转文字,多了层损耗。可现在语音技术成熟了,这点损耗不算啥。考察现有的交互系统,卡壳的地方多出现在 NLP 而不是语音转文字方面。 看目前 Siri 的水平,相当不错了,蛮impressed,毕竟是 Siri 第一次把自然语言对话推送到千千万万客户的手中,虽然有很多噱头,很多人拿它当玩具,毕竟有终端客户的大面积使用和反馈的积累。尽管如此,后出来的 Google Assistant 却感觉只在其上不在其下,由于搜索统治天下20年的雄厚积累,开放类知识问答更是强项。 最近测试 Google Assistant 的笔记如下。可以说,道路是曲折的,前途是光明的。 对于相同的刺激 回答不同 感觉是随机在同义词话术中挑选。 哈 nlp 卡壳了。搜索公司的backoff法宝就是搜索,卡壳了 就改成搜索结果。 卡壳以后 退到搜索以后 搜索结果有个质量控制,可能的结果做了排序。如果觉得搜索质量不高 或找到其他痕迹发现问题不适合做搜索。就用话术装傻:My appologies ... I don't understand(对不起 先生 我没听懂)。所谓“话术”,人工智能历史上被称为“巧妙的欺骗”(artful deception,见《Church: 钟摆摆得太远 》)。这种欺骗是实用系统的永不过时的法宝之一。 thankful 的表述今天没听懂 但迟早会通过 bug 积累反馈过程 被听懂的 所以只要系统持续维护 机器对于日常会话 就会越来越应答自如 这一点没有疑问。语音交互虽然不像AI泡沫期望的那样立马改变我们的生活 但人机语音交互越来越渗透到我们和我们下一代的生活中 是一个自然而然 不可逆转的趋势。 知识问答 特别是开放类新闻查询 搜索的拿手好戏 这种搜索回应 不是退而求其次的后备应答 而是首选的答案。 所有话术都那么具有可爱的欺骗性,until 最后一句,莫名其妙回应说 this isn't supported. 这就是胡乱来了。测试下来 发现句子一长 系统就犯糊涂。10个词以上就进入深水区,常常驴唇不对马嘴。 可是 即便后备到搜索 也不至于如此不堪啊 一点 smoothing 都感觉不到 整个一个白痴。再一想,估计是我原话中提到 long sentence 它给我找来一个讲 grammar writing 的博客。 所谓语音门户之战,看样子是个拉锯战,可能是持久战。呈两极三角态势。一极是搜索巨头,谷歌、百度,手里有海量知识和答案。另一极是社媒或零售巨头,离用户近,腾讯、脸书、苹果、亚马逊等。他们可以把端口部署到千家万户去。这两极各有优势,可以长期对抗下去。三角方面,似乎还有一个角,是给NLP技术或创业公司留着的。谁知道呢,也许在用户和知识源都不具备优势的时候,技术型公司会以NLP的亮丽表现异军突起,帮助或联合其中一极成就霸业,也未可知。 haha LOL,简单即王道。 王道是要有出口。上面的乱套是系统设计的毛病,不是AI自身的问题。 又看了一遍上列“简单为王”的反AI宣传片,又笑了半天。前后两个问题,其实是两种解决方案:前一个是产品层面的。产品设计需要有个 accessibility 的机制。当主人因故说不出话或说不清话的时候,应该有个类似为残疾人准备的后备机制。这方面苹果 iPhone 做得很好,它的 accessibility features 非常丰富 考虑到很多场景和小众残疾或不残疾的另类用户。第二个问题的解决方案是技术性的,机器人应该识别主人的声音,默认只听主人的指令。从产品层面看,起码应该是个可以 configure 的选项,不应该听到声音就去执行。 总结一下自动解析所依据的语言形式是什么。主要是三种: 1. 语序 2. 直接量(尤其是小词和形态) 3. 特征 前两种叫显性形式,特征是隐性形式。语言形式这么一分,自然语言一下子就豁然开朗了。管它什么语言,不外乎是这三种形式的交错使用,比例搭配和倚重不同而已。所谓文法,也不外是用这三种形式对语言现象及其背后的结构做描述而已。 摘自《自然语言答问》(to be published) 被搜索巨头20年潜意识引导/洗脑,人上网搜索的 query,第一不讲究语序,第二扔掉了小词(知道小词是 stop words 基本上被关键词索引忽略 有它无它不 make difference)。这就使得 query 其实不是自然语言,不过是一小袋词的堆积。作为显性语言形式,小词和词序很重要,因为自然语言很大程度上依赖语序和小词这样的语言形式,来表达句法结构和逻辑语义。这么一来,query 不是自然语言技术施展的合适对象。 在不知不觉就会到来的语音交互时代,query 被语音的 question 所取代,自然语言复归“自然”,这就为NLP/NLU发挥作用,创造了条件。人会不会把上网用的 query 坏习惯带到语音交互的现场呢?考察语音交互现场,可以发现,基本上人机对话的时候,有意识背离自然语言规范的做法,是很少见的。人说话虽然并不总是特别规范,但是从学会说话的时候就开始积累的语言习惯是难以人为改变的。至少不会像 query 那样“变态”和偏离自然语言。 这是NLP的福音。 回顾一下,历史上看NLP走出实验室的落地历程,大多是遇到特殊的机遇。第一个机遇是信息抽取(IE)。在IE诞生之前,NLP面对大海一样的语言,漫无目标,是 IE 让 NLP 瞄准实际的领域需求,预定义一个狭窄的清晰定义的情报抽取范围和种类。第二个机遇是大数据,不完美的NLP技术遇到了大数据,使得信息的大量冗余弥补了引擎质量的不足。第三个机遇深度学习,仍在进行时,现在看来海量语料的预训练可以帮助模型捕捉千变万化的语言表达方式。第四个机遇就是移动时代和物联网的到来,这使得语音交互开始渗透到人类生活的方方面面,反过来促进了NLP技术充分发挥其潜力。 有意思的是,与其说搜索巨头用一个小小的搜索框“教育”或误导了用户的查询习惯,不如说是用户在不断的搜索实践中适应了关键词技术。其结果就是那不伦不类的搜索 queries 的出现和流行。既然用户会通过正向反向的结果反馈,来慢慢适应关键词搜索不懂自然语言的短板,可以预见,用户也会慢慢适应不完美的自然语言语音交互。 怎么讲? 如果同一个问题有100个问法,其中80个问法是清晰无误的,20个是有歧义的,用户会慢慢学会回避有歧义的问法,或在第一轮被误解以后,会迅速返回到更加清晰的80种问法范围来。如果这 80 种问法,机器只涵盖了 60 种比较常见的,久而久之会出现这样的情形:一方面,只要机器还在持续维护和bug fix 的反馈回路上,所涵盖的边界会慢慢扩大,从 60 往上走。另一方面,用户也会学乖,慢慢倾向于越来越多使用更加常用的,已经被反复证实的那些问法中去,回到 60 的边界内。除了恶作剧,没人存心为难自己的助手,毕竟交互的目的是为达成目标。这样来看不完美的NLP技术,面对真实世界的场景,我们是有理由乐观的。 所有的软件系统,一个最大的好处就是可以确定地说,明天更美好。除非是非良定义或设计,同时开发维护过程也是非良的操作规程,软件的质量永远是上升的,最多是爬升趋于缓慢而已。因此,今天我们取笑的交互实例,我们为机器的愚蠢所困扰的方方面面,明天后天一定会逐步改良。 唯一感到有些可惜的是,语言工程本来是一个打磨数据的过程,很多工作应该可以共享的,避免重复劳动。但实际上,这种重复劳动还在大面积进行中,而且很长时间内,也看不到资源共享的理想平台、机制和架构,虽然预训练的资源共享看上去是在这个方向上迈进了一步,但有效利用第三方的预训练资源,帮助落地到本地产品和场景,依然是一个挑战。 【相关】 《Church: 钟摆摆得太远 》 《一日一析系列》 【语义计算:李白对话录系列】 【置顶:立委NLP博文一览】 《朝华午拾》总目录
个人分类: 立委科普|5806 次阅读|1 个评论
Critique of Chomsky\'s Formal Language Theory
liwei999 2018-11-25 18:18
Q: Lao Li, I have been paying close attention to your academic track. I deeply admire you for more than 30 years' in-depth study of symbolic logic in the field of natural language understanding with your uniqueinnovation. On your NLP Channel, I notice that you've been critical of Chomsky. Chomsky is the representative figure of the rationalist school. Like many others, I admire Chomsky. As far as I know, you are also a rationalist. So why do you, as a linguist who practices rationalism, criticize Chomsky? A: First of all, although I have criticized Chomsky, pointing out his theoretical issues and objective misguidance in the field, these are criticisms within the school. There is no doubt that Chomsky is the father of computational linguistics and the banner of rationalism in the field of artificial intelligence. His theory of formal language is the cornerstone of computational linguistics. All of us computational grammarians, as practitioners of the symbolic logic of rationalism in language, are his disciples. When we criticize him, we still use his formal mechanism as the frame of reference. From the perspective of language formalization, Chomsky, who has a deep mathematical background, brings mathematical rigor into the formal study of language. At least in terms of formalism, Chomsky unified human language with computer language to have achieved a highly abstract symbolic system no others could dream of reaching. Without Chomsky's formal language theory, computer science could not develop high-level languages, and all the achievements of the information industry would be unimaginable. On the other hand, it can be said that Chomsky's negative impact on the field is as big as his revolutionary contribution to linguistics and computer science. His formal language hierarchy is a theory of pure genius, which lays the foundation of language formalization. This formalism has become the theoretical basis of computer high-level languages and their compiling algorithms. It is used at its best to create, parse and compile computer languages as a perfect guide. However, perfection is sometimes only one step from fallacy. Chomsky criticizes the finite state machine as not suitable for modeling natural languages due to a lack of recursion mechanism. Too many people are misguided and fall into the so-called more powerful context-free mechanism. Such an intelligent and powerful figure, if he misleads, can impact an entire generation. The generation that was affected was my direct supervisors and predecessors when I entered this field (in the 1970s and 1980s), their work in natural language understanding was almost exclusively toy system confined to labs, difficult to scale up and demonstrate in practical applications. This directly led to the rebellion of the next generation. This is the piece of history in artificial intelligence, the famous competition between rationalist symbolic school and empirical statistical school, with long struggles between the two paths. The rationalists of the old generation were at a disadvantage in competition and gradually withdrew from the mainstream stage. All the advance of the statistical school over the last 30 years has been a practical critique of Chomskybecause almost all of these models are based on finite state models, which he repeatedly criticized as inappropriate for natural language. The context-free grammar he advocates has achieved limited success in the field of natural language. Q: Now that everyone is advocating neural networks and machine learning, is there still room for the symbolic rule school? Rationalism has lost its voice and visibility in the natural language community. What do you think of the history and current situation of the two? A: Well, machine learning has been on the rise in natural language processing since about 30 years ago, with the rapid development of data and computing resources. Especially in recent years, deep neural networks have achieved breakthrough successes in learning. The success of empiricism, in addition to the innovation in neural network algorithms, also benefits from the availability of unimaginably big data and big computing power today. In contrast, the rationalist school of symbolic logic,due to its implacability, gradually withdrew from the mainstream stage of the academia after a brief upsurge of phrase structure grammars with innovation based on unification about 20 years ago. There are several reasons for this situation, including Chomsky's long-term negative influence on computational grammars, which deserves serious reflection. Looking back at the history of artificial intelligence and natural language, the pendulum of empiricism and rationalism has swung back and forward, but the pendulum of empiricism has been on the rise for the last 30 years (see the red dot in figure 1). In his article Pendulum Swung Too Far, Professor Church predicted and called for the resurgence of rationalism and presented an illustration below: At present, due to the breakthrough of deep learning, empiricism is still in the limelight. Although rationalism has been accumulating efforts by itself for many years, it has not yet reached the tipping point where it can compete, head-on, with empiricism. When one school becomes mainstream, the other naturally fades out of sight. Q: I have a feeling that there is some confusion in the community and outside the community at large. Deep learning, which is a method of empiricism, now seems to be regarded by many people as equivalent to artificial intelligence and natural language processing. If the revolution in deep learning sweeps through all aspects of artificial intelligence, will it end the pendulum swing of rationalism? As professor Church says, the pendulum of empiricism has swung too far, but it looks far from falling back. A: My definite answer is no. These are two different philosophical bases and methodologies, each with its own natural advantages and disadvantages. Although there are reasons for the status quo of the existing one-sided empiricism in the current academic world, it is not a healthy state. In fact, both schools are competitive on one hand and also highly complementary on the other hand. Some older generationmainstream pioneers like Church have been warning about the disadvantages of one-sidedness in empiricism, and some new scholars in deep learning have been exploring the integration of the two methodologies to solve the problems of natural language. Yes, much of the current surge in AI is based on breakthrough performance from deep learning, especially in the areas of image recognition, speech processing as well as machine translation, where AI systems have reached or exceeded human quality. This is an unprecedented amazing achievement indeed. However, the fundamental limitation still exists with deep learning, as well as all the other successful empirical methods at present, that is, the dependence on massive annotated data, what we call the knowledge bottleneck. The reality is that in many fields and application scenarios, such as natural language parsing, machine translation of e-commerce data, data of massive annotation or domain translation do not exist. This knowledge bottleneck severely limits the performance of the empiricist school in natural language understanding and other fine-grained cognitive tasks. There is simply not enough annotated data in many sub-fields, and without, it is almost impossible to make bricks without straw for learning. This is especially true for deep learning, which has a much larger appetite, like insatiable, than traditional machine learning. Q: So it seems that deep learning is not an all cure. Rationalism has its place. You said the two schools have respective strengths and weaknesses. Can you compare and contrast them? Why are they complementary? A: Let me summarise the merits and demerits of the two for a serious contrast. The advantages of empirical statistical models include: (1) good at coarse-grained tasks, typically, document classification, for such tasks, statistical learning is naturally better to draw the overall conclusion; (2) robustness; (3) high recall: due to the lack of structures and understanding, many tasks might face a ceiling for accuracy, but recall-wise,learning usually performs well; (4) development efficiency: it can quickly scale to a real application scenario of big data. The main limitations of the statistical school are: (1) the dependence on massive annotated data: this is the biggest knowledge bottleneck; (2) it is difficult to make targeted debugging: the statistical system is more like a black box, a big defect for maintenance and iterative incremental enhancement of a software system; (3) lack of interpretability: whether the result is right or wrong, it is difficult to explain, which affects the user experience and confidence. The main reason is the lack of explicit structural representation and symbolic logic in the algorithm that people can follow. The rationalist approach simulates human cognitive processes without relying on massive labeling data to imitate on the surface strings. Rationalism directly formalizes the experience of domain experts and uses the explicit rule system from symbolic logic to simulate human intelligence tasks. In terms of natural language understanding, the grammar school formalizes the rules summarized by linguists so as to parse natural language in detail at all levels and achieve deep syntactic-semantic analysis. In this respect, rationalism has its natural advantages. To sum up, the advantages of rationalist rule-based school include: (1) good at tasks of fine-grained tasks: very detailed analysis, such as the deep parsing of syntactic semantics with logical reasoning; (2) accuracy: the rule system written by experts is easy to guarantee high accuracy, but the improvement of recall is usually a long iterative process; (3) debuggablein error correction: the basis of the rule system is symbolic logic, which is easier to trace to the root of the error in debugging; (4) interpretable: this also benefits from the understandable symbolic logic basis. The main defect of the rule school is the low efficiency of manual coding, and the dependence on expert coding is the knowledge bottleneck of the rule school. Supported by the same platform and mechanism, different levels of expertise determine different levels of quality. The two paths have their own knowledge bottlenecks, so to speak. One is to rely on a large quantity of low-level labor, labeling, though very monotonous, is work that can be assigned to ordinary students with a little training. The other is to rely on a few experts of high-level labor, much like software engineering, for coding and debugging rules, the knowledge engineer training costs are high, making it more difficult to scale up to the real world. Finally, the talent gap can also be regarded as a realistic severe limitation of the rationalist school. 30 years is exactly one generation, during which empiricism has occupied the mainstream stage, and attracted almost all newcomers, causing a generation shortage of talents in the rationalist camp. As forthe recall, it cannot be simply concluded that high precision is bound to have a low recall rate for rule systems. The actual situation is that, on the one hand, it is not at all difficult to achieve a balance between precision and recall, by deliberately relaxing rule conditions and sacrificing accuracy. On the other hand, while high precision can also be maintained, the more rules added to the system, the more phenomena will be captured, hence the recall rate will come up naturally and incrementally in the iterations as time moves on. In other words, recall is a function of time and development resources put in, without having to compromise precision. Q: Since each has its own strengths, as the rationalist pioneer and father of computational linguistics, why doesn't Chomsky exert its due influence in the field of natural language processing? His impact has been waning, and the newcomers to the field hardly hear ofhim. A: Indeed it is. Although I am a rationalist, I also see that there is a considerable historical burden from this school that needs to be seriously reflected on from the perspective of formalism architecture. Chomsky is the founder of modern rationalism, but the theory and practice he developed also involve some misconceptions. We must recognize these so that we can move forward the linguistic rationalism in symbolic logic steadily and deeply for natural language. In fact, after decades of theoretical exploration and practical experiments, the grammar school has seen fairly clearly its own theoretical limitations. Those who stick to the symbolic rule systems have broken through the path of innovation in the inheritance of rationalism, and have made their own breakthrough in deep parsing, the very core of natural language understanding, and in its scale up to big data for real-life information extraction and text mining applications. That's what we're going to focus on in this series of interviews. Q: I know you have great faith in rationalist symbolic approaches in general. However, you have also seen a number of misconceptions in Chomsky's theories. which are the most critical? A: On his formal language theory, there are two fallacies to my mind, one I would name Recursion Fallacy and the other Monolayer Fallacy. On his linguistics theories,one of the very basic propositions in his linguistic revolution is syntactic autonomy or self-contained syntax. It involves serious potential consequences in the analysis of certain languages such as Chinese. His phrase structure grammar tree represenation with his X-bar theory in syntax is also worthy of reflection and criticism, especially when it is put in the comparative study with the alternative dependency grammar and its representations for NLU. Let's look at Recursion Fallacy first. In my view, Chomsky's greatest mislead was to use the so-called recursion nature of natural language to criticize pattern matching in finite states. His cited English examples of center recursion are far-fetched and rare from real life, making it difficult to argue for its being the nature of natural language. Nevertheless, a generation still chose to believe in his theory, taking it for granted that finite states had to be abandoned in order to be able to parse natural language. Q: Isn't it generally accepted that natural language is recursive? How to say it is a fallacy? A: Exactly because it is widely accepted, it is of the more misleading nature and consequences, hence requiring more serious critique. Recursion in natural languages typically comes in two types: (i) right (branching) recursion and (ii) center recursion. Many people don't consciously make that distinction, but in computational theory, they are two very different things. Right recursion is linear by nature while center recursion is nonlinear, a completely different monster, of much more computational complexity. In natural languages, right recursion is fairly common and can at times be as many as seven or eight levels nested, which still reads natural and easily comprehensible. For example, the VP nesting example: (to request A (to beg B (to ask C (to do something)))) For right branching recursive structures, we usually do not feel a burden in the communication. The reason is that, although the right recursive left boundary is in an uncertain position, they all end at the same poin for the right boundary, like this: (... (... (... (... (...... ))))). Thus, we do not need a stack mechanism in memory to deal with it, it remains finite-state. Chomsky cannot criticize finite-state devices with right recursion, so he needs to base his argument on center-recursion, a rarity in language. The fact is that natural languages have little manifestation of center recursion. Center recursion is much like matching parentheses. You want the parentheses to match each other so you can express and understand the proper nesting structures, like this: { ... ... }. After as many as three levels of center recursion, our brain can no longer cope with the pairing complexity, which is why it's hard to fine such phenomena in real life language data. Q: I remember some examples of center recursion in English: The man who the woman who had lost all the keys was calling all day finally came... A: Is this human language? Chomsky repeatedly attempt to teach us that not only this is human speech, but it is the very nature of human language, hardly any hypotheses about language as far-fetched as this to my mind. Q: Let me try to understand what you mean: center recursion does not exist, or does not exist over three levels, so natural language is finite-state? A: Well, not that it does not exist, it's so rare and far-fetched, and it's never more than three levels deepunless you're pulling a prank. Therefore, it can by no means be the nature of natural language. The very idea of unbounded center recursion in language, far from the observable facts, in effect violates the limits set by the short-term memory following psychology. Where in the world do people talk like that, like, keep opening the doors without closing them behind, in a maze-like complex castle, with nested sub-structures after substructures? A path of 3 doors opened, anaverage person will get lost in the maze. Even if you're a super linguist, and you can stand it, your audience will be bound to be trapped. Is natural language not to communicate, but deliberately making difficult for people to follow you? This is not in accordance with the consensus that language is born for communication and serves the ultimate purpose of communication. Using pranks and verbal games as evidence of linguistic competence and the nature of language is one of the most misleading aspects of Chomsky's recursion theory. This recursion trap leads many people to automatically accept that natural language is recursive and therefore we must discard the idea of finite states. The people who believe in him, on the one hand, are influenced by his authority as the father of modern linguistics; on the other hand, they often mis-regard the more common and deeper right recursion for center recursion as evidence in support of Chomsky's recursion hypothesis. Chomsky himself is intelligent and rigorous as not to use readily available right recursion as evidence, he only uses center recursion as an argument. But he's in effect misleading. Q: I guess this is a typical behavior of mathematicians and philosophers: they pursue formal perfection. As long as it is theoretically impossible to exclude multi-level center recursion, it is required that the formal mechanism must have a built-in recursion mechanism. But practitioners of natural language understanding do not have to be bound by that theory, do they? A: after all, the foothold of the theory should be based on the real-life natural language object and data, right? In fact, in the research of corpus linguistics, some scholars have conducted a very extensive survey and found that the so-called center recursion in natural language never exceeds three levels, and the occurrence of three-level recursion is extremely rare . The phenomenon of natural center recursion beyond three levels is simplynot found in avery large running corpus, not a single case found. So why boil a very limited center loop down to what seems like an infinite level of recursion, and furthermore consider it the essence of natural language, and use it as an argument to determine the choice of the formal model for natural languages? This has had serious consequences for computing and NLU going beyond labs for applications. In order to deal with theoretically infinite center recursion, the human brain, or computer memory, must have a stack device and a backtracking algorithm. Without going into the technical definitions of these computer terms, computer science studies have demonstrated that stack-based backtracking is expensive for computation. Using it as a basic device for natural language severely impedes language parsing from leaving the laboratory. Specifically, Chomsky's context-free grammar with built-in recursive devices is theoretically bound not to have corresponding linear speed algorithms. The absence of linear algorithms means that the computing time is beyond control, so when entering big data out of the lab, this kind of thing is one limiting factor in practice. This is one of its fundamental flaws in his formal language arguments for natural language. Q: I agree with you: there are only very limited levels, we don't have to stick to recursive grammars. But I still have a question. Short-term memory is a psychological concept, and most of us in computational linguistics believe that psychology has no place in linguistics. Don't you agree? A: I don't agree. The limitations of psychology have a direct effect on real linguistic phenomena, that is, psychological effects are reflected in linguistic phenomena. Real language phenomena, not imaginary phenomena, are the goal and final foothold of our natural language study. What we're dealing with is a data set with a psychological constraint, and it's obviously not appropriate for us to adopt a mechanism to deal with it based on a hypothesis that disregards psychological constraint. Q: But even with the addition of psychological restrictions, don't real corpora still have recursion? If yes, without the formal recursion device, such as the finite state machine, how can it handle the actual existence of the center recursive structure as long as it is not a non-existence? A: Not a problem at all. As long as the recursive structure is bounded, the finite states have no problem in dealing with it. All we need is just cascade a few more finite state machines. Since you have at most three levels of center recursion, then it is 3 machines with 3x time needed, which is still linear. Even 10-level center recursion is not a thing, just add up 10 finite state automata. In our deep parsing practice, we have once applied up to 100 cascaded finite state machines for very deep parsing, in high efficiency. This kind of finite state pipeline systems, often called cascaded FSAs, is essentially the same concept of the pipeline as used in software engineering. Q: Chomsky Hierarchy, named after Chomsky, is the most famous discovery in Chomsky's formal language theory, which divides grammars into four types, type 0 to type 3, corresponding to different automata. What do you think of his hierarchy? A: Chomsky's formal language hierarchy is like a hierarchical castle with four enclosing walls safeguarding inner cities. Each formal device is like an internal forbidden city. Here we particularly recommend and quote an insightful study of Chomsky Hierarchy by Prof. Bai, which I call a caterpillar theory of natural language ( S. Bai: Natural Language Caterpillar Breaks through Chomsky's Castle ): If we agree that everything in parsing should be based on real-life natural language as the starting point and the ultimate landing point, it should be easy to see that the outward limited breakthrough and the inward massive compression should be the two sides of a coin. We want to strive for a formalism that balances both sides. In other words, our ideal natural language parsing formalism should look like a linguistic caterpillar breaking through the Chomsky walls in his castle, illustrated below: Prof. Bai also clearly sees that Chomsky's recursion theory is too far away from linguistic facts, so he puts special emphasis on real-life natural language. After all, formal systems serve as formalized models for natural language, that is, they need to provide an appropriate framework for what natural language looks like. The common answer shared by Prof. Bai and me is that a suitable natural language model needs to get through the walls inside the Chomsky Castle. Any single device in Chomsky's existing formalisms, when used to model natural language, is either too small to fit, or too large lacking appropriate restrictions. In both theory and practice, it is necessary to penetrate the walls of Chomsky Castle and form an innovative formal system, so as to lay a good foundation for the revival of grammars in natural language modeling. In the formalization process of penetrating the walls, Mr. Bai has his own innovation, and I have mine. My proposition is to extend and overlay the finite-state mechanism, so as to establish a shallow and deep multi-layer rule system for natural language deep parsing and understanding. Do not look down upon finite state machines, which seem to be a very simple mechanism for pattern matching. When they are added layer by layer in the architecture of a reasonable pipeline system, they can cope with very complicated structures and phenomena and reach the depth of language parsing that is never before made possible by traditional context-free grammars or other devices. Of course, the mechanism itself can be reinvented and recrafted, such as incorporating the unification operation in handling language reduplications, e.g. in Chinese, 看一看: V 一 V (literally look-one-look: take a look). There are also rules for pattern matching that can effectively eliminate ambiguities by adding post-context conditions, similar to the look ahead effect in backtracking algorithms, to the pattern matching device. It is worth emphasizing that maintaining thelinear nature is the premise of any formalism innovation. No matter how we extend the mechanism of finite-state devices, this one remains an unchanged goal, that it must retain the essential characteristics of finite state to ensure the line speed. We use a multilayer cascade to bypass the recursion trap, hence eliminating the biggest hidden trouble that hinders linear speed. Since the linear multiplication remains linear, the cascaded finite state system does not change the linear benefit of the system. Computationally, the processing speed required for three-layer recursion is only 3x, which will not affect the scalability potential of the system. In fact, we have deployed multi-layer systems, usually with more than 50 layers. Our Chinese system sometimes cascades up to 100 layers in the architecture, where capturing recursive structures is just a relatively simple task inside. Q: That's fascinating. And very imaginative, too. It is apparent that you and Prof. Bai have both accumulated years of practice and deep dive into natural language so you two have such insights as summarised above in breaking through the internal walls of the Chomsky Castle. Ok, so the first issue with Chomsky formal language theory is the recursion fallacy, what's the second fallacy? A: The second major problem with the Chomsky formal language theory is briefly mentioned above, which I call Single-layer Fallacy. Turn to the chapter on parsing in the computational linguistics textbook, the typical algorithm for parsing, known as chart-parsing, is often introduced on the formalism of a context-free grammar (CFG). CFG contains recursive calls in its rules for covering recursive structures, a point emphasized by Chomsky as the key feature for natural language. The implementation of this rule system is carried out in the same search space on the same plane, thus the so-called chart-parsing can be illustrated on a flat chart. Successful parsing is represented by one or n search paths that cover the entire sentence. The essence of single-layer parsing is like cooking a hodgepodge. Everything in an input string, from morpheme to word, from word to phrase, fromphrase to clause, fromclause to a complex sentence, all are carried out in the same space. Q: So Chomsky wants to solve everything at once. Isn't that good? A: Problem is, there are three main disadvantages. First, there is no linear algorithm. Many people have tried, but they just can't find a linear algorithm, it's a combinatorial explosion. The second disadvantage is that it is not suitable for modular development, because the surface or shallow level language phenomena and the deep language structures are all mixed on one plane. The third disadvantage is the so-called pseudo-ambiguity issue. Pseudo ambiguity is in contrast to true ambiguity. If there is one true ambiguity in the input sentence, the correct identification is for the parser to produce two parses to express the ambiguity. Pseudo-ambiguity means that a sentence is not ambiguous in people's understanding, but the parser still outputs several parses, which areall considered to be grammatical. The problem of pseudo-ambiguity is a recognized challenge in single-layer parsers. Even for a simple sentence, traditional parsers based on context-free grammars often produce dozens or even hundreds of parses. Most of the time, the differences are so subtle that they don't make difference in communication. The consequence is that very few true ambiguities are hidden among many false ambiguities. In effect, the parser loses the ability to parse ambiguity completely. Of course, such a single-layer grammar approach is difficult to be truly deployed in parsing and semantic decoding of big data. Q: Lao li, I think I have now started understanding the drawbacks of the single-layer parsers you discussed. Could you elaborate on why it is not a feasiblemodel for real-life applications? A: Too big a search space, and too many parses. In essence, the system makes explicit all possibilities, low probability events as well as high probability events all in the same search space,. The whole idea is that it makes sense in theory, that any small possibility is a possibility, and then from a perfect theoretical model, you can't block any path in advance. This way, you have to save all the search paths until the global path is complete. And this leads to the fact that the space where the resolution is, in fact, a combinatorial explosion space, so there's no efficient corresponding algorithm. Q: why isn't a single layer suitable for modularity? A: there is no modularity at all in a single layer. The approach of a single layer means that the whole resolution is a module, and a single layer means non-modularity. Its theoretical basis also has some truth. It says that language phenomena are interdependent, and a complete language analysis scheme cannot completely separate them. As low as participles and as low as the boundaries of basic phrases, these shallow structures are difficult to determine outside the overall structure of the sentence. This is because a locally sound structure can always be overridden in a larger context. (for instance, illustration) From this interdependent, locally subordinated global perspective, structural analysis, once cut up, creates a chicken-and-egg problem. To deal with this problem of interdependency, theoretically, a single-layer model makes sense. In a single-layer system, all the interdependent phenomena are explored in the same plane according to the global paths as solutions. That forms, of course, an argument against multiple layers, that language phenomena are interrelated, so we can hardly treat them by first cutting them into multiple layers. Interdependency in a modular pipeline is very susceptible to premature pruning of branches. To be honest, if we leave aside the pseudo-ambiguity problem and the non-linear speed from thesingle-layer system design for a moment, it is quite difficult to refute the above argument against themulti-layer system design. However, single-layer is not very feasible in practice. The consequences of a single layer far outweigh the benefits, and the concern on premature pruning in a multi-layer system actually has its own countermeasures. Q: Your point of view is not quite the same as my understanding of modularity. In my understanding, a module is actually a concept without hierarchy. Just like with bricks, you can build roads, it's like a complete horizontal jigsaw puzzle of bricks. Of course, you can also build a wall in which case bricks are hierarchical. It goes up one level at a time. So, in my understanding, modularity and hierarchy do not have to be correlated. Does it make sense? A: Yes, you're right. Modules are bricks. They do not have to have layers. If there are layers, like building a wall, then there has to be a sequence architecture of modules. But it is also possible that there is no sequential dependency between the modules and the layers. The modules are defined from an angle beyond layers, which is like paving a road. Road paving does not have to be serial, which can be parallel. In practice, they may as well still be arranged in a uniform pipeline, combining the style of road paving with the style of wall building. Modularity itself is a seasoned practice that comes from software engineering. That is, when building a complex system, we always attempt to divide tasks into subtasks and sub-subtasks. Modularity makes the development process more tractable and easier to maintain. Natural language is undoubtedly a fairly complex system. Faced with a complex object like language, a good way is to emulate the approach that has worked in engineering for years. That is to say, the task should be reasonably decomposed and cut into modules as far as possible to implement modular development. Thanks to http://fanyi.youdao.com/ based on which this translation is revised and polished by the author himself. This is the first chapter of our book on NLU which consists of 10 interviews on key topics of AI symbolic logic as used in natural language parsing. Stay tuned. S. Bai: Natural Language Caterpillar Breaks through Chomsky's Castle
个人分类: 立委科普|2887 次阅读|0 个评论
【NLP答问:关于parsing 和自然语言理解】
liwei999 2018-1-26 17:08
【立委按】人工智能热潮下,进入自然语言领域的新人也随之增多。新人的好处是喜欢问问题。于是有了答问。 新人: 读过您的parsing方面的系列博文,parsing 及其落地应用的种种,很有意思的领域。把 parsing 这一块做好就非常 exciting 了,能落地就更棒啦 答: 必须落地。否则站不住脚。parsing 做好根本不是问题,已经做了N次了,been there done that,NLP 是个力气活,但不是看不到头的活儿。达到接近专家的水平是验证过的。落地有所不同,落地需要找到切入点,需要有一套领域化的有效方法。 力气活指的是迭代:就是不断的迭代,每天迭代10次,一年就是3600次。设计思想和框架机制对路了,剩下的就是不断地根据数据制导,去修正系统,保证走在正路上,避免或尽可能减少 regressions,终会达到彼岸。 新人: 力气活是真的,我之前做 NLU badcase 分析,后来能看到准确率确实在上升。我相信迭代的力量。 现在的 parser 已经足够好了吗?您博客中提到的休眠唤醒机制,世界知识的引入,非确定性表达的问题都已经解决得差不多了吗? 答: 还没有,时间和人力的投入不够,一切重起炉灶,系统架构更加合理科学,但血肉不足。没关系,目标导向,急用先做。有些来不及做的,先放在那里。 新人: 想起您博客中各种奇怪的例子 答: 那是刁难系统的,多是语言现象的犄角旮旯,其实不值得太花力气。古怪的句子的好处是测试鲁棒性(robustness)或者测试有没有补救措施(backoff),主要精力还是应该花在统计性强的常用句子身上,不能被长尾牵着鼻子走。 做中文 parsing 特别让人兴奋,比做英语等 要有意思多了,后者太缺乏挑战性了。 新人: 嗯,中文本身很有魅力 答: 看上去一个字符串 人看着都头晕,如果能自动 parse 出结构来,很让人开心的。 新人: “看上去一个字符串 人看着都头晕”这句感觉对 parsing 挺难的? 答: 不妨试试: 这个当然有问题,但很容易修正。现在的序列是:NP,CL,AP,这个 CL 是一个插入语,最后的结果应该是在NP与AP之间建立主谓关系,把插入语附加上,就完美了。(CL 是 clause,M 是定语,R 是状语。)修改后的结果: 这个结果还合理吧? 新人: 是不是把“看上去”作为RP,就能fix之前的问题了? 答: 主要还是带有插入语性质的 “NP人看着(都)AP,插入语“人看着”是 RP(副词性短语),“看上去”也是RP,但在句首,好办。 新人: 如果去掉“看上去”,整个句子是“一个字符串 人看着都头晕”,改之前的 parser 能解析正确吗? 答: 不能,因为没有处理好这个插入语。与“看上去”无关。插入语在语言中是很有限的表达法,迟早可以穷尽,原则上不是问题。你以前做过什么parsing有关的工作?遇到过什么挑战? 新人: 之前做parser的离合词这一块。例如“吃了一顿饭”这样的结构,可以从语料中很容易统计到,例如“吃不吃饭”这样的就相对少,只能靠观察。当时是这么做的。首先从研究离合词的论文里找出一个两个字的离合词列表,例如'AB'。然后用'A.*B'在语料中筛选句子,对选出的句子做pos,然后统计'A.*B'中间'.*'的部分的pos组合,但是“吃不吃饭”这样的结构在词性标注的时候就没法搞定了。 答: 这不是简单的离合,而是夹杂重叠。A不AB,是一个相当普遍现象,对于所有 V+N 离合词都有效的。退一步,V不V 也是一个确定的选择疑问句式。 “对选出的句子做pos,然后统计'A.*B'中间'.*'的部分的pos组合” 做POS 后,你在统计什么? 新人: 当时的需求是,判断AxxxB是不是词“AB”的离合现象。因为想提高泛化能力,所以想从语料里产生词性级别的pattern,比如“吃了一顿饭”对应的pattern是“v u mq n”(限定 v 和 n 是单字)。比如“吃不吃饭”词性标注的结果是“吃_v 不_d 吃饭_v”,从词性的层面就不能用“v d v”来匹配了 答: 那两个v是重叠,需要unification机制的,单看POS,根本没戏。如果只是统计 POS-序列,没有什么意义, 新人: 做完了才发现,确实没什么意义。。 答: 是啊,因为就是一个动宾结构,这个 POS 序列,与 NP 序列中的修饰语应该一致。 新人: 当时就我一个人在瞎做,都是我拍脑袋想的方法,比较挫 答: 这个不用做统计,就可以想见的。 新人: 能想出来的是有限的呀,肯定有想不到的情况。。 答: 离合词不难处理,它是搭配的一种。搭配现象的本质都是词典的搭配规定与规则的实例化(instantiation)的机制,就是词典与句法需要平台机制上有一个灵活的接口。英语的短语动词 take NP off;put NP on;subcat 句型中对 PP 的 P 的要求(borrow sth from sb),汉语中量词与名词,这些都是搭配现象。 能想出来的是有限的呀,肯定有想不到的情况。 但那不是离合词的问题,那是 NP 的问题。NP 当然有很多种组合可能,拍脑袋是想不全的。所以要数据制导,要迭代。类似你上面的语言调查,也是一种。所有的语言现象,不仅仅是NP,都需要数据制导。都有想不到的序列。不过从 POS 序列着手,是远远不够的。POS 太粗,根据 POS 做 NP 或做其他现象,最后都是窟窿。 新人: 是的,最后做了个 字+pos 的规则 答: 字 太细,POS 太粗,加在一起,抓了两头的确会好很多。但是 从字 到 POS 中间还有很多,譬如 【human】以及类似的一整套的本体概念网络(ontology)可以利用。 新人: 【human】是什么意思? 答: 譬如 “演员”,“总统”,“那家伙”,。。。。就是语义概念标签。【human】是最常用到的标签了,比 N 细线条一些,比 “演员”这些关键词是粗线条了。所以说,一个系统不能光靠最粗的POS分类,也不能光靠最细的关键词,还需要语义概念的 ontology。 新人: 引入语义造成的歧义问题,是用句法来解决吗?比如“演员”是一首歌名 答: 引入并不造成歧义。要是有歧义,那个词不引入也还是歧义的。与引入无关。引入语义只会增加词的信息量,多一些可利用的手段。不是因为引入,所以需要消歧。歧义如果需要解决,也是那个词本身需要这么做。但很多时候,歧义是不需要解决的。 {演员 N},这里有两个信息:(1)演员(2)N。{演员 N 【human】【song】},这里多了两个信息。原来没引入之前,我们根本不知道 “演员” 是什么,不是什么。现在引入语义以后,我们至少知道了 “演员”不是人就是歌。它不可能是其他的1000种可能性,譬如 起码,演员 不是 【furniture】,不是【sentiment】,不是【location】。所以引入新的信息不是增加歧义了,而是大大缩小了歧义的可能性。 新人: 明白了 答: 至于区分歌与人,那个任务叫 WSD,很多应用可以绕过去不做。我写过一篇,说的就是 WSD 很难,但绝大多数应用不需要做(【 NLP 迷思之四:词义消歧(WSD)是NLP应用的瓶颈】 )。 新人: 说实话我不是对 parsing 感兴趣,是对自然语言理解感兴趣,我想知道通用自然语言理解的道路在哪里,但是也不知道往哪个方向发力。 答: parsing 与 自然语言理解 有什么不同?为什么对后者有兴趣,对前者无所谓?什么叫理解呢? 新人: 以前我一直觉得 parsing 和分词一样,是一种基础的组件。然后我觉得常识才是自然语言理解的核心。不过看了您讲文法和常识的那篇博客(【 立委科普:自然语言理解当然是文法为主,常识为辅 】),最近也在重新思考这个问题 答: parsing 强调的是对语言结构的理解,WSD 强调的是对词的理解。粗略的说,语言理解至少包括这两个大的方面。既要知道这个词对应的是什么概念,也要知道这些概念在句子中表达怎样的关系。其实后者更重要。纲举目张啊。做一条项链光有珍珠不成,更需要的是串子,好把散落的珍珠连起来。 新人: 我说下我对自然语言理解的粗浅的想法啊。比如“我喜欢吃苹果”。从句法上很容易就能解析出来,但是计算机通过什么方式才能理解“我喜欢吃苹果”和“我讨厌吃苹果”的区别?虽然能通过词典知道“喜欢”和“讨厌”是不同的概念,那么要怎么这两个概念有什么方向什么程度的不同?然后要怎么表示这种不同? 答: 然后怎样呢?你前面的话没说完啊 新人: 我也不知道要怎么理解这种不同啊。确实,没有句法是不行的。 答: 1 计算机根本没有什么理解不理解。 2. 所谓自然语言理解,那只是一个比喻的说法,千万不要以为电脑能自主“理解”人类语言了 3. 所以,自然语言理解的本质就是把语言表达成一个内部的数据结构,根据这个结构,比较容易地落地到应用所需要的方向去。譬如 情感分析的应用 需要区分正面情绪(如 “喜欢”)和反面情绪(譬如 “厌恶”)。 4. 换句话说,所谓理解,不过是人跟人自己在玩,与电脑智能没一毛钱的关系。 5. 既然是人自己跟自己玩,那就要看一个系统的内部表达(所谓理解)的设计能不能用有限的表达和逻辑,去捕捉无限的语言表达方式;能不能根据这个表达和逻辑,达到(或模拟)人在理解了语言之后所产生的那些效应。譬如人看了一句话 可以判断是什么情感,情感的强烈程度,谁对什么产生的情感,等等,因此可以得出舆情分析的结论,计算机可以不可以也达到类似的分析效果? 6 因此 脱离应用(理解以后的效应)谈理解,很难。应该通过应用来验证所谓理解。 7 所谓端到端的系统,就是直接模拟应用:里面的过程是黑箱子,叫不叫理解无所谓。 8 符号逻辑派的先理解后应用,不过是用人可以理解的方式把这个理解到应用的过程,透明化。透明化的好处,比较好 debug,可以针对性解决问题。这是黑箱子系统的短板。如果有海量带标(应用效果的标注)数据,黑箱子的好处是可以很快训练一个看上去很不错的系统。如果没有,标注数据就是一个令人生畏的知识瓶颈。 新人: 我是一直从类似微软小冰那种对话系统来考虑自然语言理解,所以不太能接受seq2seq的对话生成系统… 答: 闲聊系统,因为人的对话无时无刻不在进行,理论上有无穷的带标数据,其实可以训练出很好的以假乱真的闲聊机器人的。一个 MT , 一个 闲聊,这两个应用具有天然的海量数据,是少有的知识瓶颈不严重的应用方向。多数NLU应用没有这么幸运。所以不得不组织成千的标注队伍,还是赶不上应用现场的变化中的需求。 新人: MT 感觉和闲聊机器人还是不一样?闲聊机器人的系统在单轮的时候可以以假乱真,但是在多轮的时候基本都不能维持对话的连续性。 答: 多轮的挑战可能还是源于稀疏数据,这是因为虽然对话的数据是海量的,但是从 discourse 的角度看一个完整的对话篇章,数据就可能很稀疏了。每个对话都是一个特定的话题,以及围绕这个话题的对谈序列。从话题和对谈序列的角度来看,数据就不再是海量的了。突破口应该在对于不同对话序列从篇章脉络角度做有效的抽象,来克服稀疏数据的短板,学会篇章的应对技巧,easier said than done,这个显然有相当的挑战性。篇章(discourse)向来是计算语言学中最不容易形式化的部分。 新人: 我个人觉得如果是通用/闲聊场景,即使有海量数据,对话的话题和序列还是很可能大部分和可获得的数据集的不一致。 答: 那自然,组合就会爆炸。爆炸了 当然数据就稀疏了。 新人: 很多场景还是有办法细分成小的垂直场景,然后通过在系统设计上做一些功夫来达到一个比较好的效果的吧? 答: 垂直当然有利多了。 【相关】 【 NLP 迷思之四:词义消歧(WSD)是NLP应用的瓶颈】 【 立委科普:自然语言理解当然是文法为主,常识为辅 】 【语义计算:李白对话录系列】 【置顶:立委NLP博文一览】 《朝华午拾》总目录
个人分类: 立委科普|3629 次阅读|0 个评论
【李白之58:爬楼NLU】
liwei999 2017-6-24 21:45
爬楼NLU(Natural Language Understanding): 二楼句法结构三楼语义落地 李: 问各位一个 lexical feature 的转移问题及其解决途径,譬如 “所吃”。在小词 “所” 与 vt 结合成合成词以后,该词的语义等价于vt 标配宾语的语义。换句话说 “吃” 的动作性 语义本体标注  ,应该被置换成名词性标注 。这个 feature 更新如何实现比较合适?到 HowNet 里面去挖出来? 如果 feature 不更新,那些细线条的指望语义 features 查询条件的规则就会失效。“所” 是一例,“的字结构” 是类似的例子。无论小词负载结构 还是小词参与合成词模式 都躲不过这个 feature 大转移的语义坎儿。当然可以为每一种主要关系(譬如 动宾)从 HowNet 抽取出一个语义词表,等到需要更新的时候,就让系统根据关系的规定来查表解决。不知道有人在 parsing 中做了这个工作没有? 估计很少,多数系统还没有细线条到这个地步。 白: 所,是N/S。的,是N+/X。所吃,是 N/S 与S/*N*,结合以后变成N/**,这是句法层面。subcat层面,它继承S的逻辑宾语坑的subcat。的,就没这么精准了。X里面谁空着就提取谁的subcat。“这本书我送的是他。”间接宾语也能提取。*N*是分母的一般形式,吃还是S/2N,所吃,是N/N,被谁所吃不知道。我所吃,N与N/N正好得出N。 李: 这里的继承有文章。“所吃” 继承的subcat 有:(1)“吃”的本体标配宾语,(2)subcat 剩余坑,也就是主语坑 /N == 。这两项继承 一个是本体自己的 type 一个是坑的 type,都不是简单的事儿。因为承载本体的语词“吃” 由于小词“所”的作用 ,已经与本体概念 来了个乾坤大转移。 白: , ; 继承后者,即food。“这碗饭的所吃”不可以, 李: N/**,这个句法符号里面有很多本体名堂。当然,这些本体关系信息都是现成的 ,Hownet 里面就有类似的知识表达:吃: s= o= 。 白: “考”有点特殊。我们不知道“考”句法上应该是几个标配坑,但“所考”的subcat可以是人、学校、科目、某种证书。也就是说,不排除标配坑与subcat的对应有多元化的可能性。简单说逻辑宾语是不足以刻画这里面的复杂性的。不过,“所考”不可以继承分数【score】, 似乎所有事前不能有所控制的,都不能用“所”。“所梦”VS“所梦想” 李: 甲: 吃了吗 乙: 吃了 甲: 所食何物? 乙: 所食非物。 甲: 莫非秀色? 乙: 非也。 所食不过食堂耳。 甲:我的所吃更惨 非食堂 非馆子 更非秀色。所吃乃瘪、苦头、抑或 一鼻子灰。 白: 嗯,句法层能说“吃食堂”,“所吃”就可以是“食堂”。就是说,“吃”的逻辑宾语,是一堆而不是一个subcat。 李: 我要说的是 本体标配受事,还有一个上位概念,这个上位概念倚靠的是句法,表达的是逻辑谓宾的语义相谐。它不是本体那样纯粹 那样独立于具体语言,但又离不开本体的大框架。我一直把这种上位逻辑语义叫做逻辑宾语、逻辑主语,有意借用句法术语,加上前缀“逻辑”。所以逻辑宾语 可以是 【受事】、【对象】。【地点】等,以及其他种种说不清的搭配,逻辑主语 可以是 【施事】、【工具】、【地点】等。 白: 语义相谐不局限于受事,而是“可宾”的subcat。所砍,不能是工具。所去,可以是处所。所卖,可以是买主。所送,可以是对手方。 李: 这个 logical S 和 logical O 其实是很关键的概念。 白: 但是标逻辑主宾语给谁看给谁用? 语义落地,还是本体的坑好用,除非像“所X”这种含混的。 李: 主要是为了概括句型:svoc,就三个args。arg0 逻辑主语,arg1 逻辑宾语,arg2 逻辑补足语,更加杂乱一些,包括谓词结构嵌套也在内。但不管这三个 args 的内部逻辑语义细节多丰富,这三个坑从语言句型结构上定下了框架,万变不离其宗。 白: 好像不需要这一层,大面上也都可以语义落地。从“跟谁有关系”到“是什么关系”。 当“是什么关系”有多选时,就对应subcat集合,当然可以有个概率分布之类。按老乔的理论,你这是移位前的“logical form”,本质上还是句法。 李: 对 是句法。句法才是纯粹的语言学,到了语义就开始变味了。 白: 但是这标签贴了又不是最终落地用的,感觉不爽。要贴标签的话,还是只贴一次为好。句法不贴又何妨。 李: 在我这儿 语义落地靠的就是 svoc 句型,有了svoc 的框架,落地的句型 就一目了然了。 具体工作不过是给句型做细节条件的微调,然后就落地为具体场景的角色了。譬如 o 落地为 【发布的产品】,s 落地为 【发布产品的公司】:Apple launched iPhone 7 yesterday 白: 在我这儿,“可宾”包括的subcat范围,一是可以学出来的,二是仅仅跟少量词语的语义落地有关,没有大动干戈的必要。大多数落地(role assignment)的场景都不需要这个中介。 李: 把 s 标签 map 到 【发布产品的公司】这类工作,简直就是玩儿。 是典型的以不变应万变。不管产品和客户需求有多少变化 本质上 语义落地玩的就是换名的游戏。比起 parsing 这一层工作的繁难,信息抽取层面的这些工作太简明了。 虽然需要落地的谓词 都是少量的,但所有的谓词都逃不过句法的逻辑句型。 因此针对所有谓词建立句型模式 就形成了一种以不变应万变的结构准备,接下去爱怎么落地 都是一览众山小了 跑不过如来佛的手掌 。所以 这一层本身虽然不是客户的需求 而只是内部的桥梁,但我还是很推崇它作为语义落地骨架或桥梁的地位。 白: 如来佛手掌可以有多种造型 李: 那是。跳过它落地 完全可以想象。也许是偏好 总之玩一个主人三个仆从的游戏觉得很好把握,组合一下 也是非常有限的边界。不会做着做着 觉得进入迷宫 或搞不清漏掉多少。说着说着 觉得自己一方面批判乔老爷(参见【 乔姆斯基批判- 李维 】 ), 一方面可能中了他老人家句法中心论、句法自足论的流毒太深 而不自知。 白: 从“有关系”到“是受事”,中间再经历一个环节好,还是直达好?我的选择是“直达”。至于“受事”是“发布的产品”,这只是一个alias。没有什么技术含量的 李: 对呀。正因为没有含量 所以就更像是游戏。真正有技术含量都在前期的 deep parsing 里面了,那才是自然语言理解的核武器。换句话说 svoc deep parsing 已经把句法做到通用领域的极致了,以至于落地到领域几乎就是一个换名的游戏,换一个领域容易接受、客户听起来舒适的情报标签。 白: 回到前面“吃食堂”,“食堂”可直接匹配“处所”,我说它是O不是O,有何意义? 李: 关键的 argument 还是:落地是千变万化的领域 和 各种不同客户的需求,但 svoc 永存 永远不变。只要领域用的是语言数据 这就是恒定的,就如二元关系的永恒一样。 白: 这里焦点不是有没有,是可不可以不用,不用是否一定差。语言学有很强的构造性,你构造他就有。角色本地名称是第一性的,通用名称是第二性的。对机器来说本地名称可以是不要名称,只有编号:第一个语义坑、第二个语义坑……,给个本地别名,就是公司、产品,给个通用名,就是施事受事。 李: 关于直达还是通过语义中间表达的桥梁,我也问过类似的问题。我诘问的对象是费尔默理论。在信息抽取的落地框架前, 有没有必要先经过一下他老人家的 FrameNet 的框架?我的答案是否定的:多此一举 没有必要。这就基本否定了 FrameNet 的实用意义。没有必要的理由是 FrameNet 理论上缩短了语义落地的距离,实践中增加了落地的麻烦。一个 svoc 的简单通用句型 分化到成百上千的 frames 去 还没有最终到达目标地。 白: svoc也没有达到目的地,“有填坑关系”不是更干脆么,中间的过程,无论借助subcat锁定还是借助语序,都是自动化的。 李: svoc 可控、intuitive,而且语言学家如数家珍。其实,说了半天,从落地对策的大类上,我和白老师是一伙的。标不标 svo 只是细节的差异,虽然从我的架构看,这个差异还是蛮重要的。 白: 语言学家如果是我培养出来的,用我这一套也可以如数家珍。 李: 但如果落地从领域落地泛化到通用的应用,譬如搜索,搜索没有预先定义的事件。svo 的搜索比较容易训练给大众,这与多数人的基本语感相吻合 who did what. 这类重要应用增加了 svo 的独立价值。你要搜索产品发布事件?好 那你就搜索:“发布” 其宾语是 【产品】。至于这个宾语在语言中有多少变体的句式 那都不是大众需要关心的,deep parsing 早就 normalize 了。 白: 这只是一个动词被“实例化”的wizard 李: 如果不标svo, 搜索的时候可以这么说,搜索 “发布” 其二元关系词是 【产品】,也可以达到类似的结构搜索的效果,返回精准的产品发布事件的清单来。比纯关键词词搜索精细高明多了。可是如果客户想 搜索所有受雇的人 ,在 svo 系统中 就搜索:“雇佣” 检索出其【宾语】出来。在不标 so 的二元关系系统中,雇主和雇员就混在一起了。 白: 1、你无法排除取消发布、拒绝发布、打算发布、能够发布……这些用模态词沾染过的发布;2、发布的如果不是产品而是新闻怎么办。svoc自身无法区分哪些是产品哪些是新闻。 李: 这些都不是问题。或者说不是因为增加 svoc 而新出的问题。svoc 反而为在何处解决那个问题提供了蓝图和便利。这都是另外层面的问题,譬如节点的条件、数据的来源、李ta data 等。与评价 svo 本身的利弊没有关系。 白: 我的问题是,如果这些区分导致svoc这一层反正信息不足,反正还需要借助另一层的信息,那么直达那一层有何不妥 李: 但信息不足是有不同层面的。任何图谱(graph),是 arcs 信息不足,还是 nodes 信息不足?还是超越句内结构的discourse不足,还是 meta data 不足?不能混谈,虽然这些不同层面的信息有相互弥补的作用:戏(arcs)不够可以词(nodes)来凑。 白: 标签不足。 李: arcs 不标标签 是一个极端。arcs 标了 soc 是多了一些句法结构的关键信息,soc 再细化为董老师的90多种逻辑语义,就又更多了信息。nodes 呢, 啥也不标 是一个极端, 标了 pos 有了一些信息分类,再标 subcats,进而做NE实体标注(包括产品),直到引进 常识本体乃至领域本体(ontologies), 信息就越来越丰富。自然也越来越难维护和掌控。 白: 反正要上三楼,就是二楼的高矮问题。 李: 对。 白: 如果为了上一个高的二楼,导致付出的代价接近上三楼,二楼就取消算了。三楼的细活儿做得越好,二楼矮点儿就越没关系。 李: 为搭建二楼 svoc 所需要的信息及其技术手段,基本全部可以继承下来为三楼服务。所以 为什么说 parsing 不仅仅是所看到的树结构,也不要指望一个 offshelf parser 就很容易语义落地为产品了。parser 要成为语义落地直通车, 需要借用 parsing 本身所带来的资源积累。结构图只是这些资源的一个最容易彰显的部分 但绝不是全部。 白: 自带插销插座,到三楼装配起来就easy多了。 李: 完全同意 同感。但 “二楼就取消算了”,不愿苟同。问题是三楼是 moving 的,业务场景变化 客户需求变化 产品角度变化 ...... 都使得三楼细活显得琐碎而不容易概括。 白: 不会 那都是贴牌问题,瓤不是moving的。 李: 二楼是清晰定义的目标。在我看来,二楼的 svoc 正是不变之瓤。 白: 我的二楼是让有关系的都勾搭上。是什么关系你们到三楼谈。但是自带了三楼才会用到的插销插座的,不妨提前锁定。到了三楼,就只剩贴牌了。但是也有需要必须在三楼才能锁定的,二楼无须代劳和强制。 李: 理论上 必须在三楼做的 只是领域知识。这些知识在二楼是避开的。 白: 另外贴牌是很外在的东东,没必要单独一层,只相当于在三楼化个妆。只需要示例就可以让领域的人干,都不用跟语言学家打照面。 李: 然,贴牌很多时候不过是 config,可以让用户或产品经理根据喜好而定,随时更换。 白: 跨领域的实体数据库,这个环节可以众包。领域知识说起来是无底洞,但是做法不同收效相差很远。根本分歧是,知识的使用是“推演”的套路还是“联想”的套路。“推演”的套路精准但笨重,只能借助人工而无法借助大数据。“联想”的套路模糊而轻盈,不过多依赖人工而寻求借助大数据讨巧。只要模糊给出的效果是应用可容忍的,“联想”的套路就会胜出。所以,哈工大做的“事理图谱”如果沿着联想的路往前走,我很看好。有理由相信,语言处理需要的知识,不是“精准”而是“轻盈”。对话场合大不了还可以追问。文本场合虽然不能受理追问,但受众有相对充分的时间调动“精准”的手段。二楼的高和矮,如果涉及到二楼的业绩,确实另当别论。如果二楼三楼的发明人都是公司的大老板,或许另样格局。这两碗水怎么端都是平的。 【相关】 【语义计算:李白对话录系列】 【 乔姆斯基批判- 李维 】 中文处理 Parsing 【置顶:立委NLP博文一览】 《朝华午拾》总目录
个人分类: 立委科普|4319 次阅读|0 个评论
【李白之39:探究自然语言的毛毛虫机制】
liwei999 2017-4-16 11:37
白: 定义subcat很有讲究的,后面有强大的数学。什么类型填什么类型的坑,结果是什么类型,数学早给我们准备好工具了。不知道这种数学,只能“自发”地做。知道了,就有条件“自觉”地做。type theory,带类型的lambda演算,早就给我们准备好了工具。为什么说小词也可以负载结构,原理是同样的。不是心血来潮,不是头疼医头,不是工程上的取巧,是有数学支持的。 李: 以前流行的那些 unification grammars or constraint based grammars 都是建立在 typed feature structures 之上的: CFG GPSG HPSG. 对于 type hierarchy and it's inheritance, 对于 attribute value 的 type appropriateness 都有说法, Typed feature structure 是这些文法的形式化基础。不知道这是不是就是所指的背后的数学或逻辑。 白: type化最彻底的就是categoral grammar,但是CG最大的问题就是不实用。我已经把CG改造成了非常实用的程度,但是底子还是CG的底子。十多年前,我的学生@赵章界 (也在本群)的博士论文已经对中心词的继承特性在CG当中的形式化机制做了刻画。我最近的工作,进一步把这种继承性和修饰关系做了无缝对接。 李: CG 没钻研过。其他那些文法的 typed feature structure 主要就是一种表达语言信息的数据结构,与软件工程里面 object-oriented class hierarchy 有很多相通之处。涉及到“演算”的似乎主要在表达语义的那部分feature structure (SEM)。自然语言的语义有一个总的原则是composionality, 就是用有限的语言材料(词,成语)组合成无限的句义。于是当一个单位与另一个单位在parsing中结合的时候,就有个怎样从简单的词义一步步“演算”成短语和句子语义来的课题。但这个演算过程,也带有浓厚的自己跟自己玩逻辑的成分。那些精心构造出来的句子的“语义”表达,显得繁琐、繁复,逻辑上好看,但实际语义落地其实并不一定需要这种。 白: 一眼看现状不中用就扔掉是一种策略。把它改造成中用是另一种策略。 李: 在feature structure unification based的系统中,这种演算就是通过structure sharing 让信息在feature结构中跳来跳去。跟玩游戏似的。如果某个语义在SEM整体的表达中没安排妥帖,或者缺乏合适的地方去表示,就挖尽心思改造那个 SEM structure,结果弄得越来越烦琐哲学。眉毛胡子一把抓,为语义而语义,忘记了语义落地的初衷。玩过一遍这类游戏以后,就开始删繁就简。 白: 化腐朽为神奇,有窍门的。单子化(singleton)是关键。废弃多层结构,把萝卜和坑摆到同一个桌面上。世界顿时清明。这里面藏着一个大秘密。 李: 你这也是删繁就简。那些复杂feature结构,都是那么的侯门深似海。错综复杂,各种嵌套,逻辑上能讲出很多道道来。 白: 但是singleton这是一个最有意思的子集。逻辑上一样有道理。只不过躲开了复杂结构而已。但那些复杂结构本来就是添乱的。本质上有用的,singleton足够了。 李: 同意应躲过复杂结构。我的系统是基于 atomic features 的。 白: 在 毛毛虫假设 下,singleton is enough,所以,叠床架屋的结构已经事实上废掉,但数学上仍是严谨的。去掉其他冗余,只剩下唯一一种可以还原为singleton的结构。这是毛毛虫的最大贡献。所以我面对的不是通用的CG,不是通用的复杂特征集,而是专为 毛毛虫 准备的singleton类型演算。好像人类的语言从遗传上就是只为singleton准备的。换了任意定义的一个CFG,还不一定能占到这个便宜呢。 singleton就是萝卜和坑只有一层,不嵌套。所有嵌套都可以简化为修饰和合并。修饰是继承的简化形式,合并是括号下分配律的简化形式。还原了都是填坑。本质上只有填坑一种运算。但是通过用修饰和合并来重写(rewrite)某些填坑,整个体系就完全扁平化了。这个工作,写论文也是拿得出手的,不过我目前还真顾不上。 李: 白老师有时间举几个例子就好了,说明怎么扁平化。 白: 李: 怎么讲? 白: 左面是CG,右面是我的简化 李: 上面是:形+名。逻辑上,形是谓词,名填坑:beautiful(girl)。结构上,形在前,修饰名。形被名吃掉: 。 白: 在CG,是 名 被 形 吃掉,再吐出一个 名。在坑论,是 名 吸收掉 形。 关键是输出的路径,一个在形,一个在名。 李: 名是head。逻辑上,名被形吃掉没有问题。但是结构上的head怎么办呢?吐出一个名不能解决head的问题,因为head涉及的不仅仅是POS,而是一套 head features(包括本体及其taxonomy)以及head token,包括词形。 beautiful girl == girl (who is) beautiful 白: 当初为了解决这个矛盾,设计了CG输入输出之间的绑定机制,但是仍然不够直接。 李: 修饰与填坑的关系不是在一个平面。 白: 现在的表示最直接:修饰是填坑+绑定的简化。简化以后,就都变成singleton了,俗称“捋直了”, 李: 修饰是句法关系(是反映结构上的主与次),而填坑是逻辑关系,反映的是谓词与arg?左边CG的表达,没看明白。右边倒是显得简单了:作为 singleton , N+ 就是一个 atomic POS,等价于JJ,他右边遇到N(就是POS NN),就被吃掉。JJ被NN吃掉,算是绑定?那NN填JJ的坑,表现在哪里呢? 白: 已经重定向了。JJ可以认为没有坑了。 李: 这种逻辑关系与结构关系在语义表达上的纠缠,在ING词表现更明显: ING做修饰语的时候,譬如 running dog,一方面是一个被吃掉的可有可无的修饰语,另一方面 running 作为逻辑谓词,需要一个逻辑主语来填坑。结构上的 head 这时候屈尊成了填坑的萝卜(arg)。 白: 了,也是一样。逻辑上,了 是(S/N)/(S/N),但我们把它简化成+S 李: +S 就是吃一个S 吐一个S? 吃一个 Aspect unspecified S,吐一个 Aspect=Perfect的S。 白: @wei 然 刚才ing,如图:两个S消掉了,剩下两个N。在汉语里,如同“这本书的出版”。 李: ing怎么就成了 N/S 可以把词尾看成小词,所谓小词负载结构。 白硕: 上图是CG:吃一个S,吐一个N。我现在的做法见下图: +N结构强制分子上的S到N,分母上的N不变。填动词的坑变为填名词的坑了,因为被修饰语被修饰语强制了。 李: N/N不就是 N+吗?N+ == JJ 白: 不是。二者不等价。这是一个真的坑,没有绑定机制。 这本书的出版,输出的是出版,不是这本书 李: 这本书 结构上是可有可无的修饰语,“的”来引导,逻辑上是arg,这双重身份(mod and arg),赶巧挂靠的都是相同的老子。“出版”的arg(宾语)是“这本书”;“出版”的mod也是“这本书”。比较:“这本书的出版” vs “出版的这本书”。 白: 我在说英语的ing,谈到“的”只是类比。英语的ing,从右侧修饰动词原形,把动词强制为名词,把动词带的坑也强制转为名词带的坑:their publishing the book 李: 这个CG好玩,吃啊吐啊的,当年怎么没注意它。 白: 没有绑定机制的CG,语言学意义是有限的,更像是数学而不像语言学。我的学生@赵章界 引入绑定机制后,才像语言学了。但是赵的工作许多人没有注意到它的核心价值。 李: 当年看过一点那啥 蒙氏文法,形式语义,这个演算那个演算的,被绕糊涂了。没看懂。 白: Montago 李: 对,里面有Lambda演算啥的,对我太抽象了。记得Montago看不懂,就找中文的来看。原文看不懂的,中文就更看不懂了。就拉倒了。 什么叫绑定机制? 白: 就是吃的和吐的,具有同一性。如果将来吐的参与任何操作,都要把吃的带上。吃的所携带的任何语义特征,也都被传导给吐的。绑定机制基本就是这个意思。 李: 这个听上去就是HFP(Head Feature Principle)。大白话就是一个短语,头词是其代表,头词决定一切。坚持党的一元化领导不动摇。真正实现的时候,根本就不需要像HPSG那种,把 features 定义到嵌套的HEAD结构去,然后上下传来传去的。麻烦。还是我导师刘老师简单直接,head就是直接把修饰语吃掉,是真地吃掉了,看不见了。这么一来信息,就无需传送了。 白: 但是用原教旨的CG,即使引进了绑定机制,仍然是叠床架屋。我现在的方案就极为简单了,就是吃掉。但是理论上它是CG的简化形式。CG的所有严谨性都包含在里面。但是省去了传递。 李: 那些叠床架屋,主要是为了鸡零狗碎的一些边边角角的所谓 non-head features,为此不得不把 HEAD features 嵌套起来。真是为了芝麻,挤压了西瓜。 白: 叠床架屋的缺点去掉,优点保留。毛毛虫的毛刺。很多可以通过中间件摆平,就不需要这些边边角角了。 李: 这个中间件相谐,的确是个好东西。动态隐含地引进了常识,却没有了常识管理的负担。这是亮点和创新。以前的优选语义学(Preference Semantics)一直就困扰在尺寸无法掌握,现在用大数据解决了这个困扰。 白: 而且中间件只管二元关系,不需要涉及复杂结构。所有复杂结构都被singleton填坑化解了。只剩下扁平的二元关系。 李: 常识的基础形式就是二元的,即便牵连到多元,也可以用多个二元来近似:【animate】吃【food】,这个三元常识,不就是两个二元关系吗。 白: 用我的话说,就是“吃”挖了两个坑。两个坑和萝卜摆在一个货架上。这就是singleton。 李: 蛮好。 当然二元近似可能不完全等同它,但实践中的些微偏差,从效果上看,已经可忽略不计了。 白: 所以,我的方法,贯穿着CG的原理,但外部表现很像DG。在对小词的处理上比DG更为彻底,所有小词都纳入二元关系。而二元关系的背后有类型演算的数学作为基础。绝不是随意的或者为了工程而武断设定的。 李: 其实我们的做法和策略,有很多殊途同归的地方。不是高攀。都是各自思索多年,不约而同的决定舍弃什么,采纳什么。我现在缺的是大数据中间件,你那边还是单层,当然,你在单层里面加了优先啥的,近似了多层。 白: 有算符优先,单层也相当于多层 李: 但我还是觉得单层伸展不开,有点凑合事儿的味道。多层符合软件工程的标准做法,模块化。真正是把语言学当工程去做。 白: 但是如果引入kick of,单层+优先更轻便。 李: 对于复杂结构的舍弃或扬弃,我们思路是一致的:atomic features or singlton 当然严格说,singlton的subcat标注,比起复杂特征的SUBCAT 的精细描述以及里面体现的句法语义一体化,也显得有些伸展不开。但问题不大了,得大于失。 白: 语义那边自有知识图谱来承担更加复杂结构的表示。对接的途径都在,不会跑到途径外面去。句法的目标极为有限。伸展得开与否,要相对于这个有限目标来评估。不存在绝对的标准。这无非是二楼和三楼的分工问题。 李: 还有一点风格上的差异或美感因素在。 据说写 Unix 的人与写 Windows 的人,是两种人。互相看不上。后者嫌前者小家子气,前者不能忍受后者的挥霍。 白: 都很伟大。 【相关】 【白硕 – 穿越乔家大院寻找“毛毛虫”】 【语义计算:李白对话录系列】 中文处理 Parsing 【置顶:立委NLP博文一览】 《朝华午拾》总目录
个人分类: 立委科普|4393 次阅读|0 个评论
【一日一parsing:#自然语言理解太难了# 吗?】
liwei999 2017-2-7 00:44
白宫命令司法部申请紧急冻结今天华州政府在西雅图联邦法院申请到的总统冻结穆斯林七国入境EO的临时冻结令。 如果成功的话,临时冻结令将被紧急冻结令冻结,穆斯林七国入境继续冻结 #自然语言理解太难了# wang: 李老师这是要把机器累吐血啊! 不太理解为何要和这类超长难句对上了。 以前只顾着忙着单句,对篇章理解终未敢有奢望。 恩,到时句法分析,感觉可以分成若干小句来分析也不错。 只要把前继跟准了,把大树搞成森林,由若干棵小树构成,而每个小树分析结果表达清晰准确。也是一种选择 我: 不是跟难句过不去,是 parse 着玩。现如今凡是遇到 “绝妙的中文”、,#自然语言理解太难了# 这类标题,就忍不住想,我 parse parse 会怎样呢。是一种类似于软件工程上 stress test 的心态,人说难,偏试试,看极限在哪里。哭笑不得的结果有之。喜出望外的也有,以为难仔细一想其实不难。总之都会有启发。不特意为这些 outliers 去动手术。不值当。 特别心烦意乱的时候,啥招都不管用,只有调系统可以安神。明知系统是个无底洞,以有涯对无涯。killing time,一点儿也不殆。 白: “这些泡沫包装糟透了。” “这些水果包装糟透了。” 我: “泡沫包装”作为合成词词典化了。 白: “这些学生宿舍都没回就一头扎进了图书馆。” 我: 第一句差强人意,层次纠缠。知道病源,不敢确定该不该修理。分层这事儿,你不能占尽了它的好处,一点不吃亏啊。主要是衡量亏的大小,值得不值得去打补丁或做高危微调的动作。观望。有时候需要时间和新的数据去驱动和决策开发和维修。 【相关】 【李白对话录系列】 中文处理 Parsing 【置顶:立委NLP博文一览】 《朝华午拾》总目录
个人分类: 立委科普|2429 次阅读|0 个评论
【立委科普:如何自动识别同一个意思千变万化的表达?】
liwei999 2016-12-9 11:04
自然语言理解(NLU)的很多应用需要找到解答下列问题的算法:如何自动识别同一个意思千变万化的表达?譬如,问答系统或自然语言的任何人机接口,第一个问题就是如何理解不同用户千变万化的问题,以便从某个库里检索出合适的答案来。主流流行的做法仍然是绕过结构和理解,根据关键词、ngram以及 some word expansion,建立一个模型来计算不同问句的相似度。这种显然是偏离人类理解,最多可算是近似的做法被认为是理所当然,甚或唯一的手段,因为符号逻辑和语言规则那一套貌似模拟人类理解语言的做法早已从学界退出了历史舞台:学习界要竞争连对手都没有,只能自己跟自己玩。 以我骨灰级计算语言学家的身份,本篇就来专门谈谈这个问题的符号逻辑。都说语言学家迂腐得可以,云山雾罩,对牛弹琴。不信这个邪,你就是工程或学习的大牛,今儿个我也要把语言学的琴给你弹明白,不明白不收钱。(当然,明白了也没打算收钱。有心给小费的话,请转而打赏给任何公益项目为荷。) 我们把上述问题分解如下,更复杂的 cases 大多是这些部件的不同组合而已。 (1) 同一个意思的不同表达主要体现在用词的不同上,例如: 我没钱。 我很穷。 我买不起。 我就是个屌丝。 我银子不够。 我手头很紧。 (2)同一个意思的不同表达主要体现在结构的不同上,例如: 我没有那么多钱 钱我没有那么多 我钱没有那么多 同一个意思的不同表达所用的词不同结构也不同也是有的,那不过是上述两种情形的交织而已。任它千变万化,所牵涉到的变量是可以映射的。以上述场景为例,变量是:【human】【lack】【money】。其底层结构是:【lack】(【human】,【money】)。词典级的映射是: 【money】:钱,银子,美钞,RMB,¥,$ ...... 【lack】:缺乏,没有,缺少,不够 【human】:我,你,他,人,..... 【lack】(,【money】):穷,穷酸,买不起,手头+紧,...... 【lack】(“人”,【money】):屌丝 以底层结构为起点反推(乔姆斯基所谓生成),以上面的词典信息为驱动,加上一些简单的句法约束,包括容忍 optional 的随机成分(譬如加入程度“很”或强调“的确”,时态“已”等等),符号逻辑可以用计算文法(computational grammar)一网打尽语言的不同用词或结构的千变万化,不是清晰可见了吗? 一网打尽的前提是起点是一个定义明确的 logical statement,如果起点不确定,我们面对的是语言海洋,那就不好说了。因此,我一直跟人说,对于领域的问答系统,譬如,起点是 QA 的档案或者起点是一个 app 的可能的 commands,利用符号逻辑的自然语言理解技术,建造一个几乎一网打尽的自然语言接口,是完全靠谱,可以拍胸脯的事儿。 这里面的原理就在语言海洋的千变万化被聚焦了(据说深度学习也有了类似的时髦概念 叫 attention,在 IE 领域,这个概念已经有 20 多年的历史了,IE 本身就是 NLU 的聚焦)。聚焦以后仍然有很多变式,让人眼花缭乱的不同说法,但是这些变化逃不过如来佛的手掌。聚焦的最大特点是 vocabulary 急剧浓缩,加上语言学文法的约束(此篇省略其细节,明眼人自可想象,这绝对是 tractable 的任务),貌似的千变万化于是被一张无形的符号逻辑网罩住。 顺便一提:很喜欢张学友一首歌,叫【一张无边无际的网】,说的是情网,用来代表文法也很贴切。文法就是NL的无边无际的网。我们做计算文法的人 为什么乐此不疲,因为是在编织这张无边无际的网。尽管如此,仍然需要语义聚焦,才好最佳落地。 【相关】 【 立委科普:问答系统的前生今世 】 【deep parsing,deep learning 以及在对话和问答系统中的应用】 中文处理 Parsing 【置顶:立委NLP博文一览】 《朝华午拾》总目录
个人分类: 立委科普|3126 次阅读|0 个评论
【离开皇冠上的明珠只有一步之遥的感觉】
热度 1 liwei999 2016-8-21 19:28
parsing 是最好的游戏,而且实用。 据说好玩的游戏都没用,有实用价值的东西做不成游戏。但是,对于AI人员,parsing 却是这么一个最好玩但也最有用的游戏。纵情于此,乐得其所,死得其所也。 禹: 李老师parser有没有觉得太烧脑呢? 做parser少了个做字。感觉上先是一个比较优雅的规则集,然后发现规则之外又那么多例外,然后开始调规则,解决冲突,然后'整理规则的事情还得亲力亲为,做好几年感觉会不会很烦? 我: 不烦 特别好玩。烦的是好做的语言 做着做着 没啥可做了 那才叫烦。英语就有点做烦了。做中文不烦 还有不少土地没有归顺 夺取一个城池或山头 就如将军打仗赢了一个战役似的 特别有满足感。 梁: 收复领地? 我: 【打过长江去,解放全中国!】。parsing 是最好的游戏。 先撒一个default的网,尽量楼。其实不能算“优雅的规则集”,土八路的战略,谈不上优雅。倒有点像原始积累期的跑马,搂到越多越好。然后才开始 lexicalist 的精度攻坚,这才是愚公移山。在 default 与 lexicalist 的策略之间,建立动态通信管道,一盘棋就下活了。 譬如说吧,汉语离合词,就是一大战役。量词搭配,是中小战役。ABAB、AABB等重叠式是阵地战。定语从句界限不好缠,算是大战役。远距离填坑,反而不算大战役。因为远距离填坑在句法基本到位之后,已经不再是远距离了,而且填的逻辑SVO的坑,大多要语义相谐,变得很琐碎,但其实难度不大。(这就是白老师说的,要让大数据训练自动代替人工的语义中间件的琐碎工作。而且这个大数据是不需要标注的。白老师的RNN宏图不知道啥时开工,或已经开工?) parsing 是最好的游戏,一方面它其实不是愚公面对的似乎永无尽头的大山,虽然这个 monster 看上去还是挺吓人的。但大面上看,结构是可以见底的,细节可以永远纠缠下去。另一方面,它又是公认的世界级人类难题。不少人说,自然语言理解(NLU)是人工智能(AI)的终极难题,而 deep parsing 是公认的通向NLU的必由之路,其重要性可比陈景润为攀登哥德巴赫猜想之巅所做出的1+1=2. 我们这代人不会忘记30多年前迎来“科学的春天”时除迟先生的如花妙笔:“自然科学的皇后是数学。数学的皇冠是数论。哥德巴赫猜想,则是皇冠上的明珠。...... 现在,离开皇冠上的明珠,只有一步之遥了。”(作为 毛时代最后的知青 ,笔者是坐着拖拉机在颠簸的山路回县城的路上读到 徐迟的长篇报告文学作品【哥德巴赫猜想】 的,一口气读完,兴奋不已。) 不世出的林彪都会悲观主义,问红旗到底要打到多久。但做 deep parsing,现在就可以明确地说,红旗登顶在望,短则一年,长则三五年而已。登顶可以定义为 95% 左右的精度广度(f-score, near human performance)。换句话说,就是结构分析的水平已经超过一般人,仅稍逊色于语言学家。譬如, 英语我们五六年前就登顶了 。 最有意义的还是因为 parsing 的确有用,说他是自然语言应用核武器毫不为过。有它没它,做起事来就大不一样。shallow parsing 可以以一当十,到了 deep parsing,就是以一当百+了。换句话说,这是一个已经成熟(90+精度可以认为是成熟了)、潜力几乎无限的技术。 刘: @wei 对parsing的执着令人钦佩 我: 多谢鼓励。parsing 最终落地,不在技术的三五个百分点的差距,而在有没有一个好的产品经理,既懂市场和客户,也欣赏和理解技术的潜力。 刘: 任何技术都是这样的 我: 量变引起质变。90以后,四五个百分点的差别,也许对产品和客户没有太大的影响。但是10多个百分点就大不一样了。譬如,社会媒体 open domain 舆情分析的精度,我们利用 deep parsing support 比对手利用机器学习去做,要高出近20个百分点。结果就天差地别。虽然做出来的报表可以一样花哨,但是真要试图利用舆情做具体分析并支持决策,这样的差距是糊弄不过去的。大数据的统计性过滤可以容忍一定的错误,但不能容忍才六七十精度的系统。 当然也有客户本来就是做报表赶时髦,而不是利用 insights 帮助调整 marketing 的策略或作为决策的依据,对这类客户,精度和质量不如产品好用、fancy、便宜更能打动他们。而且这类客户目前还不在少数。这时候单单有过硬的技术,也还是使不上劲儿。这实际上也是市场还不够成熟的一个表现。拥抱大数据成为潮流后,市场的消化、识别和运用能力还没跟上来。从这个角度看市场,北美的市场成熟度比较东土,明显成熟多了。 【相关】 泥沙龙笔记:parsing 是引擎的核武器,再论NLP与搜索 泥沙龙笔记:从 sparse data 再论parsing乃是NLP应用的核武器 It is untrue that Google SyntaxNet is the “world’s most accurate parser” 【立委科普:NLP核武器的奥秘】 【 关于 parsing 】 【关于中文NLP】 【置顶:立委NLP博文一览】 《朝华午拾》总目录
个人分类: 立委科普|5206 次阅读|1 个评论
非常折服苹果的技术转化能力,但就自然语言技术本身来说 ...
热度 1 liwei999 2011-10-8 08:10
苹果 iPhone 4S 里面的 Siri,跟我们的工作没法比 它面对的是非常狭窄的语言子集,我面对的是全开放的语言现象。 自然语言处理,领域越单纯,应用越好 。可我没有这个便利,我面对的是跨领域。 自然语言处理,语言越规范(譬如正式新闻),应用越好。可我没有这个便利,我面对的是社会网络的用语:充满了错别字、不合语法的说法,还有稀奇古怪的表达(譬如emoticons)。 自然语言处理,抽取事实的应用比较成熟,而抽取主观评价和情绪性话语比较难,而且现象很模糊。可我没有这个便利,我面对的是 sentiment extraction。 自然语言处理,单纯任务比较好办,譬如好话坏话的两级分类,复杂任务比较难,譬如要抽取好话坏话里面的细节和动机。可我没有这个便利,我们的产品需要这些细节和动机,来挖掘 actionable insights。 最后,自然语言处理,做研究的不少是玩具系统,做得大的大多也只在几个 GB 的量上做文章 。可我没有这个便利,我面对的是大数据 (big data),至少在 billion 文章的量级上。多了,真地就不一样了,从精雕细刻每棵语句之树,转为对语言之林的鸟瞰,与登泰山的感受类似,一览众林小。 总之,从各个方面看,我都是选择了最难的一条路,没走捷径。是在钢板最厚的地方钻眼。严格地说,不是我的选择,是机遇迫使我做这样的选择。 结果呢?曾经沧海。 没有什么可怕了。产品的技术门槛高了,具有竞争优势,开发起来带劲儿。难题经过多了,人也鲁棒、踏实了。未来呢,天生我才必有用,牛刀宰鸡快如麻。 【置顶:立委科学网博客NLP博文一览(定期更新版)】
个人分类: 立委科普|6315 次阅读|2 个评论
从新版iPhone发布,看苹果和微软技术转化能力的天壤之别
热度 2 liwei999 2011-10-5 18:29
终于熬夜把苹果昨天发布 iPhone 4S (其实应该叫 iPhone 5) 的现场录像( http://events.apple.com.edgesuite.net/11piuhbvdlbkvoih10/event/index.html )看了。其中的一个最重要的 feature 叫 Siri,你的贴身秘书,可以用自然语言与其对话,执行你的日常指令。里面用到了自然语言技术,语音识别(speech recognition)以及语言理解(natual language understanding)。这个 demo 非常精彩,几乎就是科幻里面的未来世界。 后一种技术的应用其实没有多少奥妙,能够成功的本质是因为在一个软件应用的世界,其指令集是有限的,设计的时候可以反推:一个特定指令对应若干不同的自然语言的说法。譬如,问天气有多少种说法,问时间有多少种说法。这种有针对性的有限集的自然语言理解,是完全可行的。 大约5-6年前,我有机会与微软的研发人员谈过这个问题。当时,李开复还在微软,他领导的一个项目叫做 Natural Interface,就是想做这个事情。这个项目里面的研究人员问我: 你觉得这个NI的想法可行么?要解决的问题是这样的:现在的软件,功能越来越多,譬如 MS Word,里面有几百个功能。这几百个功能中只有少数的常用指令显现在菜单上,其他很多功能隐藏在软件里面,虽然有 Help 和 搜索,绝大多数用户想用某个功能的时候还是难以找到,或者没有耐心去找。能不能加入这个自然语言的搜索功能,不管用户找什么功能,用什么不同的说法,软件都可以理解,把那些沉睡的 features 提出来给用户。 我几乎不假思索地回答道:这是完全可行的。因为这是一个有限领域,目标指令是很有限的集合(几百个),从指令的概念反推自然语言的说法,用一点儿自然语言分析技术,没有实现不了的理由。而且,即便还有歧义不好解决,至少可以把可能的候选指令提出来,让用户确认。只要研发,就一定可以实现。 五年过去了,微软的产品里面还是不见NI的影子。而苹果呢?不仅实现在 iPhone 4S 里面,而且无缝连接了语音识别。 两相对比,微软与苹果在技术转移成产品的过程中的差别,岂止天壤。无怪过去10年中,微软股票不进反退,而苹果的市场价从原来的微软的零头发展到超过微软的总量。 李开复设想的 NI 项目起步不久,就离开了微软加入 Google,这个项目似乎是流产了。也许他要是留在微软,这个项目早就开花结果了,也未可知。这个技术一旦 streamlined,可以推广应用到所有应用程序中,大大改善人机界面和交流。这样的可行性高、应用面广的机会,而且微软早已看到了方向,却仍然多年停步不前,简直是不可思议的愚鲁。 苹果下一步的计划就是推广到更多的 apps 中,并且在英语西班牙语之外,再加入其他语言的理解。 【置顶:立委科学网博客NLP博文一览(定期更新版)】
个人分类: 立委科普|6124 次阅读|2 个评论

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-5-16 03:29

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部