【立委科普:美梦成真的通俗版解说】

凑热闹参加【征文:美梦成真】 ,有网友搞不懂这美梦是啥,怎么叫美梦成真。说明我瞎激动的所谓美梦,非但没有做到老妪能解,甚至没有让科学人士明白,就科普而言,那是相当的失败。

看我能不能用大白话说明白这事儿:

我们人类的语言说简单也简单,说复杂也复杂。简单到不管多笨的人,也大都从小就学会了语言,交流没问题。但是人学会语言,大多知其然,不知其所以然。只有专门研究语言的语言学家一直在尝试对人类语言讲出点所以然来。可语言这玩意儿,不研究也就罢了,一研究就发现这是上帝的恶作剧,复杂得很,深不可测。

几千年的探索,总结出一种叫文法的东西,用它可以对语言的内在规律做一些总结,这样,千变万化的语句就可以分析成有限的句型结构,可以帮助语言理解和把握。人类本能的语言理解能力也因此显得有迹可循了。这就是我们在学校文法课上老师教给我们的知识,特别是一种语句分析的结构图的画法(grammar diagramming),条分缕析建立主语谓语宾语定语状语等结构联系,证明是一个很管用的语言分析技能。这一切本来是为了加强我们的语文能力。

电脑出现以后,就有人工智能的科学家想到,要教会电脑人类语言,这个领域叫自然语言理解(Natural Language Understanding),其核心是对人类语言做自动分析(parsing),分析结果往往用类似文法课上学到的树形图来表达。自动语言分析很重要,它是语言处理的核心技术。一个质量优良、抗干扰强(所谓鲁棒 robust)而且可以运行到大数据上面的自动分析引擎,就是个核武器。有了这样的自动分析,就可以帮助完成很多语言任务,譬如人机对话、机器秘书、情报抽取、舆情挖掘、自动文摘、机器翻译、热点追踪等等。(也有不少日常语言处理应用,譬如关键词搜索、垃圾过滤、文章分类、作者鉴定,甚至自动文摘和机器翻译,不分析,不理解,只是把语言当成黑匣子,把任务定义成通过黑匣子的从输入到输出的映射,然后利用统计模型来学习模拟,也可以走得很远。这些绕过了结构和理解的近似方法,由于其鲁棒性等优点,实际上是主流的主导性做法)。

自动分析语言方面,英语研究得比较充分。中文还刚刚在起步阶段,原因之一,是中文比欧洲语言难学,歧义更严重,大规律少,小规律和例外较多,不太好捉摸。因此有不少似是而非的流行说法,什么,词无定类,入句而后定,句无定法,“意合”而已矣。总之,中文自动分析是一项公认的很有意义但非常艰难的任务。尤其是要教会电脑分析真实世界的社交媒体大数据中的形形色色文句,更是难上加难。就是这个中文自动分析的美梦,最近被实现了。

这样的成就可以不可以说是美梦成真呢?

[11]方锦清  2013-10-17 15:04

我看不懂啊,可以进一步解释一下?

博主回复(2013-10-17 19:18):

这是一个跨越1/4世纪科研美梦终成真的现实故事。故事的主人公做助理研究员的时候,满怀热情,不知天高地厚地为世界上最微妙的语言之一现代汉语,描绘了一幅自然语言理解(NLU)蓝图,其核心是对千变万化的中文文句施行自动语法分析。这幅蓝图距离现实太过遥远,其实现似乎非人力可为。然而,1/4世纪之后,积累加机缘,天时和地利,主人公终于实现了这个理想,正在投入真实世界的大数据应用。
The mission impossible accomplished.

征文在此,请支持:【征文参赛:美梦成真】

 

【美梦成真】

  • 这是一个跨越1/4世纪科研美梦终成真的现实故事。故事的主人公做助理研究员的时候,满怀热情,不知天高地厚地为世界上最微妙的语言之一现代汉语,描绘了一幅自然语言理解(NLU)蓝图,其核心是对千变万化的中文文句施行自动语法分析。这幅蓝图距离现实太过遥远,其实现似乎遥遥无期,非人力可为。然而,1/4世纪之后,积累加机缘,天时和地利,主人公终于实现了这个理想,正在投入真实世界的大数据应用。The mission impossible accomplished.

二十五年了,中文之心,如在吾庐,一日不曾忘记!拔高一点说,对于语言学家,中文之心可以说是梦萦魂牵的海外流浪人的中国心。

   很多年了,由于工作的原因,一头扎进英语处理的海洋沉浮。直到近两年,英语已经无可再做,该做的差不多都做了,不该做的也神农尝草,遍历辛苦。大山大水已然身后,而且已经大数据实用化了,应该可以放下。近几年来,随着白发的繁盛,岁月的流逝,忧虑之心油然而起。弹指一挥,逝者如斯,怕这辈子没有机会回到中文处理上来,那将抱憾终身。
   都说中文是世界上最诡秘、最玄妙、最不讲逻辑,自然也是最难机器处理的语言。有人甚至声称中文无文法,中文理解全靠“意合”,是对机器自然语言理解和人工智能前所未有的挑战。目的地如此高远,而现状却相当悲惨,中文处理整个领域深陷在汉字串切词的浅层漩涡长达数十年不能自拔。切词是什么?最多算万里长征的前十步而已。
   25年了,许多思考、想法,在头脑绕了很多年,一直未及实现,现在是时候了。这辈子不爬中文的珠穆朗玛,枉为华裔语言学博士。陶先生说:归去来兮,田园将芜胡不归?

喝令三山五岳开道,中文处理,我回来了!

出道之初的上世纪80年代,我为一家荷兰的多语机器翻译BSO项目,参照英文依存文法,设计过一个【中文依存文法】,涵盖了现代汉语几乎所有的重要句型,画过无数的中文依存关系句法树,看上去真地很美。但那只是纸上谈兵。虽然设计这套文法是为机器处理,真要实现起来谈何容易。事实上,在当时那只能是一场科研美梦。这一梦就是25年!

现在回看当年的蓝图,对照最近在机器上实现的依存句法分析器,一脉相承,感慨万千。年轻时就有绿色的梦,那么喜欢树,欣赏树,着迷画树,好像在画天堂美景一样体验着绿之美,梦想某一天亲手栽培这颗语言学之树,为信息技术创造奇迹。如今终于迎来了实现的曙光,天时地利人和,研发的辛苦与享受已然合一,这是何等美妙的体验。

请欣赏青年立委当年“手绘”的粗糙又精致的句法树蓝图的几段截屏(可怜见地,当时只能用纯文本编辑器数着空格和汉字去“画树”,就如我年三十在机房数着字符描画山口百惠并用IBM-PC制成年历一样)。对照新鲜出炉的中文句法分析器全自动生成的婀娜树姿,我不得不说,美梦成真不再是一个传说。

(1) 25年前的蓝图(美梦):

25年后的实现(成真):
(2) 25年前的蓝图(美梦):

25年后的实现(成真):

(3)25年前的蓝图(美梦):

25年后的实现(成真):

(4) 25年前的蓝图(美梦):

25年后的实现(成真):

但那时我在上海也有一个惟一的不但敢于随便谈笑,而且还敢于托他办点私事的人,那就是送书去给白莽的柔石。

(5) 25年前的蓝图(美梦):

25年后的实现(成真):

(6)25年前的蓝图(美梦):

25年后的实现(成真):

胶合板是把原木旋切或刨切成单片薄板, 经过干燥、涂胶,  并按木材纹理方向纵横交错相叠, 在加热或不加热的条件下压制而成的一种板材。
 

 

【相关篇什】

初稿(2012-10-13 ):科学网—【立委随笔:中文之心,如在吾庐】

汉语依从文法: 维文钩沉(25年前旧作,浏览器下请选用国标码 GB 阅读以免乱码和图形失真)】:
ChineseDependencyGrammar1.txt
ChineseDependencyGrammar2.txt
ChineseDependencyGrammar3.txt

立委科普:语法结构树之美 (英文例示)】

立委科普:语法结构树之美(中文例示)】

【立委科普:美梦成真的通俗版解说】

【立委科普:自然语言parsers是揭示语言奥秘的LIGO式探测仪】 

【离皇冠上的明珠只有一步之遥的感觉】

关于 parsing

【关于中文NLP】

【置顶:立委NLP博文一览】

《朝华午拾》总目录

 

 

【一日一parsing,而山不加增,何苦而不平?】

"终于冰箱安装到位了, 欣喜之余发现有点儿小问题, 就联系了店家, 店家主动帮助联系客服上门查看, 虽然最终没有解决问题, 心里有点儿遗憾, 但是因为不影响使用, 所以也就无所谓了."  这一句够复杂的,目前酱紫滴:

“店家” 与 “主动帮助”在主语之外,语义中间件给做了逻辑宾语,是 overkill,以为帮助的 subcat 的宾语没有 saturated,但是 动词性宾语ObjV 也算宾语的,这个调整一下可以 fix
最后的错误是远距离,“虽然” 应该找到 “但是”的,是强搭配,但里面有几个小句挡路。“但是”前面的小句没关系,反正是强搭配,抽着鞭子跑马也不怕越位,可是“但是”后面又来了个“因为 。。。所以”,这个嵌套有点讨厌:“但是”的落脚点因此不在第一小句,而在第二小句“所以”上。换句话说,人的理解是,“虽然”引导的让步状语从句应该长距离落实在最后的“无所谓”上,才符合句法语义逻辑。社会媒体似乎是不经意写出来的句子,也有这种繁复的小句嵌套的长距离句法问题(贴帖的人大概是个知道分子老九,大老粗没那么多“因为所以”“虽然但是”的,而且嵌套)。最后,“联系客服上门查看”还有个 subcat 词典没到位的 bug,小 case 了,不难纠正。small bugs are de-ed:

白:
这问题问的

我:
这事儿做的。
这澡洗的。
这牛吹的。
这问题问的。那叫一个水平。
这日子过的。那叫一个窝心。
这戏演的,那叫一个烂。
这话说的,那叫一个高。
感慨或惊叹的口语句式,句法主谓,逻辑述宾:这OV的。默认似乎负面,但正面也不少见。
这OV的 --》瞧人家这OV的
--》【human】+这+OV+的+标点
底层结构应该是:human+V+O+V+得+【】(补语省略)
他问问题问得【那叫一个水平】
他过日子过得【那叫一个窝心】
他演戏演得【烂】
他说话说得【高】

0822a

0822b

0822c

0822d

0822e

 

 

【相关】

【离皇冠上的明珠只有一步之遥的感觉】

关于 parsing

【关于中文NLP】

【置顶:立委NLP博文一览】

《朝华午拾》总目录

【语义计算沙龙:从“10年中学文化课”切词谈系统设计】

我:
毛老啊,1966-1976 10年文革,是我十年的中小学,我容易吗?10年中学文化课的时间不到一半,其余是学工学农学军。学赤脚医生 学开手扶拖拉机。
为什么是 【十年中】【学文化课】不是 【十年中学】【文化课】?

Guo:
@wei 单就这句,确实两可。但你后面有这么多的"学"……
至少对这个例子,统计,"深度神经"RNN之类还是有merit的。当然,这两种解析其实也没本质的区别。不必多费心思。

我:
怎讲?因为“学”频率高 所以“中学”成词就不便?统计模型在这个case怎么工作显示merit呢?愿闻其详。
大数据说 有五年中学 有六年中学,极少见十年中学,反映的是中学学制的常识。但是这个知识不是很强大,很难作数,因为这不是 positive evidence。如果句子在 “六年中学” 发生边界纠纷的时候 得到来自大数据的直接支持,那是正面的 evidence,力量就很强。负面证据不顶事儿,因为它面对的是 【非六】(或【非五】)的大海,理论上无边无沿,那点儿证据早被淹没了。

Guo:
统计分long term / global vs short term / local.

你讲的"大数据",其实是在讲前者。

现在热的"深度神经",有些是有意无意地多考虑些后者。例如,深度神经"皇冠上的明珠"LSTM即是Long Short Term Memory。虽非显式地求取利用"即时统计",那层意思还是感觉的到的。

我:
@Guo 恩。这个 local 和 global 之间的关系很tricky
0821e

这个貌似歪打正着的parse应该纯粹是狗屎运,不理论。

白:
N+N的得分本来就低 有状语有动词的更加“典型” N+N是实在没招了只能借助构词法解决零碎的产物 有状语有动词时谁还理N+N。不管几年中学,也抗衡不了这个结构要素。就是说,同样是使用规则,有些规则上得厅堂,有些规则只能下得厨房。如果没有上得厅堂的规则可用,随你下厨房怎么折腾。但是如果有上得厅堂的规则可用,谁也不去下厨房。

我:
这里不仅仅是 N+N 的问题,在绝大多数切词模块中,还没走到N+N这一步,因此这个问题实际上可能挑战不少现存的切词程序:十年/中学/文化课 or 十年中/学/文化课 ?
有一个常用的切词 heuristic 要求偏向于音节数均匀的路径 显然前者比后者均匀多了。

白:
句法上谈多层,也是“狗/咬吕洞宾”, 不是“狗咬/吕洞宾”

我:
真正的反例是交叉型的。
句法怎么谈层次 其实无关 因为多层的切词不过是一个技术策略,(通常)本身并不参与 parsing,最终的结果是 狗/咬/吕洞宾 就行了。其实 即便论句法 SVO 层次 在汉语中还是颇有争论的 不像西方语言里面 V+NP 的证据那么充分。

白:
这有点循环论证了

我:
目前的接口是这样的 多数系统的接口是。切词的结果并不存在层次,虽然切词内部可以也应该使用层次。肯定有研究型系统不采用这样的接口,但实用系统中的多数似乎就是这样简单。

白:
都保留也没啥,交给句法处理好了,谁说一定要分出个唯一结果再交上去,很多系统接受词图而不是词流了。对于神经网络这种天然接受不确定性的formalism而言,接受词图并不比接受词流多什么负担。

我:
数据结构多了维度,对于传统系统,涉及面蛮大的。词不仅仅是词,词本身不是一个简单的 object。以前的系统词流就是string 或最多是 token+POS list 对那样简单的结构增加维度还好。

白:
词和短语一样可以给位置加锁解锁 竞争位置的锁

我:
不错,词是一切潜在结构的发源地,蕴藏了很大潜能,甚至在设计中,应该让词典可以内建结构,与parsing机制一体化。这种设计思想下的词 增加维度 就是带着镣铐跳舞 不是容易处置好的。nondeterministic 是一个动听但不太好使的策略。否则理论上无需任何休眠与唤醒。

白:
可以参数化,连续过渡。处理得好,管子就粗些。处理不好,管子就细些。极端就回到一条线。一个位置允许几个词竞争锁,可以参数化。超出管子容量的,再做休眠唤醒。

我:
多层系统下的 nondeterministic 结构,就好比潘多拉的盒子。放鬼容易降鬼难,层次越多越是这样。也许机器学习那边不怕,反正不是人在降服鬼。

白:
其实一个词多个POS,或者多个subcat,机制是一样的。不仅有组合增加的一面,也有限制增加的一面。不用人降服鬼,鬼自己就打起来,打不赢没脸见人。只要制定好“见人”的标准,其他就交给鬼。

我:
这就是毛主席的路线 叫天下大乱达到天下大治。文革大乱10年国民经济临近崩溃的边缘,但没有像60年那样彻底崩盘,除了狗屎运,还因为有一个绝对权威在。这个权威冷酷无情 翻脸不认人。今天红上了天的红卫兵造反派 明天就下牢狱。

白:
鬼打架也是有秩序的,不是大乱,是分布式表示。

我:
这样的系统大多难以调试 等到见人了 结果已定局 好坏都是它了 斯大林说 胜利者是不受指责的。

白:
局部作用,高度自治

我:
鬼虽然是按照人制定的规则打架。具体细节却难以追踪 因此也难以改正。当然 这个毛病也不是现在才有的 是一切黑箱子策略的通病。

白:
不是黑箱子,是基于规则、分布式表示、局部自治。打架的任何细节语言学上都可解释。理论上,如果词典确定,所有交集型分词歧义就已经确定,是词流还是词图,只是一个编码问题。如果再加上管子粗细的限制,编码也是高度可控的。

我:
刁德一说 这茶喝到这儿才有了滋味。看好白老师及其design

白:
“10年”说的究竟是时长(duration)为10年的时间段,还是2010年这一年的简称,也是需要甄别的。

 

【相关】

 

【置顶:立委NLP博文一览】

《朝华午拾》总目录

【一日一parsing:汉语单音节动词的语义分析很难缠】

白:
“她拿来一根漂亮的海草,围在身上做装饰物。”

我:
0821a

“围” 与 “做” 的逻辑主语阙如。原因之一是这两个动词本身的subcat没有要求“她”【human】或“海草”【physical object】。语义中间件目前是保守策略,因为逻辑填坑是无中生有,宁缺毋滥,rather underkill than overkill,精度优先。

人的理解是怎么回事呢:单个儿的“围”不好说,但是VP【围在身上】从“身上”继承了【human】的未填之坑,正好让“她”填做逻辑主语。同理,“做”是万能动词,也没有特定语义要求的坑,但是VP【做装饰物】(act as NP)则挖了一个同位语的语义坑【physical object】,可以让“海草”来填:【human】“把”(“用”)【physical object】“围在身上”;【physical object】“做装饰物”。
“围在身上”的句法主语可以是【human】,也可以是【physical object】:“一根漂亮的海草围在身上”。但是背后的逻辑语义都是 【human】为逻辑主语。

白:
此例引自小学一年级水平的课外读物

围,属于具有“附着、固定”subcat的动词子类,如果做话题,可以单独表示起始动作完成后的遗留状态。话题化 被固定物做话题

我:
而“海草”可以看做【工具】(包括【材料】状语),也可以看做是 VP【围在身上】内部的“围“的【受事】

白:
是逻辑宾语

我:
这是层次不同造成的逻辑角色的不同。
实际上,对这一类汉语单音节动词做如此细致的语义分析,挑战性很大。它们太多义了,只有组成合成动词、甚至形成 VP 以后,才逐渐排除多义而收心。这个动态的 subcat 的确定和填写过程,相当繁难,if not impossible。

白:
房子盖在山上做行宫

我:
0821b

“盖-房子”算合成词。
again “做” 的逻辑主语(深层同位语)没连上“房子”。

白:
他给你打了一副手镯当嫁妆

我:
0821c
SVO 齐活了,主句的O却断了。这叫顾腚不顾头,需要好好debug一哈:

0821d

这个比较完美了。也把“打手镯”当成“打酱油”一样做进离合词了。这样处理很重要,因为“打”是个万能动词,不知道有多少词义(如果考虑搭配中的词义的话)。

 

【相关】

【离皇冠上的明珠只有一步之遥的感觉】

关于 parsing

【关于中文NLP】

【置顶:立委NLP博文一览】

《朝华午拾》总目录

《朝华午拾: 与女民兵一道成长的日子》

我1976年高中毕业下放到皖南山区烟墩镇旁的尤村。不久赶上了“双抢”(抢收早稻,抢种晚稻),真地把人往死里累。双抢是一年挣工分的好季节,给双份工分,有时甚至给三倍,连续20多天,天不亮起床,到半夜才回,再壮的汉子都要累趴下才能休息半天。人民公社给双倍工分这种变相的资产阶级的“物质刺激”很厉害,不管多累,人都不敢懈怠,你怕累少上工,工就给别人赚去了,到年底分红,你分的稻谷、红薯和香油也相应减少了。其实,羊毛出在羊身上,每年生产队的收成是一个定数,工分多给少给不过是一种财富再分配的方式而已。如果单纯依靠农民的社会主义干劲,双抢跟平时同等工分数,工分总量下来了,单位工分的价格提高了,就没有物质刺激出来的积极性了。谁说经济学在一大二公的人民公社没有用处?

生产队照顾城里娃,工分给高些。于是给我们三个知青各开七分半工,相当于一个妇女全劳力的工分,包括早饭前上早工两个小时,否则只有六分半。那年十分工值RMB0.65元。我在妇女堆里干了半年多,年底分红,赚回了所有的口粮,外带半床红薯和四五斤香油。

妇女全劳力多是年轻的姑娘或媳妇,个个都是干农活的好手。尤村的10几个风华正茂姑娘组成了一个“女民兵班”,不甘寂寞,活动有声有色,曾名噪一时。不过到我去的时候,已经式微,因为其中的骨干大都到了嫁人的年纪,近亲远媒各处张罗,集体活动不能继续。尽管如此,跟女民兵在广阔天地一道成长,在当时是充满了革命浪漫主义的色彩的,让人沉迷和兴奋。干农活的辛苦也去了大半。

我们村村长人很精明,但脾气暴躁,又是秃头,看上去恶心。倒是他家三个姐妹一个个如花似玉,大妹妹二妹妹都是女民兵班的主力,小妹妹刚14-5岁,皮肤白嫩,见人脸红,在社办一个作坊里做工。大妹妹刚嫁给本村一个高个子,有模样无脑袋的傻小子,自由恋爱的,算是姑娘们中最幸运的了,可还是鲜花插错了地方。刚去不久,这位大妹子被照顾在场上打谷,没有下水田。我跟她一起干活,场上就两个人,总是她照顾我,从那时就落下了心猿意马的毛病,直到有一天发现她肚子越来越大,才意识到她跟其他民兵姑娘不同,原来是媳妇级的了。后来跟那个二妹子及一帮姑娘媳妇一道,在田里薅草(就是用耙子在水田里把杂草掀翻,不让杂草长出来),二妹子总是侵犯我的领地,把她的耙子探过来帮我。没有她帮忙,我大概一半的速度也赶不上。我老指责她,“不许侵犯”,她总笑而不答,我行我素。二妹子模样很好,稍微有些胖,很壮实,象个铁姑娘,但善解人意,脾气性情好得赛过薛宝钗,是我最心仪的。可当时媒婆正在给她提亲,我离开村子不久,她就远嫁了,听到消息后心里很不是滋味。

这些农家女在我看来都是仙女。从小在那样的艰苦环境中,却一个个风华正茂,英姿飒爽,而且不失农家女的善良朴实和冰雪聪明。我觉得当地没人配得上她们,她们自己也企图跟命运和媒人抗争,不过最后都一个个嫁走了,消没在人海中。

【相关】

《毛时代的最后知青》

【朝华午拾集锦:立委流浪图】

《朝华午拾》总目录(置顶)

《毛时代的最后知青》

我是文革后最后一批插队的,算是赶上了末班车。当时岁数不够,按照政策可以留城,可是当年的情形是,留城待业常常是永久失业,不象插队,几年之后,还有上调招工或者升学(工农兵学员)的前途。另外就是,由于时代风尚的影响,留城的好像比下乡的矮人一截似的。我有一位同班好友,独子,留城以后,见面说话就没有我们下乡知青那样器宇轩昂。 

插队的故事对我是太久远了,恍如隔世。这也是我一直想写,却感觉心有余而力不足的原因。虽然如此,插队的片断却不时在心中翻腾。虽然连不成篇,这些记忆残片却是刻印在脑海最深处的。 

我插队的地方是比较偏远的皖南山区,叫尤村,就在镇子旁边。当时一起下到这个村子去的一共三位,陈兄是中医世家,人很老成憨实,带来了大半箱子医书。曾兄是退伍军人的子弟,有点吊儿郎当玩世不恭的样子。我随身携带的是薄冰《简明英语语法》和一台晶体管中波收音机,希望还能继续电台《广播英语》的学习。我们三人从镇上一下车,就被尤村的老书记带领一伙人敲锣打鼓迎到了村里,暂时安置在一位公社赤脚医生的家里,住了两个月。后来村子利用国家发给我们三人的安家费,盖了三大间仓库一样透风凉的屋子,我们才算独立安家落户。 

第一个月是吃大户。每天各家各户轮流吃。农民大多朴实好客,我们吃饭的那天,东家往往要比平时多预备一些菜肴。可是,各家家境不同,伙食还是参差不齐,有些确实难以下咽,但又怕人笑话知青娇气,只好硬着头皮吃。最糟糕的不是伙食的质量,而是卫生状况。有一天天擦黑,推门去晚餐,手上黏黏糊糊摸了一手,回来后我们几个一合计,发现不是鼻涕就是浓痰的残迹,都恶心得要吐。 

后来决定哥仨自己开伙,分工合作。还记得清晨起来到河塘担水,身子骨瘦小的我与水桶不成比例,在早春的冷风中瑟瑟发抖。不过,自己开伙还是受用多了,每天干活就满心盼望早早收工去享用自己的晚餐。最常做最美味的菜肴是咸肉炖黄豆。咸肉是父母捎来改善伙食的,每次割一小块肥肉,慢火烧化,那泛着油光的软黄豆实在太诱人了。黄豆和木炭都是队里照顾知青配给的,弄个小瓦罐盛上黄豆、肥肉和水,上工前置于炭火上,收工回来就四香飘溢。 

这样的美味当然不能长久。于是自己种菜。我们图省事,挑最容易的菜,种了两大片黄瓜。黄瓜这玩意儿,一旦结起来,就不得了,瓜满为患。怎么摘怎么吃也赛不过它生长的速度。平时没事就摘了生吃,到了晚上再做黄瓜汤,或者炒黄瓜,直吃得想吐。这个后遗症不小。很久很久,我都把黄瓜当作最贱的菜,偶然生吃一点可以,从来不拿它当菜。可是斗转星移,不知流浪海外的何年何月,黄瓜忽然金贵起来。太太和女儿都爱吃。暖房子里面出来的英国黄瓜,每根两三块美元,一样成为我们家的必备。有时伙食中蔬菜量不够,怕孩子营养不平衡,就洗根黄瓜给她,她总是美滋滋地啃它,从不厌烦。 

黄瓜确实不好做菜,要是赶上了鸡蛋,炒菜也好,做汤也好,都不错。单做就不成菜,不下饭。鸡蛋是非常珍贵的,我们不养鸡自然没有鸡蛋,也舍不得买。后来还是村子里有人从我们知青这里借钱急用,可又没有钱还,就从鸡屁股下抠出一些鸡蛋来偿还我们,我们才有了些口福。有一天秃头队长来巡视,看见我们的黄瓜地,就狠狠剋了我们一顿。说,你们这帮懒虫,谁让你们种黄瓜来着,一点正经菜也不种,你吃个屁。他所谓正经菜,是指辣椒茄子一类,那样的菜只要有点菜籽油,不用鸡蛋不用肉,就可以做得让人垂涎欲滴。可是拾叨起来不容易,除了浇水,还要施肥,最好是粪兑水浇了才好长。 

黄瓜吃腻了,后来没的好吃,改吃炒山芋(北方叫红薯)。这一招说来还是村里那个放牛娃教给我的。这个放牛娃很机灵,自从我们知青来了,就总找机会来套瓷。是他告诉我,山芋也一样可以做菜,就跟炒土豆丝一样做法。山芋是口粮,我们不缺,于是我们尝试切丝红炒,添上油盐,做出来比黄瓜好吃下饭多了。不过,有一条与土豆丝不同,炒菜的火候一定要适可而止,否则烂成糊就不好吃了。 

从放牛娃那里学会了骑牛。别看老牛笨乎乎的,走起路来却非常稳妥实在,一步一个脚印。起初我看田埂头的羊肠小道,老觉得那老牛一不小心就会折到沟渠或水田里,其实老牛从不出差错。放牛娃吆喝一声,那老牛就乖乖地倾前身,低下犄角,我在牛娃的帮助和鼓励下,蹬着牛角,翻身上了牛背,开始胆战心惊的骑牛前行。骑牛的最大感受是不舒服,那老牛的脊背咯咯吱吱的,感觉不到皮肉,满屁股都是骨头,根本不象我以前想像中的牧童骑牛之乐。 

敲锣打鼓把我们迎进村的老队长跟我们走得最近。事无巨细,他都爱来管,自然充当了知青监管人的角色。我们插队的时候,正是老队长大家庭最鼎盛的时期:五个孩子,三男二女,人丁兴旺。老伴操持家务,任劳任怨,对人热情有加。大儿子山虎算我们哥们,比我略长,但长得比我还矮小一大截,似乎发育有问题,但干活并不赖,是个整劳力,担任队里的记分员。山虎小学毕业就回乡种田,作为长子,与女民兵姐姐一起,帮助父亲分担家庭重负。三个劳力,加上两个弟弟拾粪、放鸭,放学做点零工,一家人挣足了工分。这个家庭的红火兴旺,加上老队长的威信,可与家有三朵金花的秃头队长一比,这两大家是村子里六七十户人家里面的显赫人家。老队长的家也是我们的家,在他家里我们感觉在自己家一样地自在。一家都是热心人,包括最小的六岁女儿,我们一来,就手舞足蹈,欢呼雀跃。家里做了好吃的,老队长就把我们叫去。大娘从不抱怨,总是笑吟吟默默在一旁伺候我们吃喝。

山虎很活跃,实诚热心,跟我们知青亲如兄弟,给了我们很多帮助。他总是随身带着他的记分簿,满本子是他的涂鸦,只有他自己能看懂的那些工分记录。我见过不少字写得差的人,我自己也一手烂字,可把汉字写到他那样难看,那样奇形怪状,不可辨认,还真不容易。我离开尤村上大学期间,我们一直保持着联系,每次读他的信都要辨认老半天才能猜八九不离十。他每封信尾总是画点图示,两只手紧握啊,或者一颗心系上一条线,朴素地表示他对我们友谊地久天长的祝愿。

老队长是村里德高望重的人物,他清瘦黝黑,尖小巴,身子骨健朗,谈笑如洪钟。他哪年当的队长,哪年让位给秃头小队长,我们不很清楚。只知道老队长是退伍军人,识文断字,见多识广,是尤村的核心。我们的到来使老队长异常兴奋。他跑前跑后,张罗安排,滴水不漏。只有一件事,我感觉有些滑稽,内心有抵触,却不敢流露:老队长雷打不动,每周要组织我们政治学习和座谈一次,一学就是一夜。每当这个时候,老队长就把家里的大小孩子统统驱离,把煤油灯点得亮亮的,一点不心疼熬油。他不苟言笑,正襟危坐,特别严肃深思的样子。记得他组织学习《哥达纲领批判》,一字一板地阅读,那样子很象个教授,可从来也没见他有自己的讲解。对于马列,我只在中学迷恋过“政治经济学”,对于其他著作不是很懂。我听不明白的,他其实也不懂,毕竟他也就小学毕业的文化程度。当时我就好奇,他心里在想什么。为什么对那些深奥难懂的马列原著那么热衷,而且总摆出若有所思的样子。我当年自觉是个小毛孩,老队长是可敬有威的长者,是我们的依靠,即便心里有疑惑,也从不敢追问。这样的学习一直持续到我离开尤村。

老队长唱歌富有磁性,略带沧桑,很有魅力。记得在水田薅草的时节,暖洋洋的阳光,绿油油的禾苗,春风和煦。老队长一边薅草,一边张池有度地唱起歌来。听上去有点象船工号子,声音高高低低的,随着风,一波一波袭来,抑扬悠长,不绝如缕。那是怎样一种有声有色,和谐无间,引人遐想的农耕图景啊。

很多年过去,老队长的歌声却一直留在我的记忆中,虽然我从未搞清这首歌的来历。直到去年,女儿的 iPod 新增的一首歌,一下子把我抓住了。这歌当然不是老队长的歌,可曲调内蕴与老队长的歌神似,是它复活了我心中掩埋已久的歌。每当歌声响起,我就沉浸在遐想之中。老队长的面容身影,广阔天地的清风和日,单纯悠长的田家生活和劳动的场景,就在我眼前浮现。 我问女儿这是什么曲子。女儿一副我是土老冒的惊讶,这是 Akon 啊,那首红透半边天的歌曲 don’t matter 啊。这首黑人歌曲2007年一出品,很快在电台热播,连续两周居于排行榜首。我惊喜,也感到诧异,远隔千山万水,神秘古老的中国民间小调居然与带有美国非裔色彩的黑人歌曲如此契合。甚至我在 Akon 本人身上也隐约看到黑瘦干练的老队长的身影。

http://www.tudou.com/programs/view/FfPXSuKQ6Jw/?spm=0.0.FfPXSuKQ6Jw.A.ouYVF5
Akon “Don’t Matter”

请移步欣赏场面火爆的现场表演(需要翻墙):
https://youtu.be/JWA5hJl4Dv0

 

我大学毕业的时候曾回村探望,那时老队长已经离开人世,是癌症夺走了他的生命。女儿远嫁,传回的消息是女婿赌博被抓进了局子,二儿子肝炎送了性命。大娘经受这种种打击,显得衰老无语。家庭再也没有了欢声笑语,只有山虎撑着这个家,快30的人了一直未娶媳妇。谈起来,他总是苦苦一笑,说不急,先把弟妹上学供出来,自己的事可以放一放。我的心沉沉的,感伤世事无常,那么鼎盛兴旺的大家先失了顶梁柱,复遭种种不幸,如今如此零落。那记忆深处的歌声在我心中也更加增添了些许沧桑的苦涩和无奈。

至于原歌,现在也忘记具体曲调了,就是那种陶醉心迷的印象还在。认准了 Akon 以后,今天就是真的那个曲子再现,我不敢肯定我是否还能识出来。 就 Akon 吧。记忆已经外化,有个落实处,挺好的。

【相关】

《朝华午拾:与女民兵一道成长的日子》

【朝华午拾集锦:立委流浪图】

《朝华午拾》总目录(置顶)

【离皇冠上的明珠只有一步之遥的感觉】

1471802218_457583

parsing 是最好的游戏,而且实用。

据说好玩的游戏都没用,有实用价值的东西做不成游戏。但是,对于AI人员,parsing 却是这么一个最好玩但也最有用的游戏。纵情于此,乐得其所,死得其所也。

禹:
李老师parser有没有觉得太烧脑呢?
做parser少了个做字。感觉上先是一个比较优雅的规则集,然后发现规则之外又那么多例外,然后开始调规则,解决冲突,然后'整理规则的事情还得亲力亲为,做好几年感觉会不会很烦?

我:
不烦 特别好玩。能玩AI公认的世界级人类难题且登顶在望,何烦之有?
烦的是好做的语言 做着做着 没啥可做了 那才叫烦。英语就有点做烦了。做中文不烦 还有不少土地没有归顺 夺取一个城池或山头 就如将军打仗赢了一个战役似的 特别有满足感。

梁:
收复领地?

我:

【打过长江去,解放全中国!】

parsing 是最好的游戏。先撒一个default的网,尽量楼。其实不能算“优雅的规则集”,土八路的战略,谈不上优雅。倒有点像原始积累期的跑马,搂到越多越好。然后才开始 lexicalist 的精度攻坚,这才是愚公移山。在 default 与 lexicalist 的策略之间,建立动态通信管道,一盘棋就下活了。
譬如说吧,汉语离合词,就是一大战役。量词搭配,是中小战役。ABAB、AABB等重叠式是阵地战。定语从句界限不好缠,算是大战役。远距离填坑,反而不算大战役。因为远距离填坑在句法基本到位之后,已经不再是远距离了,而且填的逻辑SVO的坑,大多要语义相谐,变得很琐碎,但其实难度不大。(这就是白老师说的,要让大数据训练自动代替人工的语义中间件的琐碎工作。而且这个大数据是不需要标注的。白老师的RNN宏图不知道啥时开工,或已经开工?)

parsing 是最好的游戏。一方面它其实不是愚公面对的似乎永无尽头的大山,虽然这个 monster 看上去还是挺吓人的。但大面上看,结构是可以见底的,细节可以永远纠缠下去。另一方面,它又是公认的世界级人类难题。不少人说,自然语言理解(NLU)是人工智能(AI)的终极难题,而 deep parsing 是公认的通向NLU的必由之路,其重要性可比陈景润为攀登哥德巴赫猜想之巅所做出的1+1=2.  我们这代人不会忘记30多年前迎来“科学的春天”时除迟先生的如花妙笔:“自然科学的皇后是数学。数学的皇冠是数论。哥德巴赫猜想,则是皇冠上的明珠。...... 现在,离开皇冠上的明珠,只有一步之遥了。”(作为毛时代最后的知青,笔者是坐着拖拉机在颠簸的山路回县城的路上读到徐迟的长篇报告文学作品【哥德巴赫猜想】的,一口气读完,头晕眼花却兴奋不已。)

不世出的林彪都会悲观主义,问红旗到底要打到多久。但做 deep parsing,现在就可以明确地说,红旗登顶在望,短则一年,长则三五年而已。登顶可以定义为 open domain 正规文体达到 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博文一览】

《朝华午拾》总目录

The mainstream sentiment approach simply breaks in front of social media

I have articulated this point in various previous posts or blogs before, but the world is so dominated by the mainstream that it does not seem to carry.  So let me make it simple to be understood:

The sentiment classification approach based on bag of words (BOW) model, so far the dominant approach in the mainstream for sentiment analysis, simply breaks in front of social media.  The major reason is simple: the social media posts are full of short messages which do not have the "keyword density" required by a classifier to make the proper sentiment decision.   Larger training sets cannot help this fundamental defect of the methodology.  The precision ceiling for this line of work in real-life social media is found to be 60%, far behind the widely acknowledged precision minimum 80% for a usable extraction system.  Trusting a machine learning classifier to perform social media sentiment mining is not much better than flipping a coin.

So let us get straight.  From now on, whoever claims the use of machine learning for social media mining of public opinions and sentiments is likely to be a trap (unless it is verified to have involved parsing of linguistic structures or patterns, which so far has never been heard of in practical systems based on machine learning).  Fancy visualizations may make the results of the mainstream approach look real and attractive but they are just not trustable at all.

Related Posts:

Why deep parsing rules instead of deep learning model for sentiment analysis?
Pros and Cons of Two Approaches: Machine Learning and Grammar Engineering
Coarse-grained vs. fine-grained sentiment analysis
一切声称用机器学习做社会媒体舆情挖掘的系统,都值得怀疑
【立委科普:基于关键词的舆情分类系统面临挑战】

Why deep parsing rules instead of deep learning model for sentiment analysis?

aaa

(1)    Learning does not work in short messages as short messages do not have enough data points (or keyword density) to support the statistical model trained by machine learning.  Social media is dominated by short messages.

(2)    With long messages, learning can do a fairly good job in coarse-grained sentiment classification of thumbs-up and thumbs-down, but it is not good at decoding the fine-grained sentiment analysis to answer why people like or dislike a topic or brand.  Such fine-grained insights are much more actionable and valuable than the simple classification of thumbs-up and thumbs-down.

We have experimented with and compared  both approaches to validate the above conclusions.  That is why we use deep parsing rules instead of a deep learning model to reach the industry-leading data quality we have for sentiment analysis.

We do use deep learning for other tasks such as logo and image processing.  But for sentiment analysis and information extraction from text, especially in processing social media, the deep parsing approach is a clear leader in data quality.

 

【Related】

The mainstream sentiment approach simply breaks in front of social media

Coarse-grained vs. fine-grained sentiment analysis

Deep parsing is the key to natural language understanding 

Automated survey based on social media

Overview of Natural Language Processing

Dr. Wei Li’s English Blog on NLP

 

【语义计算沙龙:语序自由度之辩】

刘:
WMT2016上有一篇文章,讨论了语言的语序自由度,结论很有趣,见附图。根据这篇论文统计,汉语和英语之间语序关系是最稳定的(注意:语序关系稳定与语序一致不是一回事),比其他语言稳定度都高出许多。日语虽然是粘着语,但跟英语的语序关系也是相当稳定的。相反,德语虽然跟英语亲缘关系很近,但其相对语序的自由(不稳定)程度相当高。

916632021314869711
论文链接 http://www.statmt.org/wmt16/pdf/W16-2213.pdf

我:
这个研究是说,如果这些语言要与英语做自动翻译,语序需要调整多少?
英语相对语序很固定,加上是最流行的语言,拿它做底来比较,对于各语言的相对语序自由度应该是不离谱的。但是,从(平行)大数据来的这些计算,与这些语言的语言学意义上的语序自由度,有差别:
譬如 Esperanto 的语序自由度应该很大,怎么排列,意思都不变,但是由于很多人可能思想是用英语的,写出来的时候下意识在头脑里面翻译成了世界语,结果跟机器翻译一样,人的懒惰使得表达出来的语序照着英语的样子相对固定起来,并没有充分利用语言本身本来有的那么大自由度。

汉语的语序自由度,语感上,比图示出来的,要大。但是,做这项研究的双英对照数据也许大多是正规文体(譬如新闻),而不是自由度更大的口语,因此出现这样的结论也不奇怪。虽然汉语是所谓孤立语,英语接近汉语,但没有那么“孤立”,汉语的语序自由度比英语要大。做英汉MT的 generation 的时候,需要调整词序的时候并不很多,多数情况,保留原词序,基本就凑合了,这是利用了汉语语序有弹性,相对自由度大的特点。汉英MT没亲手做过(除了博士项目在Prolog平台上做过的一个英汉双向MT的玩具),感觉上应该比英汉MT,需要做调序的时候更多。调序多容易乱套,特别是结构分析不到位的时候更容易出乱子,是 MT 的痛点之一。尽量少调序,警惕调序过度弄巧成拙,是实践中常常采取的策略。包括英语的定语从句,多数时候不调序比调序好,用的技巧就是把定语从句当成一个插入语似的,前面加个逗号或括号,适当把 which 翻译成“它”等等。

刘:
你说的有道理,这个研究是以英语为基准的,虽然严格说不是很合理,但还是靠谱的,英文英语语序是比较固定的。我们说汉语语序自由,我觉得是错觉。汉语语序是很不自由的。实际上,对一个语言来说,形态的复杂程度和语序的自由程度是成正比的。形态越复杂的语言,语序越自由。汉语没有形态,只能用语序来表示句法关系。因此是严格语序语言。不可能说一种语言既没有形态,又语序自由,那么这种语言基本上没法表达意义了。

白:
这个,需要分开说。一是subcat算不算形态,因为不是显性的标记,很可能不算。二是subcat是否提供了冗余信息使得一定范围内的语序变化不影响语义的表达,这是肯定的。

Jiang:
嗯!subcat这里指的是什么?

白:
比如“司机、厨师、出纳……”都携带human这个subcat,但是human并不是一个显示的形式标记。

我:
虽然大而言之形态丰富的语言语序自由度就大、形态贫乏的语言语序相对固定是对的,但汉语并不是持孤立语语序固定论者说的那样语序死板,其语序的自由度超出我们一般人的想象:拿最典型的 SVO patterns 的变式来看,SVO 三个元素,排列的极限是6种词序的组合。Esperanto 形态并不丰富,只有一个宾格 -n 的形态(比较 俄语有6个格变):主格是零形式(零词尾也是形式),它可以采用六种变式的任意一个,而不改变 SVO 的句法语义:

1. SVO Mi manĝas fiŝon (I eat fish)
2. SOV: Mi fiŝon manĝas
3. VOS: Manĝas fiŝon mi
4. VSO: Manĝas mi fiŝon
5. OVS: Fiŝon manĝas mi.
6. OSV: Fiŝon mi manĝas.

比较一下形态贫乏的英语(名词没有格变,但是代词有)和缺乏形态的汉语(名词代词都没有格变)的SVO自由度,很有意思:

1. SVO 是默认的语序,没有问题:
I eat fish
我吃鱼

2. SOV:
* I fish eat (英语不允许这个语序)
我鱼吃 【了】(汉语基本上是允许的,尤其是后面有时态小词的时候,听起来很自然)
虽然英语有代词的格变(小词直接量:"I" vs "me"), 而汉语没有格变,英语在这个变式上的语序反而不如汉语。可见形态的丰富性指标不是语序自由度的必然对应。

3. VOS:
* Eat fish I (英语不允许这个语序)
?吃鱼我(汉语似乎处于灰色地带,不像英语那样绝对不行,设想飞机空姐问餐:“吃鱼还是吃肉?”你可以回答:“吃鱼,我”)

4. VSO:
* Eat I fish (不允许)
* 吃我鱼 (作为 VSO 是不允许的,但可以存在,表示另外一种句法语义:吃我的鱼)
做VSO不合法,但有些灰色的意思,至少不像英语那样绝对不允许。

5. OVS:
* Fish eat I (不允许,尽管 I 有主格标记)
* 鱼吃我 (句子是合法的,但句法语义正好相反了 , 是 SVO 不是 OVS。句子本身合法,但做OVS非法。)

6 OSV:
fish I eat (合法,除了表达 OSV 的逻辑语义 这个语序,还表达定语从句的关系)
鱼我吃(合法,常听到,鱼是所谓 Topic 我是 S,逻辑语义不变)

总结一下,汉语在 6 个语序中,有 3 个是合法的,1 个灰色地带,2 个非法。英语呢,只有两个合法,其余皆非法。可见汉语的语序自由度在最常见的SVO句式中,比英语要大。

白:
不考虑加不加零碎的语序研究都是那啥。“鱼吃我”不行,“鱼吃得我直恶心”就行

我:
不管那啥,这个 illustration 说明,语序自由度不是与形态丰富性线性相关。也说明了,汉语往往比我们想象的,比很多人(包括语言学家)想象的具有更大的自由度和弹性。白老师的例子也是后者的一个例示。其实,如果加上其他因素和tokens,这种弹性和自由,简直有点让人瞠目结舌。汉语不仅是裸奔的语言,也是有相当程度随心所欲语序的语言。超出想象的语序弹性其实是裸奔的表现之一,思维里什么概念先出现,就直接蹦出来。而且汉语不仅没有(严格意义的)形态,小词这种形式也常常省略,是一种不研究它会觉得不可思议的语言。它依赖隐性形式比依赖显性形式更多,来达到交流。这对 NLP 和 parsing 自然很不利,但是对人并不构成大负担。

刘:
首先,语序变化以后意义发生变化,不说明语序自由,相反,正说明语序不自由。语序传达了意义。其次,语序变化以后要加词才能成立(鱼我吃了)也正好说明语序不自由。再者,这种简单的句子不说明汉语普遍语序自由。在绝大部分清晰下,汉语都是svo结构,个别情况下需要特别强调o的时候,可以把o放到最前面。语序自由的前提,是通过词尾变化明确了词在句子中的功能,这样的话,主谓宾不管怎么交换顺序,都不会搞混,所以语序自由。没有形态变化,不可能真正语序自由。
“小王打小张”,语序就不能随便调整。
“我爱思考”,“我思考爱”,意思完全不一样

我:
这要看你怎么定义语序自由了。你给的定义是针对格变语言做的,有宾格的语言,等于是把句法关系浓缩了标给了充当角色的词,它跑到哪里都是宾语是题中应有之意。但语序自由的更标准和开放的定义不是这样的,如果 SVO 是基本的语序,凡是与它相左的语序的可能性,就是语序自由,研究的是其自由度。这种可能性的存在就证实了我们在理解语言的时候,或者机器在做 parse 的时候,必须要照顾这种 linear order 的不同,否则就 parse 不了,就抓不住语序自由的表达。不能因为一种相左的语序,由于词选的不同,某个可能语序不能实现,来否定那种语序自由的可能性和现实性。

退一步说,你的语序自由是 narrow definition, 我们也可以从广义来看语序自由,因为这种广义是客观的存在,这种存在你不对付它就不能理解它。就说 “小王打小张”,SVO 似乎不能变化。但是 “小张小王打不过” 就是 OSV,不能因为这个变式有一个补语的触发因素,来否定语序的确改变了。pattern 必须变换才能应对这种词序的改变。

最后,汉语与英语的对比,更说明了汉语的语序自由度大于英语,否则不能解释为什么汉语缺乏形态,反而比形态虽然贫乏但是比汉语多一些形态的英语,表现出更多的语序自由。“鱼我吃了” 和 “我鱼吃了” 是一个 minimal pair,它所标示的语序自由的可能性,是如此显然。人在语序自由的时候仍然可以做句法语义的理解,说明了形态虽然是促进自由的一个重要因素,但不会是唯一的因素。隐性形式乃至常识也可以帮助语序变得自由。

“打小张小王不给力。”(这是VOS。。。)
“打老张小王还行。”

刘:
这两个句子里面“打”都是小句谓语,不是主句谓语。主句谓语是“给力”和“还行”。例子不成立。

我:
影响语序自由的,形态肯定是重要因素,其他的语言形式也有作用。小句也不好 主句也好,SVO 的逻辑语义在那里,谁打谁?我们在说SVO语序自由这个概念的时候,出发点是思维里的逻辑语义,就是谁打谁,然后考察这个谁1 和 谁2,在语言的 surface form 里面是怎样表达的,它们之间的次序是怎样的。。

刘:
这就强拧了。这么说the apple he ate is red. 也是osv了?apple he ate的逻辑关系在哪里。这么说英语也可以osv了?

我:
不错,那就是地地道道的 OSV:谁吃什么,现在这个【什么】 跑到 【谁】 和 “ate” 的前面去了,底层的逻辑语义不变,表层次序不同了。

说英语是 svo 语言,这种说法只是一种标签,并不代表英语只允许这个词序。英语的SVO 6 种语序中,前面说了,有两种合法常见,其他四种基本不合法。

刘:
如果你对语序自由是这样定义的话,那英语也是语序自由了。

我:
不是的。只能说语序自由度。英语的语序自由度还是不如汉语。汉语的语序自由度不如世界语,也不如俄语。世界语的语序自由度不亚于俄语,虽然俄语的形态比世界语丰富。

刘:
那我们不必争论了,我们对语序自由这个概念的定义不一样。

我:
不错,这是定义的问题。我的定义是广义一些。你的定义窄。

刘:
按照你的定义:Eating the apple he smiled. 英语还可以VOS

白:
beat him as much as I can
总而言之S是从相反方向填它的坑

禹:
俄语的我吃鱼这么多种语序也可以?当真现实就是这么用吗?

易:
@禹 俄语的语序确实很灵活,尤其在口语体中,但意思不会变,因为名词有六个格,施受关系基本不会乱。

白:
日语里面有个名句:きしやのきしやはきしやにきしやできしやえきしやした
除了动词,其他成分的位置也是各种挪来挪去

刘:
@白硕 这个日语句子什么意思啊?

白:
贵社的记者坐火车朝着贵社打道回府了
考验日语输入法的经典例子,流传了将近百年
据说是电报引入日本不久的事情
这么个拼音电文,没人知道啥意思
跟赵元任发明一音节文,有得一拼
格标记本来就是给语序重定向的,所以不在乎原来语序也是情理之中。
如果汉语的“把”“被”“给”“用”“往”一起招呼,也可以不在乎语序的。
被张三 把李四 在胡同里 打了个半死……

我:
广义说 介词也是格 也是形态,格通常是词尾形式,介词的本质却是一样的。
“被” 是主格,“给” 是与格,“用” 是工具格。

禹:
俄语格的问题,有没有需要三四阶语法模型才能确定的还是基本上就是看之前的动词或名词的类别

我:
格就是parsing依赖的形式条件之一。形态丰富一些的语言 parsing 难度降低
不需要过多依赖上下文条件。

 

【相关】

【语义计算:汉语语序自由再辩】

泥沙龙笔记:汉语就是一种“裸奔” 的语言

泥沙龙笔记:漫谈语言形式

关于 parsing

【关于中文NLP】

【置顶:立委NLP博文一览】

《朝华午拾》总目录

 

中文parsing:语义模块大有可为

白:
“放在行李架上的行李,请您确认已摆放稳妥。”----高铁的词儿。

我:
t0812a

t0812b
二者应该是等价的,现在接近了,还没等价。
想等价的话,条件已经具备:确认这样的词的前S(主语)与其后的OPred(动词性宾语),勾搭上,成为逻辑主谓,这是语义中间件很容易做的,因为条件清晰。
如果追求极致,那就动一下手术:(1)断掉原先的主谓(行李与确认);(2)建立新的主谓 (行李与摆放);(3)断掉原先的 OPred(谓词性宾语);(4)代之以 O-S(宾语从句)。这个也合情合理,条件同样清晰。
如果追求极致的极致,再进一步在主谓关系上加一层逻辑动宾关系,“摆放”的宾语是“行李”。这个可以在“摆放”上做,但必须在新的主谓确立以后再做,可做,稍微有点tricky。

t0812c

Hey @白老师报告,毛主席保证:
mission impossible accomplished in semantics module
中间件大有可为。现在要做一下regressions测试了。
极致的极致,不能如此得来全不费工夫吧。

白:
“坐在座位上的旅客,请您确认您的安全带已扣好系紧。”

我:
t0812f
真要扑哧一笑了:
“好系紧”
大概当成广东话了,曾经把广东话揉进了系统。
不管那个,整体架构在轨道上,宾语从句 O-S 和前面的定语从句 Mod-S。
追求极致的话,“旅客”和“你”是同位语。但是,因为“请你VP”用得太多,而且其中的“你”常常省略,因此parsing根本就不理会你的存在,你没有地位,就是祈使句的默认(这里的祈使句标志是小词 “请”)。因此旅客无需与那个子虚乌有的“你”做同位语了,做主语就好了。
应该是无可挑剔了吧(除了句末的广东话疑似)。

白:
“放在座位前方的说明书,请您确认已看过读懂。”
“走在前方道路上的行人,请您确认跟照片上是同一个人。”

我: 白老师 得寸进尺呢。

t0812gt0812h

“看说明书” 与 “看书” 同属于搭配,这个还可以debug一下,本来应该勾搭上的。
“确认” 与 “是” 断链子了,不过 “是” 与其他动词不同,不是好缠的主儿,不敢轻易动它。

白:
这个时候还是有点念老乔的好。甭管多少层谓词,只要一个必填的坑没填,而外边C-command位置上跟它配型,基本就是它了。就是说,主语(话题)部分的中心词一旦与谓语部分的自由坑配型,就可解释为移位。比同位结构还来得优先

我:
语义中间件 continues,逻辑SVO补全:
t0813a

t0813b

宋:
【转发】周末开心一刻!
中国有两项比赛大家基本不用看,也不用担心:一个是乒乓球,一个是男足。
前者是“谁也赢不了”,后者是“谁也赢不了”!(外国人看不懂,咱们也不告诉他)

白:
太多处见到宋老师转的这个段子。这不是一个句法问题,两个分析结果在句法上都成立。关键是语用。要想正确理解,要明白:(1)有歧义结构的句式连用两次且都指向其中同一种结构,在修辞上是非常乏味的。(2)这两个结构分别描述了竞技能力水平的两个极端。(3)进入同一个句式的差异部分的所指如果恰好处于这两个极端,可以构成一个完美的段子(结构急转弯伴随价值评判急转弯)。(4)常识(或大数据)支持第(3)条。

我:
谁也赢不了 / 谁都赢不了 入词典,两个义项:1 必赢;2 必输
歧义保留到底。

0816a

“打败”也有两个义项,不过条件清晰一些:
(1)有句法主语没宾语:被打败
(2)主宾俱全,“打赢”
中国男足打败了
中国乒乓球打败了瑞典

0816b

我:
想起这句“成语”:毛主席保证!
“毛主席”不是“保证”的【施事】,而是“保证”的【对象】。
尽管处于绝对标准的主语位置。历史大概是,原来有介词“向”的,后来说得常了,于是省略小词,有意造成似歧义但语用无歧义的效果,显得别致,结果就传播开了。如今只好词典绑架死记了。
什么叫似歧义语用无歧义?
从句法上看并无歧义,似乎只能是主语。但从语用上看,先王毛何等高高在上,皇帝是不用向子民“保证”任何事的,只有蚁民向他保证或效忠(文革时有早请示晚汇报)。
其实,严格说,这个向先王的保证是做给对方看的,真正的对象是说话的对方。但经过向先王的保证,就赋予了这种保证一种特别的严肃(实际是转化为滑稽了)的效果:君子无戏言,对君子的保证更不敢戏言。
这两天做语义中间件的逻辑语义补全,有些着魔,总琢磨这事儿。昨天想,逻辑语义的前辈董老师一辈子琢磨它,该是怎么个心态和功力呢。是不是看自然语言达到了穿透一切形式,无申报直达语义的境界?

 

【相关】

关于 parsing

【关于中文NLP】

【置顶:立委NLP博文一览】

《朝华午拾》总目录

从汉语Topic句式谈起

再谈汉语的 Topic 句式,这玩意儿说到底就是句法偷懒:不求甚解,凡是句首看上去像个实词的,贴个discourse意味上的标签 Topic 完事儿。管它逻辑语义上究竟是扮演什么角色,怎样达成深度的理解。说得难听一点儿,这就是汉语文法“耍流氓”。

宋老师的例子:
“吃苦他在前”--> Topic【吃苦】Subj【他】Pred【在前】
这就交差了,句法算及格了。
更常见的其实是:“他吃苦在前”。 分析起来,也是一个套路:
“他吃苦在前”-->Topic【他】Subj【吃苦】Pred【在前】。

“他学习好” 也是如此,话题是某个人(“他”),说的是他的弱点:什么地方(aspect)好(evaluation)。“学习【,】他好”(不用逗号亦可,但有歧义:【学习他】好。)。话题是 “学习”这事儿,说的是哪些人(subset)这方面好(evaluation)。

英语大概是: he is good in study;his study is good; he studies well

逻辑语义呢,似乎有这几个关系:
(1)他(big object)好;(2)学习(small object)好;(3)他学习。

人无完人。一个人的一个方面好了,就可以说这个人(整体)好,好的所在(优点,pros)就是部分。这是整体与部分的相互关系。缺点(cons)亦然,如:
iPhone 屏幕不好。
细节是屏幕的不如人意,但是屏幕(部分)不好,也就影响了iPhone(整体)的评价,所以也是 iPhone 不好。

说来归齐,就是 Topic 做句法的第一步没问题,但不是句法语义的终点。更像是偷懒,或者桥梁,最终要达到(1)(2)(3)才算完事儿。无论“iPhone屏幕不行”还是“屏幕iPhone不行”,无论中文英文,表达法可以不同,最终的逻辑归结点应该是一致的,大体上就是123。思考一下英语没有话题句式但用了至少三种其他的表达式(如上所述),想想这些表达式最终怎么归化到逻辑的123,是非常有意思和启迪的。

句法分析或逻辑语义上的123,最终要落地到语用去支持应用。语用上的定义可以依据应用层面的情报需求。下面是我们目前的自动句法分析及其相关的 sentiment analysis 的语用表达:

0815d

 

【相关】

关于 parsing

【关于中文NLP】

【置顶:立委NLP博文一览】

《朝华午拾》总目录

 

一日一parsing:“宝宝的经纪人睡了宝宝的宝宝 ..."

bai:
宝宝的经纪人睡了宝宝的宝宝,宝宝不知道宝宝的宝宝是不是宝宝亲生的宝宝,宝宝的宝宝为什么要这样对待宝宝!宝宝真的很难过!宝宝现在最担心的是宝宝的宝宝是不是宝宝的宝宝,如果宝宝的宝宝不是宝宝的宝宝那真的吓死宝宝了。

tan:
这种八卦,估计很难分析。 难为parse这个宝宝了!

姜:
里边的歧义真是不少啊!要仔细用心才能理解每个“宝宝”的含义!
宝宝1:王宝强;宝宝2:王宝强媳妇;宝宝3:王宝强媳妇的儿子;宝宝4:王宝强的儿子

我:
结构上看还是蛮清晰的,有些人看上去类似绕口令的话语,结构分析的挑战其实不大

0814a

0814b

0814c

刘:
@wei 这主要不是parsing的问题,主要是指代消解的问题

我:
是的,我是说parsing提供结构的基础不难, 语义模块怎么消解指代是另外的问题。很多人以为这玩意儿没法 parsing,是因为对句法和语义的模块和功能不甚了解。当然一般人心目中的 parsing 等于 understanding,是结合了句法、语义甚至语用的整体的系统。
一步一步来吧。打下一个坚实的结构基础总是有利的。
我是 native speaker,其实也看不懂,不知道里面宝宝指的都是谁。刚才上网恶补了一下新闻,才明白怎么回事儿。所以,这里的指代消解需要很多语用背景知识,光句法语义分析不能解析的。

白:
这么快段子就来了:王宝强去马场选了一匹马准备骑,这时候马场的师傅阻止了他,说选的这个马不好。宝强问为啥?师傅解释说:“这马容易劈腿。” 宝强没有听太明白,师傅又大声说:“这马蓉易劈腿啊!!”?

我:
这是白老师先前转的,还是也 parse parse 凑齐一段吧:

814d

814e

814f

雷: 宝宝的宝宝是宝宝的吗?

我: 最多也只能提供可能性,然后语用或背景知识去定。
从词典上,“宝宝(Baby)”的可能性是:(1)孩子;(2)爱人
至于宝宝指王宝强,那是抽风似的娱乐界当前的背景知识,此前此后都没有这个知识。

白: 名字里带“宝”字的都有可能
之前宝宝的称号还被赋予过仰望星空那位大人物 是有先例的

我: 这样每一个宝宝就有三个义项: 宝宝1 (孩子),宝宝2 (爱人),宝宝3 (宝强)

孩子的孩子是孩子吗
爱人的爱人是爱人吗
宝强的宝强是宝强吗
孩子的爱人是孩子吗
孩子的爱人是爱人吗
孩子的爱人是宝强吗
孩子的宝强是孩子吗
孩子的宝强是爱人吗
孩子的宝强是宝强吗
爱人的孩子是孩子吗
爱人的孩子是爱人吗
爱人的孩子是宝强么
.........

总之,逃不过这些爆炸的组合之一
加一点限制条件可以排除一些不可能组合,但留下的空间还是远远大于可以离开新闻背景知识而能消解的可能。

雷: 还有,现在还流行自称“宝宝”,比如,宝宝不高兴

白: 没那么复杂。“【孩子】是【男人】的吗?”才是唯一有看点的提问。其他都是渣。

我: 人不看新闻也解不了,反正我第一次看,完全不知所云。

雷: 还有,宝马之争

我: 宝强的孩子是宝强(亲生)的吗

雷: 宝强的老婆是宝强的吗?

我: 恩,这两条是关键,怎么从成堆的渣里面提炼出这两条?
通过什么样的知识?
这不是新闻背景知识了,这是人类道德在现阶段的扭曲和窥探欲的某种知识

白:
不是窥探欲的问题,是信息量、冲击力大小的问题。

雷: 孩子的爸爸是孩子的吗?

我: 孩子的爸爸是孩子的吗? 这个可能只在想象中成立,想象孩子把自己的爸爸叫做宝宝,孩子有这种探究的动机,等。

雷: 第三方看,也是可以的

 

【相关】

【立委科普:语法结构树之美(之二)】

关于 parsing

【关于中文NLP】

【置顶:立委NLP博文一览】

《朝华午拾》总目录

 

S. Bai: Natural Language Caterpillar Breaks through Chomsky's Castle

masterminds-it-quiz-10-728

Translator's note:

This article written in Chinese by Prof. S. Bai is a wonderful piece of writing worthy of recommendation for all natural language scholars.  Prof. Bai's critical study of Chomsky's formal language theory with regards to natural language has reached a depth never seen before ever since Chomsky's revolution in 50's last century.  For decades with so many papers published by so many scholars who have studied Chomsky, this novel "caterpillar" theory still stands out and strikes me as an insight that offers a much clearer and deeper explanation for how natural language should be modeled in formalism, based on my decades of natural language parsing study and practice (in our practice, I call the caterpillar FSA++, an extension of regular grammar formalism adequate for multi-level natural language deep parsing).  For example, so many people have been trapped in Chomsky's recursion theory and made endless futile efforts to attempt a linear or near-linear algorithm to handle the so-called recursive nature of natural language which is practically non-existent (see Chomsky's Negative Impact).  There used to be heated debates  in computational linguistics on whether natural language is context-free or context-sensitive, or mildly sensitive as some scholars call it.  Such debates mechanically apply Chomsky's formal language hierarchy to natural languages, trapped in metaphysical academic controversies, far from language facts and data.  In contrast, Prof. Bai's original "caterpillar" theory presents a novel picture that provides insights in uncovering the true nature of natural languages.

S. Bai: Natural Language Caterpillar Breaks through Chomsky's Castle

Tags: Chomsky Hierarchy, computational linguistics, Natural Language Processing, linear speed

This is a technology-savvy article, not to be fooled by the title seemingly about a bug story in some VIP's castle.  If you are neither an NLP professional nor an NLP fan, you can stop here and do not need to continue the journey with me on this topic.

Chomsky's Castle refers to the famous Chomsky Hierarchy in his formal language theory, built by the father of contemporary linguistics Noam Chomsky more than half a century ago.  According to this theory, the language castle is built with four enclosing walls.  The outmost wall is named Type-0, also called Phrase Structure Grammar, corresponding to a Turing machine.  The second wall is Type-1, or Context-sensitive Grammar (CSG), corresponding to a parsing device called linear bounded automaton  with time complexity known to be NP-complete.  The third wall is Type-2, or Context-free Grammar (CFG), corresponding to a  pushdown automaton, with a time complexity that is polynomial, somewhere between square and cubic in the size of the input sentence for the best asymptotic order measured in the worst case scenario.  The innermost wall is Type-3, or Regular Grammar, corresponding to deterministic finite state automata, with a linear time complexity.  The sketch of the 4-wall Chomsky Castle is illustrated below.

This castle of Chomsky has impacted generations of scholars, mainly along two lines.  The first line of impact can be called "the outward fear syndrome".  Because the time complexity for the second wall (CSG) is NP-complete, anywhere therein and beyond becomes a Forbidden City before NP=P can be proved.  Thus, the pressure for parsing natural languages has to be all confined to within the third wall (CFG).  Everyone knows the natural language involves some context sensitivity,  but the computing device cannot hold it to be tractable once it is beyond the third wall of CFG.  So it has to be left out.

The second line of impact is called "the inward perfection syndrome".  Following the initial success of using Type 2 grammar (CFG) comes a severe abuse of recursion.  When the number of recursive layers increases slightly, the acceptability of a sentence soon approximates to almost 0.  For example, "The person that hit Peter is John" looks fine,  but it starts sounding weird to hear "The person that hit Peter that met Tom is John".  It becomes gibberish with sentences like "The person that hit Peter that met Tom that married Mary is John".  In fact, the majority resources spent with regards to the parsing efficiency are associated with such abuse of recursion in coping with gibberish-like sentences, rarely seen in real life language.  For natural language processing to be practical,  pursuing the linear speed cannot be over emphasized.  If we reflect on the efficiency of the human language understanding process, the conclusion is certainly about the "linear speed" in accordance with the length of the speech input.  In fact, the abuse of recursion is most likely triggered by the "inward perfection syndrome", for which we intend to cover every inch of the land within the third wall of CFG, even if it is an area piled up by gibberish or garbage.

In a sense, it can be said that one reason for the statistical approach to take over the rule-based approach for such a long time in the academia of natural language processing is just the combination effect of these two syndromes.  To overcome the effects of these syndromes, many researchers have made all kinds of efforts, to be reviewed below one by one.

Along the line of the outward fear syndrome, evidence against the context-freeness has been found in some constructions in Swiss-German.  Chinese has similar examples in expressing respective correspondence of conjoined items and their descriptions.  For example,   “张三、李四、王五的年龄分别是25岁、32岁、27岁,出生地分别是武汉、成都、苏州” (Zhang San, Li Si, Wang Wu's age is respectively 25, 32, and 27, they were born respectively in Wuhan, Chengdu, Suzhou" ).  Here, the three named entities constitute a list of nouns.  The number of the conjoined list of entities cannot be predetermined, but although the respective descriptors about this list of nouns also vary in length, the key condition is that they need to correspond to the antecedent list of nouns one by one.  This respective correspondence is something beyond the expression power of the context-free formalism.  It needs to get out of the third wall.

As for overcoming "the inward perfection syndrome", the pursuit of "linear speed" in the field of NLP has never stopped.  It ranges from allowing for the look-ahead mechanism in LR (k) grammar, to the cascaded finite state automata, to the probabilistic CFG parsers which are trained on a large treebank and eventually converted to an Ngram (n=>5) model.  It should also include RNN/LSTM for its unique pursuit for deep parsing from the statistical school.  All these efforts are striving for defining a subclass in Type-2 CFG that reaches linear speed efficiency yet still with adequate linguistic power.  In fact, all parsers that have survived after fighting the statistical methods are to some degree a result of overcoming "the inward perfection syndrome", with certain success in linear speed pursuit while respecting linguistic principles.  The resulting restricted subclass, compared to the area within the original third wall CFG, is a greatly "squashed" land.

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:

It seems to me that such a "caterpillar" may have already been found by someone.  It will not take too long before we can confirm it.
Original article in Chinese from 《穿越乔家大院寻找“毛毛虫”
Translated by Dr. Wei Li

 

 

【Related】

[转载]【白硕 - 穿越乔家大院寻找“毛毛虫”】

【立委按】

白硕老师这篇文章值得所有自然语言学者研读和反思。击节叹服,拍案叫绝,是初读此文的真切感受。白老师对乔姆斯基形式语言理论用于自然语言所造成的误导,给出了迄今所见最有深度的犀利解析,而且写得深入浅出,形象生动,妙趣横生。这么多年,这么多学者,怎么就达不到这样的深度呢?一个乔姆斯基的递归陷阱不知道栽进去多少人,造成多少人在 “不是人话” 的现象上做无用功,绕了无数弯路。学界曾有多篇长篇大论,机械地套用乔氏层级体系,在自然语言是 context-free 还是 context-sensitive 的框框里争论不休,也有折衷的说法,诸如自然语言是 mildly sensitive,这些形而上的学究式争论,大多雾里看花,隔靴搔痒,不得要领,离语言事实甚远。白老师独创的 “毛毛虫” 论,形象地打破了这些条条框框。

白老师自己的总结是:‘如果认同“一切以真实的自然语言为出发点和最终落脚点”的理念,那就应该承认:向外有限突破,向内大举压缩,应该是一枚硬币的两面。’ 此乃金玉良言,掷地有声。

【白硕 - 穿越乔家大院寻找“毛毛虫”】

看标题,您八成以为这篇文章讲的是山西的乔家大院的事儿了吧?不是。这是一篇烧脑的技术贴。如果您既不是NLP专业人士也不是NLP爱好者,就不用往下看了。

咱说的这乔家大院,是当代语言学祖师爷乔姆斯基老爷子画下来的形式语言类型谱系划分格局。最外边一圈围墙,是0型文法,又叫短语结构文法,其对应的分析处理机制和图灵机等价,亦即图灵可计算的;第二圈围墙,是1型文法,又叫上下文相关文法,其对应的分析处理机制,时间复杂度是NP完全的;第三圈围墙,是2型文法,又叫上下文无关文法,其对应的分析处理机制,时间复杂度是多项式的,最坏情况下的最好渐进阶在输入句子长度的平方和立方之间;最里边一层围墙,是3型文法,又叫正则文法,其对应的分析处理机制和确定性有限状态自动机等价,时间复杂度是线性的。这一圈套一圈的,归纳整理下来,如下图所示:

乔老爷子建的这座大院,影响了几代人。影响包括这样两个方面:

第一个方面,我们可以称之为“外向恐惧情结”。因为第二圈的判定处理机制,时间复杂度是NP完全的,于是在NP=P还没有证明出来之前,第二圈之外似乎是禁区,没等碰到已经被宣判了死刑。这样,对自然语言的描述压力,全都集中到了第三圈围墙里面,也就是上下文无关文法。大家心知肚明自然语言具有上下文相关性,想要红杏出墙,但是因为出了围墙计算上就hold不住,也只好打消此念。0院点灯……1院点灯……大红灯笼高高挂,红灯停,闲人免出。

第二个方面,我们可以称之为“内向求全情结”。2型文法大行其道,取得了局部成功,也带来了一个坏风气,就是递归的滥用。当递归层数稍微加大,人类对于某些句式的可接受性就快速衰减至几近为0。比如,“我是县长派来的”没问题,“我是县长派来的派来的”就有点别扭,“我是县长派来的派来的派来的”就不太像人话了。而影响分析判定效率的绝大多数资源投入,都花在了应对这类“不像人话”的递归滥用上了。自然语言处理要想取得实用效果,处理的“线速”是硬道理。反思一下,我们人类的语言理解过程,也肯定是在“线速”范围之内。递归的滥用,起源于“向内求全情结”,也就是一心想覆盖第三圈围墙里面最犄角旮旯的区域,哪怕那是一个由“不像人话”的实例堆积起来的垃圾堆。

可以说,在自然语言处理领域,统计方法之所以在很长时间内压倒规则方法,在一定程度上,就是向外恐惧情结与向内求全情结叠加造成的。NLP领域内也有很多的仁人志士为打破这两个情结做了各种各样的努力。

先说向外恐惧情结。早就有人指出,瑞士高地德语里面有不能用上下文无关文法描述的语言现象。其实,在涉及到“分别”的表述时,汉语也同样。比如:“张三、李四、王五的年龄分别是25岁、32岁、27岁,出生地分别是武汉、成都、苏州。”这里“张三、李四、王五”构成一个名词列表,对这类列表的一般性句法表述,肯定是不定长的,但后面的两个“分别”携带的列表,虽然也是不定长的,但却需要跟前面这个列表的长度相等。这个相等的条件,上下文无关文法不能表达,必须走出第三圈围墙。

再说向内求全情结。追求“线速”的努力,在NLP领域一直没有停止过。从允许预读机制的LR(k)文法,到有限自动机堆叠,再到基于大型树库训练出来的、最终转化为Ngram模型(N=5甚至更大)的概率上下文无关文法分析器,甚至可以算上统计阵营里孤军深入自然语言深层处理的RNN/LSTM等等,都试图从2型文法中划出一个既有足够的语言学意义、又能达到线速处理效率的子类。可以说,凡是在与统计方法的搏杀中还能活下来的分析器,无一不是在某种程度上摆脱了向内求全情结、在基本尊重语言学规律基础上尽可能追求线速的努力达到相对成功的结果。这个经过限制的子类,比起第三圈围墙来,是大大地“压扁”了的。

如果认同“一切以真实的自然语言为出发点和最终落脚点”的理念,那就应该承认:向外有限突破,向内大举压缩,应该是一枚硬币的两面。我们希望,能够有一种形式化机制同时兼顾这两面。也就是说,我们理想中的自然语言句法的形式化描述机制,应该像一条穿越乔家大院的“毛毛虫”,如下图所示:

据笔者妄加猜测,这样的“毛毛虫”,可能有人已经找到,过一段时间自然会见分晓。

from http://blog.sina.com.cn/s/blog_729574a00102wf63.html

 

【相关】

【新智元:parsing 在希望的田野上】 

【新智元:理论家的围墙和工程师的私货】

【科研笔记:NLP “毛毛虫” 笔记,从一维到二维】

【泥沙龙笔记:NLP 专门语言是规则系统的斧头】

乔姆斯基批判

泥沙龙笔记:再聊乔老爷的递归陷阱

泥沙龙笔记:骨灰级砖家一席谈,真伪结构歧义的对策(2/2) 

《自然语言是递归的么?》

语言创造简史

【置顶:立委博客NLP博文一览(定期更新版)】

 

On Hand-crafted Myth of Knowledge Bottleneck

In my article "Pride and Prejudice of Main Stream", the first myth listed as top 10 misconceptions in NLP is as follows:

[Hand-crafted Myth]  Rule-based system faces a knowledge bottleneck of hand-crafted development while a machine learning system involves automatic training (implying no knowledge bottleneck).

While there are numerous misconceptions on the old school of rule systems , this hand-crafted myth can be regarded as the source of all.  Just take a review of NLP papers, no matter what are the language phenomena being discussed, it's almost cliche to cite a couple of old school work to demonstrate superiority of machine learning algorithms, and the reason for the attack only needs one sentence, to the effect that the hand-crafted rules lead to a system "difficult to develop" (or "difficult to scale up", "with low efficiency", "lacking robustness", etc.), or simply rejecting it like this, "literature [1], [2] and [3] have tried to handle the problem in different aspects, but these systems are all hand-crafted".  Once labeled with hand-crafting, one does not even need to discuss the effect and quality.  Hand-craft becomes the rule system's "original sin", the linguists crafting rules, therefore, become the community's second-class citizens bearing the sin.

So what is wrong with hand-crafting or coding linguistic rules for computer processing of languages?  NLP development is software engineering.  From software engineering perspective, hand-crafting is programming while machine learning belongs to automatic programming.  Unless we assume that natural language is a special object whose processing can all be handled by systems automatically programmed or learned by machine learning algorithms, it does not make sense to reject or belittle the practice of coding linguistic rules for developing an NLP system.

For consumer products and arts, hand-craft is definitely a positive word: it represents quality or uniqueness and high value, a legit reason for good price. Why does it become a derogatory term in NLP?  The root cause is that in the field of NLP,  almost like some collective hypnosis hit in the community, people are intentionally or unintentionally lead to believe that machine learning is the only correct choice.  In other words, by criticizing, rejecting or disregarding hand-crafted rule systems, the underlying assumption is that machine learning is a panacea, universal and effective, always a preferred approach over the other school.

The fact of life is, in the face of the complexity of natural language, machine learning from data so far only surfaces the tip of an iceberg of the language monster (called low-hanging fruit by Church in K. Church: A Pendulum Swung Too Far), far from reaching the goal of a complete solution to language understanding and applications.  There is no basis to support that machine learning alone can solve all language problems, nor is there any evidence that machine learning necessarily leads to better quality than coding rules by domain specialists (e.g. computational grammarians).  Depending on the nature and depth of the NLP tasks, hand-crafted systems actually have more chances of performing better than machine learning, at least for non-trivial and deep level NLP tasks such as parsing, sentiment analysis and information extraction (we have tried and compared both approaches).  In fact, the only major reason why they are still there, having survived all the rejections from mainstream and still playing a role in industrial practical applications, is the superior data quality, for otherwise they cannot have been justified for industrial investments at all.

the “forgotten” school:  why is it still there? what does it have to offer? The key is the excellent data quality as advantage of a hand-crafted system, not only for precision, but high recall is achievable as well.
quote from On Recall of Grammar Engineering Systems

In the real world, NLP is applied research which eventually must land on the engineering of language applications where the results and quality are evaluated.  As an industry, software engineering has attracted many ingenious coding masters, each and every one of them gets recognized for their coding skills, including algorithm design and implementation expertise, which are hand-crafting by nature.   Have we ever heard of a star engineer gets criticized for his (manual) programming?  With NLP application also as part of software engineering, why should computational linguists coding linguistic rules receive so much criticism while engineers coding other applications get recognized for their hard work?  Is it because the NLP application is simpler than other applications?  On the contrary, many applications of natural language are more complex and difficult than other types of applications (e.g. graphics software, or word processing apps).  The likely reason to explain the different treatment between a general purpose programmer and a linguist knowledge engineer is that the big environment of software engineering does not involve as much prejudice while the small environment of NLP domain  is deeply biased, with belief that the automatic programming of an NLP system by machine learning can replace and outperform manual coding for all language projects.   For software engineering in general, (manual) programming is the norm and no one believes that programmers' jobs can be replaced by automatic programming in any time foreseeable.  Automatic programming, a concept not rare in science fiction for visions like machines making machines, is currently only a research area, for very restricted low-level functions.  Rather than placing hope on automatic programming, software engineering as an industry has seen a significant progress on work of the development infrastructures, such as development environment and a rich library of functions to support efficient coding and debugging.  Maybe in the future one day, applications can use more and more of automated code to achieve simple modules, but the full automation of constructing any complex software project  is nowhere in sight.  By any standards, natural language parsing and understanding (beyond shallow level tasks such as classification, clustering or tagging)  is a type of complex tasks. Therefore, it is hard to expect machine learning as a manifestation of automatic programming to miraculously replace the manual code for all language applications.  The application value of hand-crafting a rule system will continue to exist and evolve for a long time, disregarded or not.

"Automatic" is a fancy word.  What a beautiful world it would be if all artificial intelligence and natural languages tasks could be accomplished by automatic machine learning from data.  There is, naturally, a high expectation and regard for machine learning breakthrough to help realize this dream of mankind.  All this should encourage machine learning experts to continue to innovate to demonstrate its potential, and should not be a reason for the pride and prejudice against a competitive school or other approaches.

Before we embark on further discussions on the so-called rule system's knowledge bottleneck defect, it is worth mentioning that the word "automatic" refers to the system development, not to be confused with running the system.  At the application level, whether it is a machine-learned system or a manual system coded by domain programmers (linguists), the system is always run fully automatically, with no human interference.  Although this is an obvious fact for both types of systems, I have seen people get confused so to equate hand-crafted NLP system with manual or semi-automatic applications.

Is hand-crafting rules a knowledge bottleneck for its development?  Yes, there is no denying or a need to deny that.  The bottleneck is reflected in the system development cycle.  But keep in mind that this "bottleneck" is common to all large software engineering projects, it is a resources cost, not only introduced by NLP.  From this perspective, the knowledge bottleneck argument against hand-crafted system cannot really stand, unless it can be proved that machine learning can do all NLP equally well, free of knowledge bottleneck:  it might be not far from truth for some special low-level tasks, e.g. document classification and word clustering, but is definitely misleading or incorrect for NLP in general, a point to be discussed below in details shortly.

Here are the ballpark estimates based on our decades of NLP practice and experiences.  For shallow level NLP tasks (such as Named Entity tagging, Chinese segmentation), a rule approach needs at least three months of one linguist coding and debugging the rules, supported by at least half an engineer for tools support and platform maintenance, in order to come up with a decent system for initial release and running.  As for deep NLP tasks (such as deep parsing, deep sentiments beyond thumbs-up and thumbs-down classification), one should not expect a working engine to be built up without due resources that at least involve one computational linguist coding rules for one year, coupled with half an engineer for platform and tools support and half an engineer for independent QA (quality assurance) support.  Of course, the labor resources requirements vary according to the quality of the developers (especially the linguistic expertise of the knowledge engineers) and how well the infrastructures and development environment support linguistic development.  Also, the above estimates have not included the general costs, as applied to all software applications, e.g. the GUI development at app level and operations in running the developed engines.

Let us present the scene of the modern day rule-based system development.  A hand-crafted NLP rule system is based on compiled computational grammars which are nowadays often architected as an integrated pipeline of different modules from shallow processing up to deep processing.  A grammar is a set of linguistic rules encoded in some formalism, which is the core of a module intended to achieve a defined function in language processing, e.g. a module for shallow parsing may target noun phrase (NP) as its object for identification and chunking.  What happens in grammar engineering is not much different from other software engineering projects.  As knowledge engineer, a computational linguist codes a rule in an NLP-specific language, based on a development corpus.  The development is data-driven, each line of rule code goes through rigid unit tests and then regression tests before it is submitted as part of the updated system for independent QA to test and feedback.  The development is an iterative process and cycle where incremental enhancements on bug reports from QA and/or from the field (customers) serve as a necessary input and step towards better data quality over time.

Depending on the design of the architect, there are all types of information available for the linguist developer to use in crafting a rule’s conditions, e.g. a rule can check any elements of a pattern by enforcing conditions on (i) word or stem itself (i.e. string literal, in cases of capturing, say, idiomatic expressions), and/or (ii) POS (part-of-speech, such as noun, adjective, verb, preposition), (iii) and/or orthography features (e.g. initial upper case, mixed case, token with digits and dots), and/or (iv) morphology features (e.g. tense, aspect, person, number, case, etc. decoded by a previous morphology module), (v) and/or syntactic features (e.g. verb subcategory features such as intransitive, transitive, ditransitive), (vi) and/or lexical semantic features (e.g. human, animal, furniture, food, school, time, location, color, emotion).  There are almost infinite combinations of such conditions that can be enforced in rules’ patterns.  A linguist’s job is to code such conditions to maximize the benefits of capturing the target language phenomena, a balancing art in engineering through a process of trial and error.

Macroscopically speaking, the rule hand-crafting process is in its essence the same as programmers coding an application, only that linguists usually use a different, very high-level NLP-specific language, in a chosen or designed formalism appropriate for modeling natural language and framework on a platform that is geared towards facilitating NLP work.  Hard-coding NLP in a general purpose language like Java is not impossible for prototyping or a toy system.  But as natural language is known to be a complex monster, its processing calls for a special formalism (some form or extension of Chomsky's formal language types) and an NLP-oriented language to help implement any non-toy systems that scale.  So linguists are trained on the scene of development to be knowledge programmers in hand-crafting linguistic rules.  In terms of different levels of languages used for coding, to an extent, it is similar to the contrast between programmers in old days and the modern software engineers today who use so-called high-level languages like Java or C to code.  Decades ago, programmers had to use assembly or machine language to code a function.  The process and workflow for hand-crafting linguistic rules are just like any software engineers in their daily coding practice, except that the language designed for linguists is so high-level that linguistic developers can concentrate on linguistic challenges without having to worry about low-level technical details of memory allocation, garbage collection or pure code optimization for efficiency, which are taken care of by the NLP platform itself.  Everything else follows software development norms to ensure the development stay on track, including unit testing, baselines construction and monitoring, regressions testing, independent QA, code reviews for rules' quality, etc.  Each level language has its own star engineer who masters the coding skills.  It sounds ridiculous to respect software engineers while belittling linguistic engineers only because the latter are hand-crafting linguistic code as knowledge resources.

The chief architect in this context plays the key role in building a real life robust NLP system that scales.  To deep-parse or process natural language, he/she needs to define and design the formalism and language with the necessary extensions, the related data structures, system architecture with the interaction of different levels of linguistic modules in mind (e.g. morpho-syntactic interface), workflow that integrate all components for internal coordination (including patching and handling interdependency and error propagation) and the external coordination with other modules or sub-systems including machine learning or off-shelf tools when needed or felt beneficial.  He also needs to ensure efficient development environment and to train new linguists into effective linguistic "coders" with engineering sense following software development norms (knowledge engineers are not trained by schools today).  Unlike the mainstream machine learning systems which are by nature robust and scalable,  hand-crafted systems' robustness and scalability depend largely on the design and deep skills of the architect.  The architect defines the NLP platform with specs for its core engine compiler and runner, plus the debugger in a friendly development environment.  He must also work with product managers to turn their requirements into operational specs for linguistic development, in a process we call semantic grounding to applications from linguistic processing.   The success of a large NLP system based on hand-crafted rules is never a simple accumulation of linguistics resources such as computational lexicons and grammars using a fixed formalism (e.g. CFG) and algorithm (e.g. chart-parsing).  It calls for seasoned language engineering masters as architects for the system design.

Given the scene of practice for NLP development as describe above, it should be clear that the negative sentiment association with "hand-crafting" is unjustifiable and inappropriate.  The only remaining argument against coding rules by hands comes down to the hard work and costs associated with hand-crafted approach, so-called knowledge bottleneck in the rule-based systems.  If things can be learned by a machine without cost, why bother using costly linguistic labor?  Sounds like a reasonable argument until we examine this closely.  First, for this argument to stand, we need proof that machine learning indeed does not incur costs and has no or very little knowledge bottleneck.  Second, for this argument to withstand scrutiny, we should be convinced that machine learning can reach the same or better quality than hand-crafted rule approach.  Unfortunately, neither of these necessarily hold true.  Let us study them one by one.

As is known to all, any non-trivial NLP task is by nature based on linguistic knowledge, irrespective of what form the knowledge is learned or encoded.   Knowledge needs to be formalized in some form to support NLP, and machine learning is by no means immune to this knowledge resources requirement.  In rule-based systems, the knowledge is directly hand-coded by linguists and in case of (supervised) machine learning, knowledge resources take the form of labeled data for the learning algorithm to learn from (indeed, there is so-called unsupervised learning which needs no labeled data and is supposed to learn from raw data, but that is research-oriented and hardly practical for any non-trivial NLP, so we leave it aside for now).  Although the learning process is automatic,  the feature design, the learning algorithm implementation, debugging and fine-tuning are all manual, in addition to the requirement of manual labeling a large training corpus in advance (unless there is an existing labeled corpus available, which is rare; but machine translation is a nice exception as it has the benefit of using existing human translation as labeled aligned corpora for training).  The labeling of data is a very tedious manual job.   Note that the sparse data challenge represents the need of machine learning for a very large labeled corpus.  So it is clear that knowledge bottleneck takes different forms, but it is equally applicable to both approaches.  No machine can learn knowledge without costs, and it is incorrect to regard knowledge bottleneck as only a defect for the rule-based system.

One may argue that rules require expert skilled labor, while the labeling of data only requires high school kids or college students with minimal training.  So to do a fair comparison of the costs associated, we perhaps need to turn to Karl Marx whose "Das Kapital" has some formula to help convert simple labor to complex labor for exchange of equal value: for a given task with the same level of performance quality (assuming machine learning can reach the quality of professional expertise, which is not necessarily true), how much cheap labor needs to be used to label the required amount of training corpus to make it economically an advantage?  Something like that.  This varies from task to task and even from location to location (e.g. different minimal wage laws), of course.   But the key point here is that knowledge bottleneck challenges both approaches and it is not the case believed by many that machine learning learns a system automatically with no or little cost attached.  In fact, things are far more complicated than a simple yes or no in comparing the costs as costs need also to be calculated in a larger context of how many tasks need to be handled and how much underlying knowledge can be shared as reusable resources.  We will leave it to a separate writing for the elaboration of the point that when put into the context of developing multiple NLP applications, the rule-based approach which shares the core engine of parsing demonstrates a significant saving on knowledge costs than machine learning.

Let us step back and, for argument's sake, accept that coding rules is indeed more costly than machine learning, so what? Like in any other commodities, hand-crafted products may indeed cost more, they also have better quality and value than products out of mass production.  For otherwise a commodity society will leave no room for craftsmen and their products to survive.  This is common sense, which also applies to NLP.  If not for better quality, no investors will fund any teams that can be replaced by machine learning.  What is surprising is that there are so many people, NLP experts included, who believe that machine learning necessarily performs better than hand-crafted systems not only in costs saved but also in quality achieved.  While there are low-level NLP tasks such as speech processing and document classification which are not experts' forte as we human have much more restricted memory than computers do, deep NLP involves much more linguistic expertise and design than a simple concept of learning from corpora to expect superior data quality.

In summary, the hand-crafted rule defect is largely a misconception circling around wildly in NLP and reinforced by the mainstream, due to incomplete induction or ignorance of the scene of modern day rule development.  It is based on the incorrect assumption that machine learning necessarily handles all NLP tasks with same or better quality but less or no knowledge bottleneck, in comparison with systems based on hand-crafted rules.

 

 

Note: This is the author's own translation, with adaptation, of part of our paper which originally appeared in Chinese in Communications of Chinese Computer Federation (CCCF), Issue 8, 2013

 

[Related]

Domain portability myth in natural language processing

Pride and Prejudice of NLP Main Stream

K. Church: A Pendulum Swung Too Far, Linguistics issues in Language Technology, 2011; 6(5)

Wintner 2009. What Science Underlies Natural Language Engineering? Computational Linguistics, Volume 35, Number 4

Pros and Cons of Two Approaches: Machine Learning vs Grammar Engineering

Overview of Natural Language Processing

Dr. Wei Li’s English Blog on NLP

Pride and Prejudice of NLP Main Stream

[Abstract]

In the area of Computational Linguistics, there are two basic approaches to natural language processing, the traditional rule system and the mainstream machine learning.  They are complementary and there are pros and cons associated with both.  However, as machine learning is the dominant mainstream philosophy reflected by the overwhelming ratio of papers published in academia, the area seems to be heavily biased against the rule system methodology.  The tremendous success of machine learning as applied to a list of natural language tasks has reinforced the mainstream pride and prejudice in favor of one and against the other.   As a result, there are numerous specious views which are often taken for granted without check, including attacks on the rule system's defects based on incomplete induction or misconception.  This is not healthy for NLP itself as an applied research area and exerts an inappropriate influence on the young scientists coming to this area.  This is the first piece of a series of writings aimed at educating the public and confronting the prevalent prejudice, focused on the in-depth examination of the so-called hand-crafted defect of the rule system and the associated  knowledge bottleneck issue.

I. introduction

Over 20 years ago, the area of NLP (natural language processing) went through a process of replacing traditional rule-based systems by statistical machine learning as the mainstream in academia.  Put in a larger context of AI (Artificial Intelligence), this represents a classical competition, and their ups and downs, between the rational school and the empirical school (Church 2007 ).  It needs to be noted that the statistical approaches' dominance in this area has its historical inevitability.   The old school was confined to toy systems or lab for too long without scientific break-through while machine learning started showing impressive results in numerous fronts of NLP in a much larger scale, initially  very low level NLP such as POS (Part-of-Speech) tagging and speech recognition / synthesis, and later on expanded to almost all NLP tasks, including machine translation, search and ranking, spam filtering, document classification, automatic summarization, lexicon acquisition, named entity tagging, relationship extraction, event classification, sentiment analysis.  This dominance has continued to grow till today when the other school is largely "out" from almost all major NLP arenas, journals and top conferences.  New graduates hardly realize its existence.  There is an entire generation gap for such academic training or carrying on the legacy of the old school, with exceptions of very few survivors (including yours truly) in industry because few professors are motivated to teach it at all or even qualified with an in-depth knowledge of this when the funding and publication prospects for the old school are getting more and more impossible.   To many people's minds today, learning (or deep learning) is NLP, and NLP is learning, that is all.  As for the "last century's technology" of rule-based systems, it is more like a failure tale from a distant history.

The pride and prejudice of the mainstream were demonstrated the most in the recent incidence when Google announced its deep-learning-based SyntaxNet and proudly claimed it to be "the most accurate parser in the world", so resolute and no any conditions attached, and without even bothering to check the possible existence of the other school.  This is not healthy (and philosophically unbalanced too) for a broad area challenged by one of the most complex problems of mankind, i.e. to decode natural language understanding.  As there is only one voice heard, it is scaring to observe that the area is packed with prejudice and ignorance with regards to the other school, some from leaders of the area.  Specious comments are rampant and often taken for granted without check.

Prejudice is not a real concern as it is part of the real world around and involving ourselves, something to do with human nature and our innate limitation and ignorance. What is really scary is the degree and popularity of such prejudice represented in numerous misconceptions that can be picked up everywhere in this circle (I am not going to trace the sources of these as they are everywhere and people who are in this area for some time know this is not Quixote's windmill but a reality reflection).  I will list below some of the myths or fallacies so deeply rooted in the area that they seem to become cliche, or part of the community consensus.  If one or more statements below sound familiar to you and they do not strike you as opinionated or specious which cannot withstand scrutiny, then you might want to give a second study of the issue to make sure we have not been subconsciously brain-washed.  The real damage is to our next generation, the new scholars coming to this field, who often do not get a chance for doubt.

For each such statement to be listed, it is not difficult to cite a poorly designed stereotypical rule system that falls short of the point, but the misconception lies in its generalization of associating an accused defect to the entire family of a school, ignorant of the variety of designs and the progress made in that school.

There are two types of misconceptions, one might be called myth and the other is sheer fallacy.  Myths arise as a result of "incomplete induction".  Some may have observed or tried some old school rule systems of some sort, which show signs of the stated defect, then they jump to conclusions leading to the myths.  These myths call for in-depth examination and arguments to get the real picture of the truth.  As for fallacies, they are simply untrue.  It is quite a surprise, though, to see that even fallacies seem to be widely accepted as true by many, including some experts in this area.  All we need is to cite facts to prove them wrong.  For example, [Grammaticality Fallacy] says that the rule system can only parse grammatical text and cannot handle degraded text with grammar mistakes in it.  Facts speak louder than words: the sentiment engine we have developed for our main products is a parsing-supportedrule-based system that fully automatically extracts and mines public opinions and consumer insights from all types of social media, typical of degraded text.  Third-party evaluations show that this system is industry leader in data quality of sentiments, significantly better than competitions adopting machine learning. The large-scale operation of our system in the cloud in handling terabytes of real life social media big data (a year of social media in our index involve about 30 billion documents across more than 40 languages) also prove wrong what is stated in [Scalability Fallacy] below.

Let us now list these widely spread rumours collected from the community about the rule-based system to see if they ring the bell before we dive into the first two core myths to uncover the true picture behind in separate blogs.

II.  Top 10 Misconceptions against Rules

[Hand-crafted Myth]  Rule-based system faces a knowledge bottleneck of hand-crafted development while a machine learning system involves automatic training (implying no knowledge bottleneck). [see On Hand-crafted Myth of Knowledge Bottleneck.]

[Domain Portability Myth] The hand-crafted nature of a rule-based system leads to its poor domain portability as rules have to be rebuilt each time we shift to a new domain; but in case of machine learning, since the algorithm and system are universal, domain shift only involves new training data (implying strong domain portability). [see Domain Portability Myth]

[Fragility Myth]  A rule-based system is very fragile and it may break before unseen language data, so it cannot lead to a robust real life application.

[Weight Myth] Since there is no statistical weight associated with the results from a rule-based system, the data quality cannot be trusted with confidence.

[Complexity Myth] As a rule-based system is complex and intertwined, it is easy to get to a standstill, with little hope for further improvement.

[Scalability Fallacy]  The hand-crafted nature of a rule-based system makes it difficult to scale up for real life application; it is largely confined to the lab as a toy.

[Domain Restriction Fallacy]  A rule-based system only works in a narrow domain and it cannot work across domains.

[Grammaticality Fallacy] A rule-based system can only handle grammatical input in the formal text (such as news, manuals, weather broadcasts), it fails in front of degraded text involving misspellings and ungrammaticality such as social media, oral transcript, jargons or OCR output.

[Outdated Fallacy]  A rule-based system is a technology of last century, it is outdated (implying that it no longer works or can result in a quality system in modern days).

[Data Quality Fallacy]  Based on the data quality of results, a machine learning system is better than a rule based system. (cf: On Recall of Grammar Engineering Systems)

III.  Retrospect and Reflection of Mainstream

As mentioned earlier, a long list of misconceptions about the old school of rule-based systems have been around the mainstream for years in the field.   It may sound weird for an interdisciplinary field named Computational Linguistics to drift more and more distant from linguistics;  linguists play less and less a role in NLP dominated by statisticians today.  It seems widely assumed that with advanced deep learning algorithms, once data are available, a quality system will be trained without the need for linguistic design or domain expertise.

Not all main stream scholars are one-sided and near-sighted.  In recent years, insightful articles  (e.g., church 2007, Wintner 2009) began a serious retrospect and reflection process and called for the return of Linguistics: “In essence, linguistics is altogether missing in contemporary natural language engineering research. … I want to call for the return of linguistics to computational linguistics.”(Wintner 2009)Let us hope that their voice will not be completely muffled in this new wave of deep learning heat.

Note that the rule system which the linguists are good at crafting in industry is different from the classical linguistic study, it is formalized modeling of linguistic analysis.  For NLP tasks beyond shallow level, an effective rule system is not a simple accumulation of computational lexicons and grammars, but involves a linguistic processing strategy (or linguistic algorithm) for different levels of linguistic phenomena.  However, this line of study on the NLP platform design, system architecture and formalism has increasingly smaller space for academic discussion and publication, the research funding becomes almost impossible, as a result, the new generation faces the risk of a cut-off legacy, with a full generation of talent gap in academia.  Church (2007) points out that the statistical research is so dominant and one-sided that only one voice is now heard.  He is a visionary main stream scientist, deeply concerned about the imbalance of the two schools in NLP and AI.  He writes:

Part of the reason why we keep making the same mistakes, as Minsky and Papert mentioned above, has to do with teaching. One side of the debate is written out of the textbooks and forgotten, only to be revived/reinvented by the next generation.  ......

To prepare students for what might come after the low hanging fruit has been picked over, it would be good to provide today’s students with a broad education that makes room for many topics in Linguistics such as syntax, morphology, phonology, phonetics, historical linguistics and language universals. We are graduating Computational Linguistics students these days that have very deep knowledge of one particular narrow sub-area (such as machine learning and statistical machine translation) but may not have heard of Greenberg’s Universals, Raising, Equi, quantifier scope, gapping, island constraints and so on. We should make sure that students working on co-reference know about c-command and disjoint reference. When students present a paper at a Computational Linguistics conference, they should be expected to know the standard treatment of the topic in Formal Linguistics.

We ought to teach this debate to the next generation because it is likely that they will have to take Chomsky’s objections more seriously than we have. Our generation has been fortunate to have plenty of low hanging fruit to pick (the facts that can be captured with short ngrams), but the next generation will be less fortunate since most of those facts will have been pretty well picked over before they retire, and therefore, it is likely that they will have to address facts that go beyond the simplest ngram approximations.

 

 

About Author

Dr. Wei Li is currently Chief Scientist at Netbase Solutions in the Silicon Valley, leading the effort for the design and development of a multi-lingual sentiment mining system based on deep parsing.  A hands-on computational linguist with 30 years of professional experience in Natural Language Processing (NLP), Dr. Li has a track record of making NLP work robust. He has built three large-scale NLP systems, all transformed into real-life, globally distributed products.

 

Note: This is the author's own translation, with adaptation, of our paper in Chinese which originally appeared in W. Li & T. Tang, "Pride and Prejudice of Main Stream:  Rule-based System vs. Machine Learning", in Communications of Chinese Computer Federation (CCCF), Issue 8, 2013

 

[Related]

K. Church: A Pendulum Swung Too Far, Linguistics issues in Language Technology, 2011; 6(5)

Wintner 2009. What Science Underlies Natural Language Engineering? Computational Linguistics, Volume 35, Number 4

Domain portability myth in natural language processing

On Hand-crafted Myth and Knowledge Bottleneck

On Recall of Grammar Engineering Systems

Pros and Cons of Two Approaches: Machine Learning vs Grammar Engineering

It is untrue that Google SyntaxNet is the “world’s most accurate parser”

R. Srihari, W Li, C. Niu, T. Cornell: InfoXtract: A Customizable Intermediate Level Information Extraction Engine. Journal of Natural Language Engineering, 12(4), 1-37, 2006

Introduction of Netbase NLP Core Engine

Overview of Natural Language Processing

Dr. Wei Li’s English Blog on NLP

 

【主流的傲慢与偏见:规则系统与机器学习】

I.          引言

有回顾NLP(Natural Language Processing)历史的知名学者介绍机器学习(machine learning)取代传统规则系统(rule-based system)成为学界主流的掌故,说20多年前好像经历了一场惊心动魄的宗教战争。必须承认,NLP 这个领域,统计学家的完胜,是有其历史必然性的。机器学习在NLP很多任务上的巨大成果和效益是有目共睹的:机器翻译,语音识别/合成,搜索排序,垃圾过滤,文档分类,自动文摘,词典习得,专名标注,词性标注等(Church 2007)。

然而,近来浏览几篇 NLP 领域代表人物的综述,见其中不乏主流的傲慢与偏见,依然令人惊诧。细想之下,统计学界的确有很多对传统规则系统根深蒂固的成见和经不起推敲但非常流行的蛮横结论。可怕的不是成见,成见无处不在。真正可怕的是成见的流行无阻。而在NLP这个领域,成见的流行到了让人瞠目结舌的程度。不假思索而认同接受这些成见成为常态。因此想到立此存照一下,并就核心的几条予以详论。下列成见随处可见,流传甚广,为免纷扰,就不列出处了,明白人自然知道这绝不是杜撰和虚立的靶子。这些成见似是而非,经不起推敲,却被很多人视为理所当然的真理。为每一条成见找一个相应的规则系统的案例并不难,但是从一些特定系统的缺陷推广到对整个规则系统的方法学上的批判,乃是其要害所在。

【成见一】规则系统的手工编制(hand-crafted)是其知识瓶颈,而机器学习是自动训练的(言下之意:没有知识瓶颈)。

【成见二】规则系统的手工编制导致其移植性差,转换领域必须重启炉灶,而机器学习因为算法和系统保持不变,转换领域只要改变训练数据即可(言下之意:移植性强)。

【成见三】规则系统很脆弱,遇到没有预测的语言现象系统就会 break(什么叫 break,死机?瘫痪?失效?),开发不了鲁棒(robust)产品。

【成见四】规则系统的结果没有置信度,鱼龙混杂。

【成见五】规则系统的编制越来越庞杂,最终无法改进,只能报废。

【成见六】规则系统的手工编制注定其无法实用,不能 scale up,只能是实验室里的玩具。

【成见七】规则系统只能在极狭窄的领域成事,无法实现跨领域的系统。

【成见八】规则系统只能处理规范的语言(譬如说明书、天气预报、新闻等),无法应对 degraded text,如社会媒体、口语、方言、黑话、OCR 文档。

【成见九】规则系统是上个世纪的技术,早已淘汰(逻辑的结论似乎是:因此不可能做出优质系统)。

【成见十】从结果上看,机器学习总是胜过规则系统。

所列“成见”有两类:一类是“偏”见,如【成见一】至【成见五】。这类偏见主要源于不完全归纳,他们也许看到过或者尝试过规则系统某一个类型, 浅尝辄止,然后遽下结论(jump to conclusions)。盗亦有道,情有可原,虽然还是应该对其一一纠“正”。本文即是拨乱反正的第一篇。成见的另一类是谬见,可以事实证明其荒谬。令人惊诧的是,谬见也可以如此流行。【成见五】以降均属不攻自破的谬见。譬如【成见八】说规则系统只能分析规范性语言。事实胜于雄辩,我们开发的以规则体系为主的舆情挖掘系统处理的就是非规范的社交媒体。这个系统的大规模运行和使用也驳斥了【成见六】,可以让读者评判这样的规则系统够不够资格称为实用系统:

 

以全球500强企业为主要客户的多语言客户情报挖掘系统由前后两个子系统组成。核心引擎是后台子系统(back-end indexing engine),用于对社交媒体大数据做自动分析和抽取。分析和抽取结果用开源的Apache Lucene文本搜索引擎(lucene.apache.org) 存储。生成后台索引的过程基于Map-Reduce框架,利用计算云(computing cloud) 中200台虚拟服务器进行分布式索引。对于过往一年的社会媒体大数据存档(约300亿文档跨越40多种语言),后台索引系统可以在7天左右完成全部索引。前台子系统(front-end app)是基于 SaaS 的一种类似搜索的应用。用户通过浏览器登录应用服务器,输入一个感兴趣的话题,应用服务器对后台索引进行分布式搜索,搜索的结果在应用服务器经过整合,以用户可以预设(configurable)的方式呈现给用户。这一过程立等可取,响应时间不过三四秒。

                                                                                                                                                II.         规则系统手工性的责难

【成见一】说:规则系统的手工编制(hand-crafted)是其知识瓶颈,而机器学习是自动训练的(言下之意:因此没有知识瓶颈)。

NLP主流对规则系统和语言学家大小偏见积久成堆,这第一条可以算是万偏之源。随便翻开计算语言学会议的论文,无论讨论什么语言现象,为了论证机器学习某算法的优越,在对比批评其他学习算法的同时,规则系统大多是随时抓上来陪斗的攻击对象,而攻击的理由往往只有这么一句话,规则系统的手工性决定了 “其难以开发”(或“其不能 scale up”,“其效率低下”,“其不鲁棒”,不一而足),或者干脆不给具体理由,直接说“文献【1】【2】【3】尝试了这个问题的不同方面,但这些系统都是手工编制的”,一句话判处死刑,甚至不用讨论它们的效果和质量。手工性几乎成了规则系统的“原罪”,编制这些系统的语言学家因此成为学术共同体背负原罪的二等公民。

手工编制(hand-crafted)又如何?在日常消费品领域,这是对艺人特别的嘉奖,是对批量机械化生产和千篇一律的反抗,是独特和匠心的代表,是高价格理直气壮的理由。缘何到了NLP领域,突然就成贬义词了呢?这是因为在NLP领域,代表主流的统计学家由于他们在NLP某些任务上的非凡成功,居功自傲,把成功无限夸大,给这个共同体施行了集体催眠术,有意无意引导人相信机器学习是万能的。换句话说,批判手工编制的劣根性,其隐含的前提是机器学习是万能的,有效的,首选的。而实际情况是,面对自然语言的复杂性,机器学习只是划过了语言学的冰山一角,远远没有到主流们自觉或不自觉吹嘘的万能境界。催眠的结果是,不独不少语言学家以及NLP相关利益方(如投资人和用户)被他们洗脑了,连他们自己也似乎逐渐相信了自己编制的神话。

真实世界中,NLP 是应用学科,最终结果体现在应用软件(applications)上,属于语言软件工程。作为一个产业,软件工程领域吸引了无数软件工程师,虽然他们自嘲为“码工”,社会共同体给予他们的尊重和待遇是很高的(Bill Gates 自封了一个 Chief Engineer,说明了这位软件大王对工匠大师的高度重视)。古有鲁班,现有码师(coding master)。这些码工谁不靠手工编制代码作为立足之本呢?没听说一位明星工程师因为编制代码的手工性质而被贬损。同是软件工程,为什么计算语言学家手工编制NLP代码与其他工程师手工编制软件代码,遭遇如此不同的对待。难道是因为NLP应用比其他应用简单?恰恰相反,自然语言的很多应用比起大多数应用(譬如图形软件、字处理软件等等)更加复杂和艰难。解释这种不同遭遇的唯一理由就是,作为大环境的软件领域没有NLP主流的小环境里面那么多的傲慢和偏见。软件领域的大师们还没有狂妄到以为可以靠自动编程取代手工编程。他们在手工编程的基础建设(编程架构和开发环境等)上下功夫,而不是把希望寄托在自动编程的万能上。也许在未来的某一天,一些简单的应用可以用代码自动化来实现,但是复杂任务的全自动化从目前来看是遥遥无期的。不管从什么标准来看,非浅层的自然语言分析和理解都是复杂任务的一种。因此,机器学习作为自动编程的一个体现是几乎不可能取代手工代码的。规则系统的NLP应用价值会长期存在。

自动是一个动听的词汇。如果一切人工智能都是自动学习的,前景该有多么美妙。机器学习因为与自动连接在一起,显得那么高高在上,让人仰视。它承载着人类对未来世界的幻想。这一切理应激励自动学习专家不断创新,而绝不该成为其傲慢和偏见的理由。

在下面具体论述所谓规则系统的知识瓶颈软肋之前,值得一提的是,本文所谓自动是指系统的开发,不要混淆为系统的应用。在应用层面,无论是机器学习出来的系统,还是手工编制的系统,都是全自动地服务用户的,这是软件应用的性质决定的。虽然这是显而易见的事实,可确实有人被误导,一听说手工编制,就引申为基于规则系统的应用也是手工的,或者半自动的。

手工编制NLP系统是不是规则系统的知识瓶颈?毋庸讳言,确实如此。这个瓶颈体现在系统开发的周期上。但是,这个瓶颈是几乎所有大型软件工程项目所共有的,是理所当然的资源成本,不独为 NLP “专美”。从这个意义上看,以知识瓶颈诟病规则系统是可笑的,除非可以证明对所有NLP项目,用机器学习开发系统比编制规则系统,周期短且质量高(个别的项目可能是这样,但一般而言绝非如此,后面还要详谈)。大体说来,对于NLP的浅层应用(譬如中文切词,专名识别,等等),没有三个月的开发,没有至少一位计算语言学家手工编制和调试规则和至少半个工程师的平台层面的支持,是出不来规则系统的。对于NLP的深层应用(如句法分析,舆情抽取等),没有至少一年的开发,涉及至少一位计算语言学家的手工编制规则,至少半个质量检测员的协助和半个工程师的平台支持,外加软件工程项目普遍具有的应用层面的用户接口开发等投入,也是出不来真正的软件产品的。当然需要多少开发资源在很大程度上决定于开发人员(包括作为知识工程师的计算语言学家)的经验和质量以及系统平台和开发环境的基础(infrastructures)如何。

计算语言学家编制规则系统的主体工作是利用形式化工具编写并调试语言规则、各类词典以及语言分析的流程调控。宏观上看,这个过程与软件工程师编写应用程序没有本质不同,不过是所用的语言、形式框架和开发平台(language,formalism and development platform)不同,系统设计和开发的测重点不同而已。这就好比现代的工程师用所谓高级语言 Java 或者 C,与30年前的工程师使用汇编语言的对比类似,本质是一样的编程,只是层次不同罢了。在为NLP特制的“高级”语言和平台上,计算语言学家可以不用为内存分配等非语言学的工程细节所羁绊,一般也不用为代码的优化和效率而烦扰,他们的注意力更多地放在面对自然语言的种种复杂现象,怎样设计语言处理的架构和流程,怎样平衡语言规则的条件宽窄,怎样与QA(质量检测)协调确保系统开发的健康,怎样保证语言学家团队编制规则的操作规范(unit testing,regression testing,code review,baselines,等等)以确保系统的可持续性,怎样根据语言开发需求对于现有形式框架的限制提出扩展要求,以及怎样保证复杂系统的鲁棒性,以及怎样突破规则系统的框架与其他语言处理包括机器学习进行协调,等等。一个领头的计算语言学家就是规则系统的架构师,系统的成败绝不仅仅在于语言规则的编制及其堆积,更多的决定于系统架构的合理性。明星工程师是软件企业的灵魂,NLP 规则系统的大规模成功也一样召唤着语言工程大师。

关于知识瓶颈的偏见,必须在对比中评估。自然语言处理需要语言学知识,把这些知识形式化是每个NLP系统的题中应有之义,机器学习绝不会自动免疫,无需知识的形式化。规则系统需要语言学家手工开发的资源投入,机器学习也同样需要资源的投入,不过是资源方式不同而已。具体说,机器学习的知识瓶颈在于需要大数量的训练数据集。排除研究性强实用性弱的无监督学习(unsupervised learning),机器学习中可资开发系统的方法是有监督的学习(supervised learning)。有监督的学习能开发知识系统成为应用的前提是必须有大量的手工标注的数据,作为学习的源泉。虽然机器学习的过程是自动的(学习算法的创新、调试和实现当然还是手工的),但是大量的数据标注则是手工的(本来就有现成标注不计,那是例外)。因此,机器学习同样面临知识瓶颈,不过是知识瓶颈的表现从需要少量的语言学家变成需要大量的低端劳动者(懂得语言及其任务的中学生或大学生即可胜任)。马克思说金钱是一般等价物,知识瓶颈的问题于是转化为高级劳动低级劳动的开销和转换问题:雇佣一个计算语言学家的代价大,还是雇佣10个中学生的代价大?虽然这个问题根据不同项目不同地区等因素答案会有不同,但所谓机器学习没有知识瓶颈的神话可以休矣。

另外,知识瓶颈的对比问题不仅仅是针对一个应用而言,而应该放在多应用的可移植性上来考察。我们知道大多数非浅层的NLP应用的技术支持都源于从自然语言做特定的信息抽取:抽取关系、事件、舆情等。由于机器学习把信息抽取看成一个直接对应输入和输出的黑匣子,所以一旦改变信息抽取目标和应用方向,以前的人工标注就废弃了,作为知识瓶颈的标注工作必须完全重来。可是规则系统不同,它通常设计成一个规则层级体系,由独立于领域的语言分析器(parser)来支持针对领域的信息抽取器(extractor)。结果是,在转移应用目标的时候,作为技术基础的语言分析器保持不变,只需重新编写不同的抽取规则而已。实践证明,对于规则系统,真正的知识瓶颈在语言分析器的开发上,而信息抽取本身花费不多。这是因为前者需要应对自然语言变化多端的表达方式,将其逻辑化,后者则是建立在逻辑形式(logical form)上,一条规则等价于底层规则的几百上千条。因此,从多应用的角度看,规则系统的知识成本趋小,而机器学习的知识成本则没有这个便利。

                                                                                                                                                III.        主流的反思

如前所述,NLP领域主流意识中的成见很多,积重难返。世界上还很少有这样的怪现象:号称计算语言学(Computational Linguistics)的领域一直在排挤语言学和语言学家。语言学家所擅长的规则系统,与传统语言学完全不同,是可实现的形式语言学(Formal Linguistics)的体现。对于非浅层的NLP任务,有效的规则系统不可能是计算词典和文法的简单堆积,而是蕴含了对不同语言现象的语言学处理策略(或算法)。然而,这一路研究在NLP讲台发表的空间日渐狭小,资助亦难,使得新一代学人面临技术传承的危险。Church (2007)指出,NLP研究统计一边倒的状况是如此明显,其他的声音已经听不见。在浅层NLP的低垂果实几乎全部采摘完毕以后,当下一代学人面对复杂任务时,语言学营养缺乏症可能导致统计路线捉襟见肘。

可喜的是,近年来主流中有识之士(如,Church 2007, Wintner 2009)开始了反思和呼吁,召唤语言学的归来:“In essence, linguistics is altogether missing in contemporary natural language engineering research. … I want to call for the return of linguistics to computational linguistics.”(Wintner 2009)。相信他们的声音会受到越来越多的人的注意。

 

参考文献
  • Church 2007. A Pendulum Swung Too Far.  Linguistics issues in Language Technology,  Volume 2, Issue 4.
  • Wintner 2009. What Science Underlies Natural Language Engineering? Computational Linguistics, Volume 35, Number 4

 

原载 《W. Li & T. Tang: 主流的傲慢与偏见:规则系统与机器学习》
【计算机学会通讯】2013年第8期(总第90期)

[Abstract]

Pride and Prejudice in Mainstream:  Rule System vs. Machine Learning

In the area of Computational Linguistics, there are two basic approaches to natural language processing, the traditional rule system and the mainstream machine learning.  They are complementary and there are pros and cons associated with both.  However, as machine learning is the dominant mainstream philosophy reflected by the overwhelming ratio of papers published in academia, the area seems to be heavily biased against the rule system methodology.  The tremendous success of machine learning as applied to a list of natural language tasks has reinforced the mainstream pride and prejudice in favor of one and against the other.   As a result, there are numerous specious views which are often taken for granted without check, including attacks on the rule system's defects based on incomplete induction or misconception.  This is not healthy for NLP itself as an applied research area and exerts an inappropriate influence on the young scientists coming to this area.  This is the first piece of a series of writings aimed at correcting the prevalent prejudice, focused on the in-depth examination of the so-called hand-crafted defect of the rule system and the associated  knowledge bottleneck issue.

【相关】

K. Church: A Pendulum Swung Too Far, Linguistics issues in Language Technology, 2011; 6(5)

【科普随笔:NLP主流的傲慢与偏见】

Pride and Prejudice of NLP Main Stream

On Hand-crafted Myth and Knowledge Bottleneck

Domain portability myth in natural language processing

关于NLP方法论以及两条路线之争】 专栏:NLP方法论

【置顶:立委NLP博文一览】

《朝华午拾》总目录

 

 

On Recall of Grammar Engineering Systems

After I showed the benchmarking results of SyntaxNet and our rule system based on grammar engineering, many people seem to be surprised by the fact that the rule system beats the newest deep-learning based parser in data quality.  I then got asked many questions, one question is:

Q: We know that rules crafted by linguists are good at precision, how about recall?

This question is worth a more in-depth discussion and serious answer because it touches the core of the viability of the "forgotten" school:  why is it still there? what does it have to offer? The key is the excellent data quality as advantage of a hand-crafted system, not only for precision, but high recall is achievable as well.

Before we elaborate, here was my quick answer to the above question:

  • Unlike precision, recall is not rules' forte, but there are ways to enhance recall;
  • To enhance recall without precision compromise, one needs to develop more rules and organize the rules in a hierarchy, and organize grammars in a pipeline, so recall is a function of time;
  • To enhance recall with limited compromise in precision, one can fine-tune the rules to loosen conditions.

Let me address these points by presenting the scene of action for this linguistic art in its engineering craftsmanship.

A rule system is based on compiled computational grammars.  A grammar is a set of linguistic rules encoded in some formalism.  What happens in grammar engineering is not much different from other software engineering projects.  As knowledge engineer, a computational linguist codes a rule in a NLP-specific language, based on a development corpus.  The development is data-driven, each line of rule code goes through rigid unit tests and then regression tests before it is submitted as part of the updated system.  Depending on the design of the architect, there are all types of information available for the linguist developer to use in crafting a rule's conditions, e.g. a rule can check any elements of a pattern by enforcing conditions on (i) word or stem itself (i.e. string literal, in cases of capturing, say, idiomatic expressions), and/or (ii) POS (part-of-speech, such as noun, adjective, verb, preposition), (iii) and/or orthography features (e.g. initial upper case, mixed case, token with digits and dots), and/or (iv) morphology features (e.g. tense, aspect, person, number, case, etc. decoded by a previous morphology module), (v) and/or syntactic features (e.g. verb subcategory features such as intransitive, transitive, ditransitive), (vi) and/or lexical semantic features (e.g. human, animal, furniture, food, school, time, location, color, emotion).  There are almost infinite combinations of such conditions that can be enforced in rules' patterns.  A linguist's job is to use such conditions to maximize the benefits of capturing the target language phenomena, through a process of trial and error.

Given the description of grammar engineering as above, what we expect to see in the initial stage of grammar development is a system precision-oriented by nature.  Each rule developed is geared towards a target linguistic phenomenon based on the data observed in the development corpus: conditions can be as tight as one wants them to be, ensuring precision.  But no single rule or a small set of rules can cover all the phenomena.  So the recall is low in the beginning stage.  Let us push things to extreme, if a rule system is based on only one grammar consisting of only one rule, it is not difficult to quickly develop a system with 100% precision but very poor recall.  But what is good of a system that is precise but without coverage?

So a linguist is trained to generalize.  In fact, most linguists are over-trained in school for theorizing and generalization before they get involved in software industrial development.  In my own experience in training new linguists into knowledge engineers, I often have to de-train this aspect of their education by enforcing strict procedures of data-driven and regression-free development.  As a result, the system will generalize only to the extent allowed to maintain a target precision, say 90% or above.

It is a balancing art.  Experienced linguists are better than new graduates.  Out of  explosive possibilities of conditions, one will only test some most likely combination of conditions based on linguistic knowledge and judgement in order to reach the desired precision with maximized recall of the target phenomena.  For a given rule, it is always possible to increase recall at compromise of precision by dropping some conditions or replacing a strict condition by a loose condition (e.g. checking a feature instead of literal, or checking a general feature such as noun instead of a narrow feature such as human).  When a rule is fine-tuned with proper conditions for the desired balance of precision and recall, the linguist developer moves on to try to come up with another rule to cover more space of the target phenomena.

So, as the development goes on, and more data from the development corpus are brought to the attention on the developer's radar, more rules are developed to cover more and more phenomena, much like silkworms eating mulberry leaves.  This is incremental enhancement fairly typical of software development cycles for new releases.  Most of the time, newly developed rules will overlap with existing rules, but their logical OR points to an enlarged conquered territory.  It is hard work, but recall gradually, and naturally, picks up with time while maintaining precision until it hits long tail with diminishing returns.

There are two caveats which are worth discussing for people who are curious about this "seasoned" school of grammar engineering.

First, not all rules are equal.  A non-toy rule system often provides mechanism to help organize rules in a hierarchy for better quality as well as easier maintenance: after all, a grammar hard to understand and difficult to maintain has little prospect for debugging and incremental enhancement.  Typically, a grammar has some general rules at the top which serve as default and cover the majority of phenomena well but make mistakes in the exceptions which are not rare in natural language.  As is known to all, naturally language is such a monster that almost no rules are without exceptions.  Remember in high school grammar class, our teacher used to teach us grammar rules.  For example, one rule says that a bare verb cannot be used as predicate with third person singular subject, which should agree with the predicate in person and number by adding -s to the verb: hence, She leaves instead of *She leave.  But soon we found exceptions in sentences like The teacher demanded that she leave.  This exception to the original rule only occurs in object clauses following certain main clause verbs such as demand, theoretically labeled  by linguists as subjunctive mood.  This more restricted rule needs to work with the more general rule to result in a better formulated grammar.

Likewise, in building a computational grammar for automatic parsing or other NLP tasks, we need to handle a spectrum of rules with different degrees of generalizations in achieving good data quality for a balanced precision and recall.  Rather than adding more and more restrictions to make a general rule not to overkill the exceptions, it is more elegant and practical to organize the rules in a hierarchy so the general rules are only applied as default after more specific rules are tried, or equivalently, specific rules are applied to overturn or correct the results of general rules.  Thus, most real life formalisms are equipped with hierarchy mechanism to help linguists develop computational grammars to model the human linguistic capability in language analysis and understanding.

The second point that relates to the topic of recall of a rule system is so significant but often neglected that it cannot be over-emphasized and it calls for a separate writing in itself.  I will only present a concise conclusion here.  It relates to multiple levels of parsing that can significantly enhance recall for both parsing and parsing-supported NLP applications.  In a multi-level rule system, each level is one module of the system, involving a grammar.  Lower levels of grammars help build local structures (e.g. basic Noun Phrase), performing shallow parsing.  System thus designed are not only good for modularized engineering, but also great for recall because shallow parsing shortens the distance of words that hold syntactic relations (including long distance relations) and lower level linguistic constructions clear the way for generalization by high level rules in covering linguistic phenomena.

In summary, a parser based on grammar engineering can reach very high precision and there are proven effective ways of enhancing its recall.  High recall can be achieved if enough time and expertise are invested in its development.  In case of parsing, as shown by test results, our seasoned English parser is good at both precision (96% vs. SyntaxNet 94%) and recall (94% vs. SyntaxNet 95%, only 1 percentage point lower than SyntaxNet) in news genre, and with regards to social media, our parser is robust enough to beat SyntaxNet in both precision (89% vs. SyntaxNet 60%) and recall (72% vs. SyntaxNet 70%).

 

[Related]

Is Google SyntaxNet Really the World’s Most Accurate Parser?

It is untrue that Google SyntaxNet is the “world’s most accurate parser”

R. Srihari, W Li, C. Niu, T. Cornell: InfoXtract: A Customizable Intermediate Level Information Extraction Engine. Journal of Natural Language Engineering, 12(4), 1-37, 2006

K. Church: A Pendulum Swung Too Far, Linguistics issues in Language Technology, 2011; 6(5)

Pros and Cons of Two Approaches: Machine Learning vs Grammar Engineering

Pride and Prejudice of NLP Main Stream

On Hand-crafted Myth and Knowledge Bottleneck

Domain portability myth in natural language processing

Introduction of Netbase NLP Core Engine

Overview of Natural Language Processing

Dr. Wei Li’s English Blog on NLP

 

 

Small talk: World's No 0

A few weeks ago, I had a chat with my daughter who's planning to study cs.
"Dad, how are things going?"
"Got a problem: Google announced SyntaxNet claimed to be world's no 1."
"Why a problem?"
"Well if they are no 1, where am I?"
"No 2?"
"No, I don't know who is no 1, but I have never seen a system beating ours. I might just as well be no 0."
"Brilliant, I like that! Then stay in no 0, and let others fight for no 1. ....... In my data structure, I always start with 0 any way."

It is untrue that Google SyntaxNet is the "world’s most accurate parser"

As we all know, natural language parsing is fairly complex but instrumental in Natural Language Understanding (NLU) and its applications.  We also know that a breakthrough to 90%+ accuracy for parsing is close to human performance and is indeed an achievement to be proud of.  Nevertheless, following the common sense, we all have learned that you got to have greatest guts to claim the "most" for anything without a scope or other conditions attached, unless it is honored by authoritative agencies such as Guinness.  For Google's claim of "the world's most accurate parser", we only need to cite one system out-performing theirs to prove its being untrue or misleading.  We happen to have built one.

For a long time, we know that our English parser is near human performance in data quality, and is robust, fast and scales up to big data in supporting real life products.  For the approach we take, i.e. the approach of grammar engineering, which is the other "school" from the mainstream statistical parsing, this was just a natural result based on the architect's design and his decades of linguistic expertise.  In fact, our parser reached near-human performance over 5 years ago, at a point of diminishing returns, hence we decided not to invest heavily any more in its further development.  Instead, our focus was shifted to its applications in supporting open-domain question answering and fine-grained deep sentiment analysis for our products, as well as to the multilingual space.

So a few weeks ago when Google announced SyntaxNet, I was bombarded by the news cited to me from all kinds of channels by many colleagues of mine, including my boss and our marketing executives.  All are kind enough to draw my attention to this "newest breakthrough in NLU" and seem to imply that we should work harder, trying to catch up with the giant.

In my mind, there has never been doubt that the other school has a long way before they can catch us.  But we are in information age, and this is the power of Internet: eye-catching news from or about a giant, true or misleading, instantly spreads to all over the world.  So I felt the need to do some study, not only to uncover the true picture of this space, but more importantly, also to attempt to educate the public and the young scholars coming to this field that there have always been and will always be two schools of NLU and AI (Artificial Intelligence).  These two schools actually have their respective pros and cons, they can be complementary and hybrid, but by no means can we completely ignore or replace one by the other.  Plus, how boring a world would become if there were only one approach, one choice, one voice, especially in core cases of NLU such as parsing (as well as information extraction and sentiment analysis, among others) where the "select approach" does not perform nearly as well as the forgotten one.

So I instructed a linguist who was not involved in the development of the parser to benchmark both systems as objectively as possible, and to give an apples-to-apples comparison of their respective performance.  Fortunately, the Google SyntaxNet outputs syntactic dependency relationships and ours is also mainly a dependency parser.  Despite differences in details or naming conventions, the results are not difficult to contrast and compare based on linguistic judgment.  To make things simple and fair, we fragment a parse tree of an input sentence into binary dependency relations and let the testor linguist judge; once in doubt, he will consult another senior linguist to resolve, or to put on hold if believed to be in gray area, which is rare.

Unlike some other areas of NLP tasks, e.g. sentiment analysis, where there is considerable space of gray area or inter-annotator disagreement, parsing results are fairly easy to reach consensus among linguists.  Despite the different format such results are embodied in by two systems (an output sample is shown below), it is not difficult to make a direct comparison of each dependency in the sentence tree output of both systems.  (To be stricter on our side, a patched relationship called Next link used in our results do not count as a legit syntactic relation in testing.)

SyntaxNet output:

1.Input: President Barack Obama endorsed presumptive Democratic presidential nominee Hillary Clinton in a web video Thursday .
Parse:
endorsed VBD ROOT
 +-- Obama NNP nsubj
 |   +-- President NNP nn
 |   +-- Barack NNP nn
 +-- Clinton NNP dobj
 |   +-- nominee NN nn
 |   |   +-- presumptive JJ amod
 |   |   +-- Democratic JJ amod
 |   |   +-- presidential JJ amod
 |   +-- Hillary NNP nn
 +-- in IN prep
 |   +-- video NN pobj
 |       +-- a DT det
 |       +-- web NN nn
 +-- Thursday NNP tmod
 +-- . . punct

Netbase output:
g1

Benchmarking was performed in two stages as follows.

Stage 1, we select English formal text in the news domain, which is SyntaxNet's forte as it is believed to have much more training data in news than in other styles or genres.  The announced 94% accuracy in news parsing is indeed impressive.  In our case, news is not the major source of our development corpus because our goal is to develop a domain-independent parser to support a variety of genres of English text for real life applications on text such as social media (informal text) for sentiment analysis, as well as technology papers (formal text) for answering how questions.

We randomly select three recent news article for this testing, with the following  links.

(1) http://www.cnn.com/2016/06/09/politics/president-barack-obama-endorses-hillary-clinton-in-video/
(2) Part of news from: http://www.wsj.com/articles/nintendo-gives-gamers-look-at-new-zelda-1465936033
(3) Part of news from: http://www.cnn.com/2016/06/15/us/alligator-attacks-child-disney-florida/

Here are the benchmarking results of parsing the above for the news genre:

(1) Google SyntaxNet:  F-score= 0.94
(tp for true positive, fp for false positive, tn for true negative;
P for Precision, R for Recall, and F for F-score)

P = tp/(tp+fp) = 1737/(1737+104) = 1737/1841 = 0.94
R = tp/(tp+tn) = 1737/(1737+96) = 1737/1833 = 0.95
F= 2*[(P*R)/(P+R)] = 2*[(0.94*0.95)/(0.94+0.95)] = 2*(0.893/1.89) = 0.94

(2) Netbase parser:  F-score = 0.95

P = tp/(tp+fp) = 1714/(1714+66) = 1714/1780 = 0.96
R = tp/(tp+tn) = 1714/(1714+119) = 1714/1833 = 0.94
F = 2*[(P*R)/(P+R)] = 2*[(0.96*0.94)/(0.96+0.94)] = 2*(0.9024/1.9) = 0.95

So the Netbase parser is about 2 percentage points better than Google SyntaxNet in precision but 1 point lower in recall.  Overall, Netbase is slightly better than Google in the precision-recall combined measures of F-score.  As both parsers are near the point of diminishing returns for further development, there is not too much room for further competition.

Stage 2, we select informal text, from social media Twitter to test a parser's robustness in handling "degraded text": as is expected, degraded text will always lead to degraded performance (for a human as well as a machine), but a robust parser should be able to handle it with only limited degradation.  If a parser can only perform well in one genre or one domain and the performance drastically falls in other genres, then this parser is not of much use because most genres or domains do not have as large labeled data as the seasoned news genre.  With this knowledge bottleneck, a parser is severely challenged and limited in its potential to support NLU applications.  After all, parsing is not the end, but a means to turn unstructured text into structures to support semantic grounding to various applications in different domains.

We randomly select 100 tweets from Twitter for this testing, with some samples shown below.

1.Input: RT @ KealaLanae : ?? ima leave ths here. https : //t.co/FI4QrSQeLh2.Input: @ WWE_TheShield12 I do what I want jk I ca n't kill you .10.Input: RT @ blushybieber : Follow everyone who retweets this , 4 mins?

20.Input: RT @ LedoPizza : Proudly Founded in Maryland. @ Budweiser might have America on their cans but we think Maryland Pizza sounds better

30.Input: I have come to enjoy Futbol over Football ⚽️

40.Input: @ GameBurst That 's not meant to be rude. Hard to clarify the joke in tweet form .

50.Input: RT @ undeniableyella : I find it interesting , people only talk to me when they need something ...

60.Input: Petshotel Pet Care Specialist Jobs in Atlanta , GA # Atlanta # GA # jobs # jobsearch https : //t.co/pOJtjn1RUI

70.Input: FOUR ! BUTTLER nailed it past the sweeper cover fence to end the over ! # ENG - 91/6 -LRB- 20 overs -RRB- . # ENGvSL https : //t.co/Pp8pYHfQI8

79..Input: RT @ LenshayB : I need to stop spending money like I 'm rich but I really have that mentality when it comes to spending money on my daughter

89.Input: RT MarketCurrents : Valuation concerns perk up again on Blue Buffalo https : //t.co/5lUvNnwsjA , https : //t.co/Q0pEHTMLie

99.Input: Unlimited Cellular Snap-On Case for Apple iPhone 4/4S -LRB- Transparent Design , Blue/ https : //t.co/7m962bYWVQ https : //t.co/N4tyjLdwYp

100.Input: RT @ Boogie2988 : And some people say , Ethan 's heart grew three sizes that day. Glad to see some of this drama finally going away. https : //t.co/4aDE63Zm85

Here are the benchmarking results for the social media Twitter:

(1) Google SyntaxNet:  F-score = 0.65

P = tp/(tp+fp) = 842/(842+557) = 842/1399 = 0.60
R = tp/(tp+tn) = 842/(842+364) = 842/1206 = 0.70
F = 2*[(P*R)/(P+R)] = 2*[(0.6*0.7)/(0.6+0.7)] = 2*(0.42/1.3) = 0.65

Netbase parser:  F-score = 0.80

P = tp/(tp+fp) = 866/(866+112) = 866/978 = 0.89
R = tp/(tp+tn) = 866/(866+340) = 866/1206 = 0.72
F = 2*[(P*R)/(P+R)] = 2*[(0.89*0.72)/(0.89+0.72)] = 2*(0.64/1.61) = 0.80

For the above benchmarking results, we leave it to the next blog for interesting observations and more detailed illustration, analyses and discussions.

To summarize,  our real life production parser beats Google's research system SyntaxtNet in both formal news text (by a small margin as we both are already near human performance) and informal text, with a big margin of 15 percentage points.  Therefore, it is safe to conclude that Google's SytaxNet is by no means "world’s most accurate parser", in fact, it has a long way to get even close to the Netbase parser in adapting to the real world English text of various genres for real life applications.

 

[Related]

Is Google SyntaxNet Really the World’s Most Accurate Parser?

Announcing SyntaxNet: The World’s Most Accurate Parser Goes Open

K. Church: "A Pendulum Swung Too Far", Linguistics issues in Language Technology, 2011; 6(5)

Pros and Cons of Two Approaches: Machine Learning vs Grammar Engineering

Introduction of Netbase NLP Core Engine

Overview of Natural Language Processing

Dr. Wei Li's English Blog on NLP

 

Is Google SyntaxNet Really the World's Most Accurate Parser?

Google is a giant and its marketing is more than powerful.  While the whole world was stunned at their exciting claim in Natural Language Parsing and Understanding, while we respect Google research and congratulate their breakthrough in statistical parsing space, we have to point out that their claim in their recently released blog that that SyntaxNet is the "world’s most accurate parser" is simply not true.  In fact, far from truth.

The point is that they have totally ignored the other school of NLU, which is based on linguistic rules, as if it were non-existent.  While it is true that for various reasons, the other school is hardly presented any more in academia today due to the  mainstream's dominance by machine learning (which is unhealthy but admittedly a reality, see Church's long article for a historical background of this inbalance in AI and NLU:  K. Church: "A Pendulum Swung Too Far"), any serious researcher knows that it has never vanished from the world, and it actually has been well developed in industry's real life applications for many years, including ours.

In the same blog, Google mentioned that Parsey McParseface is the "most accurate such model in the world",  with model referring to "powerful machine learning algorithms".  This statement seems to be true based on their cited literature review, but the equating this to the "world's most accurate parser" publicized in the same blog news and almost instantly disseminated all over the media and Internet is simply irresponsible, and misleading at the very least.

In the next blog of mine, I will present an apples-to-apples comparison of Google's SyntaxNet with the NetBase deep parser to prove and illustrate the misleading nature of Google's recent announcement.

Stay tuned.

 

[Related]

It is untrue that Google SyntaxNet is the “world’s most accurate parser”

Announcing SyntaxNet: The World’s Most Accurate Parser Goes Open

K. Church: "A Pendulum Swung Too Far", Linguistics issues in Language Technology, 2011; 6(5)

Pros and Cons of Two Approaches: Machine Learning vs Grammar Engineering

Introduction of Netbase NLP Core Engine

Overview of Natural Language Processing

Dr. Wei Li's English Blog on NLP

 

 

【没有翻不了的案子,兼论专家vs学习的现状】

白:
分层不是要害,one way才是

我:

什么叫 one way? 没有不可推翻的。原则上讲,如果某个现象足够突出,值得去做,NLP 就没有翻不了的案子。连毛太祖钦定的文化大革命都全面否定、彻底翻案了。

Parsing的分层设计本身隐含了语言学的流程和算法,但与一切的语言学规则一样,规则的背后就是例外。只不过规则及其例外构成的 hierarchy 在同一层表现,而分层的例外则在 pipeline(管式)中处置。经常是做几层 就加一层 patching 做例外处置或修正,也有留到最后通过【词驱动】(word-driven)去唤醒的。词驱动不单单是词,可以是任意可能 trigger 歧义休眠及其唤醒的 ngram。(非词驱动的唤醒,如果需要,还需要研究,目前不太清晰。)但凡是可以词驱动的,问题就不大,因为词驱动聚焦了特定的歧义现象,错误的 parse 在聚焦为有限子树patterns以后是可以预计的,当然也就可以修正。错误不怕,就怕错误不可预测。可预测的 consistent 的错误,在管式架构下不是挑战,不必担心其 error propagation,如果设计者具有“负负得正”的准备和机制的话。

白:
唤醒的ngram再进一步,就是一个CNN了。parsing用明网RNN,休眠唤醒用暗网CNN。相得益彰啊。

我:
听上去高大上,cnn fox abc 呵呵

白:
多层卷积

我:

我骨子里是相信数据的,相信大数据的自动学习,因为太多的语言细节隐含其内,终归是可以挖掘出来帮助parsing和理解的。但不大相信短期内可以改天换地,匹敌专家的经验积累。

syntaxnet 已经被我剁成稀泥了。但同时也注意到 statistical parsing 的精度在最成熟的文体 news 方面,很多年 stuck 在 80 以下,syntaxnet 确实突破了 90,这个成就让他们忘乎所以一把、吹点不符合实际的牛也是情有可原的,虽然多年前我们就把规则系统做到了 90 以上的parsing精度,当时的感觉是理所当然,貌似苦力不值得弹冠相庆(不是蛮力,当然也不可能仅仅是力气活,还有架构者的设计匠心和类似 dark art 一样不可言传的绝技,譬如经年经验加研究而来的 NL“毛毛虫”的formalism及其实现,等等)。没有炫耀,就这么一直默默地领先了“主流”很多年。

虽然仍然无法匹敌规则系统,但深度神经的运用的确使得统计型parser有了新闻领域内的90的突破。很好奇他们如今用了多大的训练库,还用了什么 tricks(据报道行内达人声称真正能玩转深度神经系统的大牛全世界不过百人,因为里面不仅仅是科学,还是 art),其他人多快可以重复结果?最后的大问题是,cnn rnn 等深度神经的牛算法,多快可以移植到新的文体、新的domain和新的语言,这种成功移植的最低条件(譬如最少需要多大的带标数据)是什么。未来的某个时候,如果新的文体新的语言,就像流水线一样,可以高质量快速自动学习出来一个个可应用的 parser 出来,语言学专家们也就死得其所,可以安然地“永垂不朽”了。

不过,在共产主义神经大同真能实现之前,专家还不愁饭碗。

在 parsing 这个NLP核心任务方面,要赶上专家的系统质量也并非易事,因为专家的系统已经证明可以做到非常接近人的分析水平,而且文体和领域独立,鲁棒、线速且可以 scale up,这对学习有诸多挑战。Deep parsing,专家一边是 production system,已经达到实用的高度,学习一边还是 research 在努力追赶,这就是 parsing 质量的现状。可很多人误导或被误导,把深度神经未来可能的成功当成现实或铁定,完全无视专家系统现实的存在。

 

【相关】

立委科普:歧义parsing的休眠唤醒机制再探】 

【泥沙龙笔记:语法工程派与统计学习派的总结】

《新智元笔记:NLP 系统的分层挑战》

[转载]【白硕 – 穿越乔家大院寻找“毛毛虫”】

【科研笔记:NLP “毛毛虫” 笔记,从一维到二维】

NLP 是一个力气活:再论成语不是问题

【科普随笔:NLP主流的傲慢与偏见】

关于NLP方法论以及两条路线之争】 专栏:NLP方法论

【置顶:立委NLP博文一览】

《朝华午拾》总目录

 

【随笔:二代移民的东亚心】

也许是加州特别是湾区比较特别吧,IC 的硅谷亚裔移民多,在这里长大的亚裔青少年譬如我女儿形成了自己的种族认同趋向,表现在大小不同的种族圈里。

最认同的内圈是东亚人,包括大陆台湾香港、新马、日本、南北韩、菲律宾、印尼、越南等等。她虽然意识上知道自己是 Chinese,但日常生活和交友,基本是没有把中国人作为自己的最内的需要独立区分和认同的族裔圈。在她的观念中,东亚基本都是同种族的,没必要区别祖籍是东亚的哪个国家或地区。其中日本文化反而影响最大,主要是日本动漫带来的。这一点与我们第一代移民的感觉很不同。

她的第二个圈子包括了南亚的印巴人。印度人虽然肤色等都与东亚人不同,但是她还是相当认同和感到亲切的。原因大体有二:一是湾区印度人太多了,从小一起玩的同学很多都是印度孩子;二来,印度文化与东亚文化也的确有很多相同之处,家庭背景大多技术出身,重视教育,鼓励勤勉,比较低调友善。都是亚裔,相处容易。

第三个圈子开始涵盖老墨。主要原因与印度人类似,一是墨西哥人在加州很多,不少西裔背景的同学朋友,二是老墨也都很友善低调勤恳。

第四个圈子是白人,非我族裔的感觉开始凸显。其实,高中同学中也有三分之一以上的白人,但还是明显感觉到差异。学校里,亚裔的孩子与亚裔的扎堆,白孩子一般与白孩子玩儿。当年有意选了一个有相当白孩子比例的高中,就是为了让孩子有个接触更多种族的机会,结果学校里还是自然地人以群分。其他高中常常是压倒性的亚裔,就更无法认同非亚裔了。这是加州湾区。在内陆的那些白人压倒多数的州,亚裔孩子就被同化多了,因此这种种族差异的感觉也就少了。

最后的圈子是黑人。硅谷高科技区黑人很少,加上文化的迥异,也因此感觉最为遥远。

我觉得我女儿的种族认同圈和差异感,相当典型,代表了加州亚裔环境长大孩子的种族意识。譬如交朋友,就有意无意的从最内的东亚圈开始,逐步向外伸展,不到不得已,不愿意突破圈圈向外。有意思的是,择偶与一般交友不同,除了在东亚圈子里找以外,其次就是白人圈,很少在老印老墨更甭提老黑的圈子里找。前几天女儿自己还说,我们在加州环境长大,缺乏对白人和黑人文化的了解,这一课迟早要补回来,我们总不能一辈子不出加州啊。而她儿时在水牛城的亚裔小伙伴,如今已经完全被白人文化同化了,这个差别很明显。

所谓“我的中国心”(包括对祖国的乡愁和思念)也就是一代移民的心理和经验积淀而已,很难延续到二代,更甭提二代以下了。一切的中国文化的灌输都敌不过美国这个大熔炉。共产主义老祖宗说过无产者无祖国的话。现在的情形是,二代移民无祖籍国。他们即便寻根也是理性化的行为,而非感情的需要。大家熟知的二代或以下的华裔移民有前驻华大使骆家辉和CNN的前主播宗毓华(Connie Chung),他们是“黄皮白心”的典型,世界观和接人待物完全西化。

【随笔:台湾不可小觑】

台湾不可小觑。起码是食文化。举几个例子。

第一个是以珍珠奶茶为代表的各式台湾茶店,把茶文化花样翻新地推向世界。湾区这几年开了一家又一家的台湾式奶茶店,开一家火一家,门前常排长龙,尤其受美国的亚裔青少年欢迎,成了他们的聚会场所。相比之下,星巴克的咖啡和茶就极少有亚裔青年光顾。我女儿到任何一个城市或大学,第一个拿来评判好坏的就是有没有地道的珍珠奶茶。85度C的 seasalt 的冰茶和冰咖啡,连我都忍不住嘴馋。

第二是鼎泰丰,这才在湾区开了一家,网上排队就要提前两个月预定。尝过一次他家的包子,的确比什么狗不理、庆丰,甚至上海小笼包,口感更细腻,有回味。堪称一绝。Valley Fair Mall 的鼎泰丰是目前唯一的一家正宗,火得一塌糊涂。

aaa

第三个是台湾糖村的牛轧糖,我的天,入口酥脆,再嚼即化,奶香沁骨,一尝钟情,二尝销魂,绕舌三日,回味不绝。我从小不喜甜食,可是自从尝到了台湾糖村的牛轧糖,我就开始尝遍各地牛轧糖,有上海豫园的,有台湾其他店家(85度C),也有日本产的,就是没有一家有糖村的那个完美。

至于台湾牛肉面、台湾面包房(85度C为代表)、台湾凤梨酥,也都富有魔力。

总之,不为别的,就为这食文化,台湾就让人心服。

小品:皇帝的女儿

 

自古有言:皇帝的女儿不愁嫁。其实事情远非如此简单。

首先,都皇帝的女儿了,绝不能下嫁,hence 可嫁之对象遽减。看眼球女王冰冰便知:冰冰未嫁之前可为娱乐圈第一公主,放言:我就是豪门。豪门深似海,除了痴情笃深病入膏肓者流,谁还敢上?无奈病人不入法眼,非病者不敢造次,剩女无奈之下,随手抓了一个小生换作LC,无才无貌无幽默,略强过空气。

再者,皇帝女儿的愁你未必知悉,子非女。愁之一,追求者所为何来?伴君如伴虎,胆敢冲着皇帝女儿用心思的绝非等闲之辈,机关算尽,醉婿之意不在酒,亦不在女,在乎父皇宝座也。一切的真情与浪漫在肮脏的政治面前,黯然失色。皇女亦人女,少女春心,焉得不愁?

或曰:心仪者,与私奔可也。小娜可私奔,小圆可私奔,唯皇帝女儿不可奔。此皇女愁之二。纵有佳偶在途,心向往之,亦不可得。深宫之内,不是囹圄,固似囹圄。

 

 

 

 

《在美国写基金申请的酸甜苦辣》

 

1. 初闯 SBIR

在来美创业不到八年的时间里,我总共拿到了政府18项“小企业创新基金”(SBIR: Small Business Innovation Research),计900万美金,做了17任研究项目的主任(Principal Investigator, PI or co-PI, 拿下的第18个项目由于离职而把PI移交了),研究方向始终是信息抽取(Information Extraction)。对于SBIR的基金申请几乎百发百中(也尝试过其他基金申请,却没有成功,其中奥妙容后详述),这实际上已经达到了该基金项目所规定的饱和极限:虽然偶然有网开一面的时候,但原则上,SBIR项目的PI必须至少拿出50%的时间指导项目,也就是说,一个人最多同时担任两个项目的PI(含co-PI)。这样的成就回想起来,更多是运气的成分,天时地利人和,当然也与自己的执着和死嗑分不开,其中甘苦,难以尽述。比如,这八年就没有真正过过一次像样的圣诞节。老美庆祝圣诞就好比我们庆祝春节,圣诞是探亲团圆休长假的好时光,而圣诞总是我基金申请最繁忙的阶段,因为元月五日是SBIR基金申请的死期。

写得最苦最认真的是前两三个基金申请,后来就越写越顺了。如果18个申请都需要象前几个申请那样大的精力投入的话,就是分了身脱了皮,也不可能完成。这里的道理很简单,基金申请的成功与否,不仅仅看写得如何,有没有 ideas, 更主要的是科研实力和在政府资助人中的信誉。信誉建立了,一切都好办。开始写申请的时候,基本是纸上谈兵,没有既往的研究投入做后盾,面对的是未知的竞争者,审阅者和资助人,要想有幸被选中,基金申请报告的质量至关重要。虽然质量好的的也完全可能选不上(见过不少这样的实例),但质量有严重瑕疵而想蒙混过关是绝对不可能的。

我写的第一个基金申请,倾注了我全部心血,反复修改,跟自己死剋。领导在旁看都烦了。限量20页的申请,看我先起草了50多页,又减到30页,再压缩到20页,没完没了,说我进入死循环了。一遍一遍地捋,一遍一遍地顺,自己高声朗诵给自己听,看文字 flow 不 flow,到后来差不多可以背下来了。功夫不负苦心人,从来没有写过基金申请,也没有过海外工作经验的我,写出的这第一个基金申请就使老板对我刮目相看。她只修改了个别措辞,就决定让我署名项目的PI。(对于新人,她完全可以让我写,然后自己署名挂帅而不做事,我知道很多外国老板就是这么做的。虽然后来我羽翼丰满以后,她又深感不安,我至今还是很感激她刚开始给了我独当一面的发展机会。)项目批准以后,政府资助人来检查工作时,也对我的申请报告一再表示赞叹,说这是他审阅过的最明白透彻的申请。除了运气和苦干外,我想我这次成功还得益于两个因素:我的语言表达能力,以及我对课题细节的熟悉。尽管没有海外从事这项课题的背景,作为课题基石的自然语言研究我在国内踏踏实实做了五年,积攒了丰富的切身体验,这是博士课堂上学不到的。启动这项研究的我的老板对这个领域并不在行,虽然她对该研究的走向和应用前景能谈得头头是道,但论起具体的语言处理问题来免不了有些虚,只能人云亦云地照猫画虎。我的加盟改变了这个局面,为公司在信息抽取领域发挥影响奠定了基础。

 

2. SBIR 一览

先谈一下SBIR的概况。美国政府非常重视小企业的发展,认为这是美国经济中最活跃最创新的一个部分。SBIR 是联邦政府部门(国防部海、陆、空、航天、教育等)设立的专项基金,旨在鼓励小企业从事政府部门制定的科研蓝图中具有应用前景的课题。据说,财富500强中不少企业当年就得益于这项基金而发展了最初的技术。SBIR 基金分为三种,Phase 1 基金很少,才10万美金,资助为期九个月的可行性研究;Phase 2 为期两年,75万美金,目标是研发一个模型系统(working prototype);Phase 3 的基金不固定,50万美金或更多,有时还要求企业与政府共同投入资金(matching funds),目的是在模型的基础上开发应用系统或产品,实际上是政府在多年对某技术的科研投入后再给小企业推一把,以期其市场成功。作为投资方,政府并不要求小企业做大后对政府资助有所回报,但小企业对于政府部门使用相关技术产品应予优惠。

三个 Phase 的基金申请,Phase 1 最难,尽管钱最少。 平均约二十个申请才选中一个,命中率小于很多顶级学术会议论文的通过比率。到了 Phase 2, 命中率提高到 50%.  也就是说,政府资助的项目,同一个题目在 Phase 1 阶段通常选择两家公司平行进行,做的是相同的题目,但却没有交流,要的就是在 Phase 2 的时候好做二选一的竞争。Phase 3 是没有定数的,不能指望,有没有后续的 Phase 3 取决于相关题目的应用前景,以及政府资助人资金筹备情况等多个因素。有意思的是,Phase 3 (其中一种叫 SBIR 2 Enhancement) 一旦设立,无需竞争,完全由政府资助方的项目经理人全权决定。虽然从形式上,也要写一个基金申请报告,但是因为没有竞争对手,命中率100%,可以把申请报告当研发计划书来写,基本是走一下形式。

对于多数企业,Phase 1 即便拿到了,也是赔本的买卖,因为在仅有10万资金的条件下,为了竞争 Phase 2, 总要把工作做得更扎实一些,投入更多一些。Phase 1 的基金报告可以纸上谈兵,而申请 Phase 2 就必须包括一些实验数据支持可行性研究的结论。通常的做法多多少少是拿 Phase 2 的资源补贴 Phase 1 的工作,这种事不好明说,但不少企业不这样就很难维持研发的持续性。当年,CEO 看到我们拿了多项政府项目很高兴,因为科研团队的投入全部由政府负担了,科研出的技术成果可以无偿转化到风险投资人资助的产品开发中去,这对于刚刚起步的技术公司是很重要的。而且这种无偿技术转移是受到政府鼓励的,毕竟小企业在市场的成功,最终给国家增强的是劳工市场(帮助解决就业问题)和企业税收,政府巴不得小企业都能在政府扶持下取得市场成功。后来,CEO 凭着他职业嗅觉,发现政府项目并不总合算,有一天,他跑来跟我说,Wei, I don't want to do Phase 1s, for only 100,000, it is not worth it.  We need more Phase 2s and Phase 3s.  我笑道,我明白,你只想要二楼三楼,而不愿意兴建一楼和地基。I wish we could do that.

其实,不仅是拿到了 Phase 1 往往倒贴,没拿到之前,就已经开始投入了,主要是写基金报告所花的时间。当然,在小企业里挂帅的科学家个个都是五好员工,为写好基金报告,加班加点,夜以继日,牺牲节假日,很少听说有要求加班费的。考虑到20个申请才能选中一个,可以想见全国争取基金的小企业总共白白花费了多少资源。世界就是这样的不公平,并非有了投入,必有回报。很多技术型小企业就在这样的竞争中,耗尽有限的资金,而自生自灭了,或者转向非技术性产品或服务领域。很多小企业里负责科研项目的“科学家”,也随葬了,小企业不似大企业的研究部门,拿不到基金养活自己及其研究团队,是不能指望投资人或公司其他部门来补贴其研究的。只有少数小企业是幸运儿,有的以此为转机而在工业界成功,也有的即便没有在市场上成功,也可以依靠政府资助 (包括前期的基金和后期的政府合同) 长期运营下去,特别是当政府部门逐渐开始推广使用小企业的技术产品或服务的时候。我所服务的公司两边都沾一点,终于一分为二(spin-off),做工业产品的部门走向了市场,被另一家大公司收购,而做研发的部门成为政府项目的承包者,至今还在依靠政府的基金以及合同运行着。

 

3 鸿运+汗水+适应性+天才=成功?

话说了一箩筐,还是没到实质问题:究竟怎样才能写好基金申请?钱是硬道理,没有钱怎么科研,怎么雇人,怎么出来成果。读者诸君看热门话题不能白看,有什么成功秘籍也该露一手,造福后学啊。老实说,真地说不清,可以强调的是,一定要为审阅者着想,投其所好,减轻其负担。你想啊,审阅的人也不是神,在有限的时间里,必须完成n多申请的审阅工作。你的主意再好,如果表达不顺畅,格式不规范,很可能第一关就过不了。论述一个问题及其解决途径的时候,无论空间多紧张,务必要举实例,抽象谈论折磨的是审阅者的神经,因为他/她可能要把你的抽象自己在心里做一次转换。如果可能,所举实例最好是前后连贯的,形成一个discourse, 好像一个有头有尾的故事一样。这样你提的方案就具象化成一个使用系统的雏形,这项研究的意义也就蕴含其中了。Proposal 的含金量以及项目 PI 的资历自然是重要指标,这反映了一个资深研究人员与资历欠缺的人之间的鸿沟。但是,也不要过分夸大它的作用,否则新人还怎么起步?我刚开始写申请的时候,资历是远远不够的,PhD 还没有到手,也没有北美科研经历,更没有在北美带过科研团队,严格意义上的发表几乎是空白,唯一的资本是曾经在国内做过五年的研发,对于问题领域敏感而熟悉,语言学的背景加上某种天赋使得我的表达能力超过多数科研人员。这个世界上,万能或者千能的人不是没有,譬如镜子,:=),但为数极少,大多数都是你我这样的有某项特长,也有严重缺陷的人。(当然,我的缺陷我是从来不认账的,我要把帐算在“四人帮”头上。本来嘛,我当年没费力气就做了数学课代表的,要不是文化大革命,保不准就是第二个陈景润了。)学会藏拙,扬长避短,使我走上了基金申请的成功之路。藏拙的底线是不能闹笑话,没把握的绕着走, 基金申请又不是论文答辩,怎样行文在自己掌控之中,没有被 question 和 cross examination 的现场,当然是"不问不说"喽 (立委注:"don’t ask, don’t tell” 是美国军方针对同性恋参军设立的一个妥协政策,奥巴马声称要废除这种带有歧视性质的政策,使同性恋者可以光明正大地保卫祖国)。

我的缺陷在于我的理工背景的缺失。本来是报考理工的,可硬被塞进文科学语言学了(这个不怪四人帮,那是文革后拨乱反正的匆忙造成的阴错阳差,详见《朝华午拾:我的考研经历》 )。学传统语言学也便罢了,偏偏是交叉学科计算语言学。当年念硕士刚入行的时候,情况还不算太糟,语言学家在这个领域还有发言权,10 年不到就被一帮学统计的理呆,有如张牙舞爪的洪水猛兽,把持了这个领域的话语权,语言学家成了敲边鼓的资料员。言必称统计,机器学习遂成主流, 语言学从软的文科变成了硬的科学。不提机器学习,根本难有立足之地,尽管实际上机器学习并没有那么神,在很多复杂一点的语言问题上,根本敌不过语言学家用熟的那套传统规则系统。但是,基金审阅人大多是以统计在这个领域起家的专家,或者是跟风的政府项目经理人,二者都有极深的bias. 科研潮流,浩浩荡荡,顺之者昌,逆之者亡,是我面对的学术现状的真实写照。

我来美的时候,根本就不知道机器学习是怎么回事,只是听说过这个名词而已。问题都是烂熟于心的问题,可解决问题的路子与我熟悉的规则系统迥然不同。到我写第二个申请的时候,项目的标题即明确规定了要探索某种机器学习的方法去解决所提的问题,想绕都绕不过去。可怜我被逼得临时抱佛脚,找来一本研究生的教科书,生吞活剥研读一遍,总算在概念上大体了解了机器学习的基本原理和常用算法,也知道了它的瓶颈和局限。可怎么开写呢,拿自己的短处去硬碰硬别人的长处不是找死嘛。于是,我就提出要结合传统的规则方法和机器学习方法,取长补短,来做这个课题。这样既符合了所要求的研究方向,又站在了兼收并蓄的“道德”制高点上。这篇基金申请千锤百炼写出来以后,比样板戏读着还顺畅。我的老板是电脑系教授,机器学习是她的研究方向之一,她看了也没有找出明显的毛病,稿子审阅完,改了几个措辞,她很满意,说,唯一的遗憾是没有公式。是啊,没几个公式唬人,这项研究方案显得不够硬,含金量不足,科学度不高。可是,那不是杀我吗?我要是硬凑几个公式上去,很可能自暴其短,硬伤累累。老板一时也想不好怎么加,加什么,时限到了,就这样提交上去了。天助我也,居然侥幸通过了,从此启动了我们机器学习的研究方向。后来的路子就顺畅了,有项目就有钱,就可以招机器学习的人员来做项目。在后续的项目申请中,我们总是恰到好处地加上一些公式和具体的机器学习算法,来阐释解决方案,算是跟上了革命的大队伍和学界的大潮流。

说到含金量,其实很多课题,特别是面向应用的课题,并不是什么高精尖的火箭技术(not rocket science),不可能要求一个申请预示某种突破。撰写申请的人是游说方,有责任 highlight 自己的提议里面的亮点,谈方案远景的时候少不了这个突破那个革命的说辞,多少迎合了政府主管部门好大喜功的心态,但实际上很少有多少研究项目会包含那么多闪光的思想和科学研究的革命性转变。(纯科学的研究,突破也不多吧,更何况应用型研究。)应用领域“奇迹”的发生往往植根于细节的积累(所谓 the Devil is in the details),而不是原理上的突破。而对于问题领域的细节,我是有把握的。这是我的长处,也是我提出科研方案比较让人信服的原因。有的时候,不得不有迎合“时尚”的考量,譬如领域里正流行 bootstrapping 等机器自学习的算法,虽然很不成熟,难以解决实际问题,但是基金报告列上它对申请的批准是有益的。不用担心所提议的听上去时尚的方案最后不工作,由于科研的探索性质,最终的解决方案完全可以是另一种路子。说直白了就是,挂羊头卖狗肉不是诚实的科研态度,但是羊头狗头都挂上以后再卖狗肉就没有问题。绝不可以一棵树上吊死。

文字上的技巧就不用说了,很多科研作文指南有不少很好的建议。有一条是一定要做的,定稿前请一位英语 native speaker (比如公司秘书)做文字的修饰。不要让她擅改,因为有些技术内容虽然显得不顺畅,却不能轻易改动。但是对她提出的建议可以认真琢磨一遍,再决定接受与否,如果不接受,要不要再换一种表达法。

 

4 傍大款

为审阅者着想的延长线就是处处为 sponsor (项目资助和监护人)着想,特别是 sponsor 中的重量级经理(我们私下称之为财神爷)。为 sponsor 着想才能保证后续基金申请的胜算,特别是 Phase 2 和 Phase 3 这些油水大的项目,这一点比写好申请要重要百倍。一个基金通过后,政府会派一个项目监护人,我们需要向她汇报进度,在她来察访的时候,展示系统和成果。这些还远远不够。要想她所想,急她所急,她的任何要求,无论大小,都要放在优先的位置。即便她没有明确要求,也要主动联络,体会贯彻其精神。道理很简单:财神爷是我们科研的衣食父母。有几件事可以说一说,能看出我对衣食父母的尽心尽力,怎样保障了我们源源不断的研究经费,从而保证了研究的持续性和研究队伍的相对稳定。

我领导的系列项目的主要资助方是政府某部门信息抽取组组长A女士,她领导一个五个人的政府项目经理团队,专事信息抽取科研项目的管理和推广应用。A女士是一个聪慧而有悟性和远见的“超女”(super lady),她做事麻利,一丝不苟,精力无限,能量极大,每年在她手下管理的政府基金都是千万级的。八年下来,我们建立了密切融洽的关系,她有什么挑战和苦恼,也能坦率地跟我分享,使得我为她分忧解难成为可能。A 女士没有架子,廉洁奉公,site visit 来察访的时候,连招待快餐的三明治,她都坚持要自己付钱。她生孩子,我给她寄送的几十美元的礼品券也被退回了,说她心领了,但作为政府官员,她确实无法接受任何礼品(不知道国内掌握巨额资金的政府项目官员是怎样处理的?)。在项目的监管方面,A 女士有时严格到了苛刻的程度。每个政府项目都要写一个长长的最后报告(final report)在政府机构发表,总结这个项目的成果和教训。有几次,因为忙于基金申请,我们对现存项目的最后报告写得马虎了一点儿,她毫不留情面地打回来重做。有的报告来回折腾三五回才让她满意。她的认真和严厉不是问题,我自己也是较真的人,常常自己跟自己过不去,有她这样的监管,更加鼓励了我爱咬文嚼字千锤百炼的习惯。后来的系列最后报告, 越写越好,不断得到她的欣赏和推荐。

A 女士是有压力的。最大的压力来自上头,她管理这个被认为应用前景广阔的研究方向多年,经手上亿的资金,资助了一批大小企业和大学研究所的相关研究,可是技术转移却很不如人意,只有一些试用系统在政府机构内免费推广,用户响应并不热烈。上面开始质疑此项研究是否值得继续支持,特别是在政府科研经费预算吃紧的大环境下,完全可能撤消资助。一旦撤消,她的小组就必须解散,她自己也要转行,至少不能再管理她已经熟悉了的这个领域的项目了。所以,本质上她遇到的挑战与我的一样,没有她的资助,我的研究小组也必须解散。帮助她减轻这方面的压力,也是帮助我们自己的生存和发展。为此,我确立了帮助她的四个主要方面。首先是全力协助她准备年度检查。其次是加速科研的技术转移。第三是加快学术发表,提升该研究及其资助人在科研领域里的知名度。最后是帮助制定该领域的发展蓝图。

年度检查是对政府项目管理人的主要考核手段,其结果直接影响下一年度项目经费的重新布局。这理所当然成为 A 女士每年最为重视的事件。年度检查团队集中了政府部门的首席科学家和科研领导等重量级大牛,不能稍有差池。她总是提前三个多月就开始着手准备材料,与我们这些被资助方联络,看有什么突出的成果可以拿出来展示(demo)。我们也总是绞尽脑汁寻找科研上的最亮点,提供素材丰富她的 presentation.  重要的是能让她感受到我们急她所急的革命态度。检查关过后,特别是考核成绩优良的时候,她都及时与我们分享喜悦,并郑重感谢我们的合作。

在加速科研的技术转移方面,我们得天独厚,因为除了政府项目以外,我们乘着.com泡沫的东风,幸运地得到了千万级的华尔街风险投资(见《朝华午拾:创业之路》 )。有投资就必须做产品,在泡沫过后,资本家的耐心是极其有限的,速度慢了,很可能遭到撤资的命运。几经波折,最终,公司利用我们的信息抽取技术开发了一个品牌舆论测量的产品。尽管所用到的技术只是我们科研项目的一个部分,而且是技术中比较浅层的部分,这毕竟是一个 real life 面向市场的产品。在研发这款产品中,几个关键的 features 都是我亲自主持开发的,用的都是最实用甚至 brute-force 的方法,避免风险和不确定性,有些地方是牛刀宰鸡,譬如只用到自动分析中浅层的结果。换句话说,产品中的技术含量并不很高。当时的想法是先做出产品,以后在产品更新换代的时候,再逐步加强技术的深度转移。因为信息抽取的核心引擎已经植入产品,架构无需变化,只要定期更新引擎就可以为深度转移创造条件。但实际上深度转移后来没跟上,其中主要原因是负责工程的副总怕担风险,宁愿以不变应万变,只在应用层面修修补补,而不愿更新内核,以免伤筋动骨。一定程度上,科研和产品创新脱节了,而这超出了我能掌控的范围。尽管如此,该产品的 marketing 还是做得有模有样,先后在业界多次获奖,动静很大。本来这都是公司产品市场化过程中的题中应有之义,似乎与政府科研项目也没有太多直接关联。可我还是不厌其烦随时与A女士分享我们在市场化中的每一个成绩,包括公关宣传资料,各类奖状和报道,以及客户的正面反馈。她非常高兴,因为她需要这些资料去帮助证明这个技术的应用性,这对这个领域的科研持续得到经费至关重要。她资助的一些大公司和大学的相关研究项目,就没有这个产品化的过程,所以我们的技术产品显得特别重要。

光有产品还不足以让她对我们特别青睐。她需要我们在研究领域站住脚。头两三年忙于系统的设计和架构,以及基础设施的建设,没有顾上学术发表。等架子搭起来了,我们已经有了相当的科研积累。这时候,A 女士跟我说,我们的项目进展非常令她满意,可是学术发表没有跟上是个遗憾。军令如山倒,我于是召集研究组分工合作,集中精力加强学术发表所需的实验和投稿。那年一口气在大大小小会议和杂志发表了15篇论文,包括该领域的顶级会议,publishing like crazy。我与助手开玩笑说,尽管我们只是在工业界打工挖煤,可这样疯狂做研究,真像是为评终身教授  tenure 在拼命呢。每篇论文的结尾都要郑重致谢资助人,作为SBIR 成果备案在册,把 A 女士乐坏了。这些都是我和同事们拼命工作换来的,仗的是正值壮年,精力旺盛。回想起来,那一年真是累惨了,一个死期接着一个死期,不知熬过多少不眠之夜,体力透支,老有一口气喘不过来,感觉随时要光荣倒下的样子。幸好这样的自我摧残造成的亚健康局面没有持续下去,我们就站稳了脚跟。至此,我们的工作在政府资助机构中的信誉是完全建立起来了,要研究有研究,要产品有产品,还有什么比这些成果更能说明科研及其技术转移的实力呢。为此,政府部门领导通报表扬了 A 女士成功资助我们信息抽取研究的突出成绩,我们还数次被提名角逐全美 SBIR 年度最佳奖(nominated for US Small Business Administration Prime Contractor of the Year Award),我们的工作也上了 SBIR 光荣榜(SBIR success story)。也就是说,从资助人角度,对我们的资助是基金成功的样榜,一时风光无限。

在这样的形势下,我开始有了资本影响和(间接)参与政府在这个领域的科研蓝图规划。美国的体制很有意思, 政府的研究基金在首席科学家等最高决策者确立了一个总体方向(领域)以后,很多具体科研项目的确立是通过下面的政府项目经理竞标而来。A 女士每年都需要与其他同方向的项目经理竞争选题,她当然希望自己起草的选题被采纳。尽管她在这个领域做项目经理多年,上通下达,左联右合,对该领域的概貌、常用技术和应用前景有相当的了解,但她毕竟不是一线科研人员,她需要我们帮助她提供科研项目选题的思路和技术支持。选题要求确定该领域的瓶颈,以支持相关研究。为此,我利用一切机会把自已对该领域蓝图的理解和体验,用通俗易懂的方式灌输给她。她是个求知欲与好胜心一样强的聪明女士,沟通起来非常顺畅。这样的沟通是互利双赢的。首先是帮助她赢得了更多的选题,因此加强了她项目管理的资源,也在同事中增强了她在该领域项目管理的权威性。同样重要的是,由于帮助了她的选题,我们自然在竞争中处于优势地位。虽然政府项目总要公开招标,但别的竞争者要在短短的选题介绍中体会项目管理者的思路以投其所好,而我们是选题的发源地,可以自由发挥而不偏题,其中的竞争优势不言而喻。这种影响不限于研究性项目,也延及应用型项目。事实上,政府一个千万美元的技术转移 program 的立项,就直接源于我们的工作,这个选题基于我在这个领域科研多年积淀来的“洞见” 以及我们的可行性研究和模型系统。其中对问题的阐述方式、使用的自创术语以及技术转移可行性的论证,与我给政府项目写的最后报告如出一辙。不过,这个大项目的最大受益者却不是我们,而是一个做政府合同的大公司,因为项目指定所要处理的档案具有保密性质,而我们公司多是我这样的外籍盲流,没有权限处理保密文档。尽管如此,看到自己的工作和心目中的蓝图,被采纳成为一个大项目,还是很开心的。有意思的是,项目招标后,有资格竞标的几个公司纷纷找我们联系,上赶着要与我们建立排他性伙伴关系(exclusive partnership),采用我们的技术和引擎,来申请这个项目,因为他们知道这个项目的背景,想借助我们的特殊地位来增加自己的胜算。CEO 很高兴,他说,我们来者不拒,可以同他们都建立伙伴关系,但是 exclusive partnership 没门儿。是啊,让他们去争个头破血流,谁成功我们就跟谁搭档,是我们公司的利益所在。最终,我们如愿以偿成为政府应用开发的核心技术和引擎的提供者,不仅分了一杯羹,更重要的是,我们在政府 business 这一块,正如我们在工业开发那一块一样 ,也开始了从研究向应用的转变,不再是仅仅依靠研究基金存活,而是油水更大的政府合同的合伙人。这一转变的结果是带来更多的研究基金和政府合同,成为政府必须持续扶持的重点对象,因为政府经理及其项目的主承包者都不敢断了引擎维护和技术更新的源头。

在水牛城的八年,通过上述四个方面对政府资助人无微不至的协助和合作,终于达到了“政民”鱼水情的和谐融洽境界。我算过一笔账,论投资总量,政府项目的900万美元的投入,使得政府(当然最终是纳税人的钱,准确地说是“人民”)是公司实际意义上的最大“股东” (其他风险投资人每家很少超过 500 万)。尽管名义上政府只是扶持,并没有股东的法权,但对待政府项目经理象对待大股东一样才是正确的态度。保持密切联系,保障他们的知情权,是题中应有之义,也是我一直身体力行的。事实证明这样的认识和态度给双方带来的是最好的结果。从政府项目经理的角度,扶持一家小企业及其技术创新,达到可用好用的程度,也是一件极费心力的事。到了一定的阶段当扶持对象的信誉建立以后,政府经理自然悉心珍惜维护这种关系。大家都在一条船上,我们的成功就是他们的成功,他们的失败就是我们的灾难。

作为小企业,能傍上政府的大款,建立一种一损俱损一荣俱荣的关系,实属不易。这样的关系使用得当,可以化险为夷。在世纪之交科技股泡沫破灭后,我的公司经历了腥风血雨的大裁员(见《朝华午拾:水牛风云》)。我主管的研发这块儿,在裁员以后慢慢稳定到七八个人的团队,自负盈亏。仗着持续不断的政府项目,这支队伍一直维持下来。可是,有一次,因为政府项目之间有个缺口,大约有半年时间接不上来,CEO 坚持要我立即裁员。我软磨硬抗,告诉他很快新的项目就可能下来,我甚至用了哀兵之策,说我愿意工资减半,直到足够的政府项目资金到位。CEO 还是坚持要裁员,说新项目不一定能下来,如果下来了,你可以再招员。我心里想,你当是麦当劳工作啊,在职培训几天即可上岗,培养一支队伍不容易,一个新手来了,即便有经验,从熟悉系统到开始贡献一般也要半年时间,我可不能冒这个险。正在这个当口,A 女士带领她的小组来视察工作,老板和我像往常一样接待唯恐不周。老板是个好面子的人,叮嘱我不要把公司动荡的情绪带进来,她自己在介绍公司进展的时候,总是形势一派大好,是大好,不是小好。可是我的心结她也解不开,因为 CEO 固执己见,从来听不见她的意见。送走政府检查团以后,我翻来覆去睡不着觉,怎么想怎么觉得不应该对政府隐瞒这场危机,相反,我们应该向她求助。于是,我熬夜写了一封长信,细述我的科研团队面对伤筋动骨,科研难以为继的困境。第二天一早就收到她的回复,说感谢我的坦率,本来还以为我们一切良好呢。她说她正努力帮助我们度过难关,并嘱咐今后此类事情一定要及早与她通气,因为我的团队受到任何损害,直接影响她的全盘规划。很快,她就调动了自己可以控制的资源,加快了两项 Phase 3 的批准(那两个基金申请书是以最快速度完成的,基本是走过场)。她不久还把我们引荐介绍给另一个政府部门的基金主管,为我们开辟另一部门的基金来源。我感觉这大概是我在高级主管(研发副总)位置上“为政” 六年最大的一项政绩,可以说是在旅美革命的生死关头,我的一封上书,挽救了革命,挽救了党,保全了队伍,稳定了人心,峰回路转,转危为安,从此从胜利走向胜利,从辉煌走向平淡。

 

记于2010年春节

 

【相关】

《知识图谱的先行:从 Julian Hill 说起 》
Pre-Knowledge-Graph Profile Extraction Research via SBIR (1)
Pre-Knowledge-Graph Profile Extraction Research via SBIR (2) 

【立委博客NLP博文一览(定期更新版)】

《朝华午拾》总目录

【语义计算群:句法语义的萝卜与坑】

白:
张三对李四的批评一针见血。
张三对李四的批评置若罔闻。

梁:
白老师,这个挑战绝了,第一个是,张三批评李四,第二个是李四批评张三。

我: 白老师这个 minimal pair 是语言学的绝配样例。顺着它,可以 illustrate 一车的“萝卜与坑”的语言学:subcat 怎样工作,如何竞争,以及句法句型的的逻辑语义落地。这是语言学的魅力。我们先来 parse 一下,然后尝试做解读。

t0708b

谁一针见血,谁置若罔闻,都是张三(S)。我们先看两句的总体句子架构,然后再论内层的逻辑谓词“批评”的句法逻辑语义。“一针见血”是不及物动词,只有主语一个坑,可以是人 也可以是观点类抽象名词或动作类的语词;“置若罔闻”有主语宾语两个坑,但这个成语性的语词谓语,其宾语在汉语句法(subcat pattern)中要求PP(对),而不是后置NP,置若罔闻的主语坑必须是 human,最多推广到 法人(机构、公司等)。
t0708c

“X 一阵见血”,无论 X 是人是物还是动作:

t0708d

“human 对 X 置若罔闻”, 置若罔闻的X无论是物(信息)还是人(指代的仍旧是信息,是指那个人说的话:此乃“闻”的常识语义 ontology 所规定,但为了鲁棒,不必在句法上做这样的语义限制,因为介词“对”已经是一个很好的类似于“格变”的语言显性形式手段了,对于填这个坑已经足够精准了):

t0708f

后一句意思是,张三不把李四的话当话(e.g. 张三逆反)。

接着我们考察一下“批评”的SVO句型,看看S和O的坑在中文是怎样要求和被填的:

t0708g

t0708h

这算是“批评”的三个最基本的 subcat patterns,逻辑语义不变,尽管第二个变式中的表层句法是以PP做状语(Adv)的面貌(和位置)出现,但语义中间件根据变式2的规定可以很容易确认其逻辑宾语(O)的角色。

下面来看汉语中利用“的字结构”的SVO句型变式:e.g.  S对O的V

t0708i

t0708n

t0708j

这是指称性 arg structure,通常用“的”(“之”),于此对应的是英语的动名词NP:
John's criticism of Peter
vs
John's criticism by Peter
Peter's criticism towards/of John
the criticism of John by Peter
the criticism of John towards Peter

可见,英语的 of 几乎与汉语的 “的” 一个臭德行 充满歧义。by 和 towards 就规矩多了。再举几个指称性SVO的例句:

t0708k

t0708l

t0708m

t0708o

如果不是逻辑动词的“意见类”语词,就是 human 对/关于 thing 的 意见,广义的 thing 包含 human:
张三对李四的看法
张三关于时局的一点意见

雷:
这个人不是东西

我:
人不是东西 但可以当东西看 在语义限制的时候 除非特地标明 NOT human,白马是马非马 的辩证法:“张三对李四的意见”。“李四”不是东西 但在这个句型当东西看 因为“意见”没有human逻辑宾语的坑 只有关于万事万物的坑。

梁:
张三对李四的评价很好。--》 评价很好--》评价是主语。
张三对李四的评价无所谓。 ——》 张三无所谓 ——》 张三是主语。
“对”管到哪儿的问题。

我:
到了 意见 的同义词 “看法” 就有趣了:“张三对李四的看法”。
句法上 仍然是 【关于】 万事万物;词法上,这个外化到句法的 pp 实际上是逻辑动词语素 “看” 的逻辑宾语,只不过 在 “看” 与 “法” 合成为黑箱子的词典化过程中,这种深度搭配被遮掩了。必须词典化、黑箱化,因为此法非彼法。只有词典化,才能绑架 “法” 的语义。

“张三对李四的看法”
结构上是
“ 张三 看 李四 的 ‘法’ ”

“法” 不是默认的 method 语义,而是引伸的 perspective 语义,相当于英语的 point 在 viewpoint 或 point of view 中。黑箱的好处是可以把引申语义绑架为本义,英语的 viewpoint 就是用的同一种绑架的招数,否则 point 本身也意义含混。

"John's viewpoint about Peter"
structurally is equivalent to
"John's perspective of (John) viewing Peter"

昨天说过 虽然黑箱化 但在段子里可以休眠唤醒为白箱子:tv 新看法 就是。

总结:今天调试开发了的 unit test 的句子如下,工作成效颇不坏:

张三对李四的批评一针见血。
张三对李四的批评置若罔闻。
张三的批评一针见血。
张三一针见血。
批评一针见血。
张三对批评置若罔闻。
张三对李四置若罔闻。
张三置若罔闻。
张三批评李四
张三对李四批评
张三对李四的批评
张三之批评李四,毫无道理。
张三被李四所批评
张三被李四批评
张三为李四所批评
张三的被批评
李四对他批评
李四对他的批评
张三对李四对他的批评置若罔闻。
李四对他的批评一针见血。
张三对王五对李四的批评置若罔闻。

 

【相关】

tv 新看法

关于 parsing

【关于中文NLP】

【置顶:立委NLP博文一览】

《朝华午拾》总目录

 

【李白之30:算账先生说,parser 就是个交易系统】

李:

t0702d

陈:
日他,不是应该分析成 日 他

李:
“日他”在我们sentiment中语义是落地了的,社交媒体中表达 negative 情绪的骂人的

白:
伟哥到隔壁做做两个句子

t0702e

t0702f

白:
next有点耍赖

李:
NEXT 不是有点耍赖 是非常耍赖。如今是把 NEXT 作为未来语义中间件的重点改造对象。

白:
人工智能那个,怎么排除另一个“发展”为名词的解释?

李:
怎么排除的?根本就没刻意排除。
现在的问题是,如果不想排除,我可以不可以做,值得不值得做?

白:
有助于人类 和 有助于人工智能  大数据会告诉你

李:
就case论case 我有点怀疑大数据的作用 语感上 是半斤百两:“有助于人类” 和 “有助于人工智能”。即便依照大数据的阈值,走了其中一条 path 也还是很可能与语感或具体的case相左。大数据也只能解决基本分明的现象 大数据对模糊现象不是灵丹。

白:
人类的人工智能,这条路径更弱。

李:
有助于人类的 path 还是可以的。当然 那个如果正确 也是瞎猫撞死耗子。
目前的喧嚣是人工智能可能是坏的 可能毁掉人类 因此下面这个提倡 非常具有霍金盖茨马云般的“高瞻远瞩”:既不排斥科学技术的发展进步 又提出了道德的要求。
MD 听上去都有点像斯大林做学问了:
发展有利于马克思主义的语言学
发展有利于社会主义的生物学
发展有利于人民革命的核武器

白:
“改革有利于中国的持续发展”
看看狗屎运是不是可持续

李:
狗屎运与否,这次是耍了一次流氓:

t0702f

Next 与 Topic 基本等价,所以其实并不坏。
句首的词做 Next 与句首的 Topic 基本都是耍流氓。但是都是可以教育好的,等到语义中间件去教它从良,恋爱结婚生子。

白:
改革不适应时代的陈旧观念。
改革有利于少数人的管理制度。

李:

t0702g

“不” 给拉下了,这是个 bug 很好奇怎么拉下的。不过框架是对的,怎么对的,只能说狗屎运了 因为自己也搞不清。下面这个把“少数人”加入词典后,狗屎运似乎就光临了的样子:
t0702h

白:
需要在边界附近强化蹂躏

白:
改革有利于多数人的公平正义。
指挥没有记熟谱子的队员很没劲。
指挥没有记熟谱子的后果很严重。

李:

t0702i

上面断链了两次 挺不咋样的。

t0702j

t0702k

白:
第一个,队员是指挥的逻辑宾语

李:
还有个 bug 应该不难 de:已经有“谱子”做宾语了,语义中间件还是在逻辑主语(对的)又给加了逻辑宾语(错的)。有一阵子是有意放宽了保持歧义的策略 因为语用的时候有歧义比较好运作。

白:
后果,和行为、事件、消息是一个封闭小类。是在对VP进行“概括”

李:
现在没给这个小类起名字 都是零碎地用一些已有的类别 结果就是有漏掉的 可以考虑加一个 feature 就叫 VdeN,表达的不是宾语 而是其他,譬如同位语。

白:
第二个,指挥根本就是名词

李:
“指挥”是名词,不太好伺候,需要细线条。

白:
前面的“发展”其实也是双性 还有“改革”

李:
我其实不主张把这类归为 POS 歧义 因为这很容易推卸句法的责任 误导人在 POS 里去做句法的事儿 这种教训太多了。后果很严重,尤其对汉语。不说是 POS 双性 而说POS就是V。汉语缺乏形态 基本上逻辑的POS就是语言的POS,不存在动词又是名词的事儿。到了句法,就有了这个动词是自我包裹起来 还是成家生子的区分。闹独身的动词 类似于英语的 gerund,成家生子的动词就是常态的谓语动词了 构成了自身的 arg structure

白:
转指(比如作为人的指挥)的PoS一定是双性。自指(比如作为动作的指挥)的PoS在词法阶段可以保持不变,在句法阶段被强制,有案可查。指称性、陈述性。

李:
“指挥”不论,指挥是 human 当然是名词。说的是 “改革”、“发展”。这样的词强调POS双性无益 而且误导。

白:
这个同意

李:
不知道如今的汉化的PennTree或WordNet 是不是还把它们作为 POS 的歧义来标注。如果是,就是 community 的政策性误导。结果新人就一头钻进去试图在 POS level 去解决这个 POS 歧义,这不是死胡同吗?

白:
所谓被强制,就是强制之后改性。如“这本书的出版”:出版是V,这本书的出版是NP

李:
不错。这些是在 parsing 的过程中解决,而不要归结为一个独立的 POS 问题 或 POS 模块,这是症结。其实 都 NP 了 改不改 POS 已经无所谓了。保证做出 NP 是目的。

白:
这没有问题。
“画穿裙子小人的是女厕所。”

李:
没看懂 不过 parse parse see see:

t0702aaa

一无是处。

当然 作为人脑 我看了几遍了 还是没看懂。
Wait,是标志 ......

白:
这是小学一年级课外读物

李:
画有穿裙子标志的那间是女厕所

白:
还好你的“穿”没做补语

李:
确实没看懂 人脑其实也不咋样。
这样就清楚多了:画了穿裙子的小人的那间是女厕所 于人于机。

t0702m

当然 “那间” 应该是 S 而不是动词 “画” 做主语。定语从句没搞定。
画的是“人”不是“间”。

白:
定语从句对于标配的坑和非标配的坑处理是不同的,前者可以省略“的”的中心语,后者不能省略。
“写了三行字的是作文本,写了两行字的是记事本。”

李:
的字结构作为指代,【定从】中插入“是”,前面的就成了【的字结构】主语,后面成了表语的是哪些?

我看的书 --》 我看的是书
我吃的这家馆子 --》 我吃的是这家馆子
我吃的亏 --》 我吃的就是这个亏。(动宾离合词的搭配需要这个pattern帮助搞定。)

上面的例句因为宾语的坑还在(没有 daturated),还好说。下面的呢?

我写了三行字的作文本 --》 写了三行字的是作文本
我写书的这个屋子 --》 我写书的是这个屋子??
我【在其中 in which】写书的屋子

白:
有些动词处所坑是标配,有些不是。不是的,的后面不能省略

李:
处所标配的动词是 “去”“来”这样的?

白:
这是其中一类

李:
“写书” 没有这个标配,如果带处所也是所有动词都带的状语性质。

白:
还有表示附着、固定的,画、涂、标、钉、挂,都可以。

李:
那是 put 、place 这类 带处所做补足语的。HowNet 里面应该有,这是跨语言的常识要求。

白:
挂两颗星的是中将。

李:
“中将” 与【处所】貌似没关系啊。“挂两颗星的是中将制服”。
“制服” 倒是处所的延伸。

白:
写书和写字不同。写字有附着对象,写书没有。
“写白字的是黑板,写黑字的是白板。”

李:
这个虽然有道理,但确实已经很微妙了 感觉上不大好拿捏。

白:
标配和光杆“的”之间的变换关系有道理?还是“放置、附着、固定”这类subcat带标配处所有道理?
我承认后者很微妙,总结得未必精准,但前者似乎是比较正常的。

李:

t0702n

看看这个parse: 就是说
写白字的是黑板 == 黑板写白字
写黑字的是白板 == 白板写黑字
这个解释几乎可以接受了吧?
至于这个 S 的深层逻辑语义该取个什么名字 暂时不管。

白:
你这白字和黑字不对等哦……

李:
yeh 我也发现了,不知道为啥
知道了:“白字” 词典化了。

白硕:
“白字”另有所指。

李:
对,白字不一定白,是错别字。而 “黑字” 却是自由组合出来的。组合的时候 算是 open compounding 就简单的加了个 x link

白:
但是,当逻辑主语现身的时候,S不会还霸占着吧?
“他们写白字的是黑板”
也可以逆行:“黑字写白板,白字写黑板”

李:
哈 你猜这么着?
Topic!

t0702o

t0702p

白:
今天飞北京,明天飞成都。
他们和黑板,显然不是大小主语关系,这属于滥用第三个坑了。

李:

t0702q

白:
“这里他写了三个字”

李:

t07021

这还差不多。

白:
这个O,对于不及物的“飞”来说,其实就是标配化的处所宾语了。
“重庆我昨天飞的”
“这张纸他只写了三个字”

李:
估计是 Topic。

t07022

不是 Topic 就是 Next。没关系 意味着想做后面可以接着做。其实在语用的时候,很可能不需要这个语义 arc 的求解了。反正 作为 node 重庆是地点,纸 是广义的处所 这个 ontology 知识系统是有的 不必借助精细的句法语义关系。所以 这个语义中间件 说到底就是要做可以一直做下去 理论上讲 做得好 对各种语用都会有好处。但实际上不做也没啥 语用的时候 稍微多费点儿力气 或者 语用很多时候根本用不到。

白:
标配与否,其实是人为的,有些不是满格,也许称为“半标配”更好接受。

李:
逻辑语义这东西 太细了麻烦大 好处却不明显。董老师的定义 我都觉得太细了。

白:
其实这个群讨论的问题,很多都无关做不做,而是事关有没有。

李:
从一个语义系统的角度看 董老师的定义有助于语义全貌的完整性;
从实际使用看 其实绝大多数的时候 要不了那么精细。

白:
做统计的人也一样可以说,我不做某事是因为好处不明显。我不需要那么精细

李:
他们一直就那么说。 昨天@Guo 还说呢,你那个 deep parsing 甭管多牛,我其实 shallow 就很好了。

白:
但是一个可以逐步精细的通道有还是没有,才是最关键的。

李:
通道是有的 至少我这里;有了 Next 和 Topic 精细化的通道就铺就了。而且写这些精细化的规则 比线性parsing要容易 容易很多。

白:
线性不线性,其实就是个是否允许做空的问题。一定要先买再卖,就是线性。

李:
线性的束缚大 而且层次多 里面的调控有很多 tricks 到了句法树出来了 问题就简化了

白:
允许一定窗口期内先卖再买,就打破线性了。

李:
耍流氓是谈一场精细浪漫恋爱的很好的前戏 尽管这句话听上去很不地道。

白:
topic很多就是在“做空”:动词没出场,逻辑宾语先出场了。

李:
就是。
能搞定的先搞定,搞不定的先挂着。等到局部大部搞定以后,再看那个别没搞定的,就不再是挑战了。

白:
卖自己没有的东西 赊账

李:
白老师还是在交易所里面呆太久了 满口算账先生的味道

白:
还别说,parser就是个交易系统:左括号是买单,右括号是卖单
你以为

李:
subcat 就是 ......

白:
subcat是股票

李:
saturated 就是成交

白:
subcat的提供者在填坑,subcat的需求者在挖坑。一对多的右括号是市价订单,无论多少左括号都通杀。比如多个定语对一个中心语 可以看成右括号潜在供应量无限。

李:
这是 mod 的本性,与 subcat 相对应。subcat 一个萝卜一个坑。两个萝卜来了 除非是 conjoin 否则没戏。

白:
补语在与述语动词分立时,坑的总供给有可能大于总需求。打包以后,有的坑被“合并同类项”了,取得了新的供需平衡。比如,冻肿了,冻X,X肿,两个X自然合并。合成的述补结构仍然只有一个坑。
什么坑能合并,看见两个谓词自然就能知道。(subcat or 大数据)不用和填坑的词打照面。所以,述补结构的处理,分层上要先于名词(短语)填坑。全放在一个平面,就说不清楚坑多萝卜少咋分的。

 

【相关】

【征文参赛:美梦成真】

关于 parsing

【关于中文NLP】

【置顶:立委NLP博文一览】

《朝华午拾》总目录