自然语言处理基础技术之组合范畴文法

声明:转载请注明出处,谢谢:https://blog.csdn.net/m0_37306360/article/details/84719074
另外,更多实时更新的个人学习笔记分享,请关注:
知乎:https://www.zhihu.com/people/yuquanle/columns
公众号:StudyForAI


之前在读论文的时候看到CCG这个概念,所以之查阅学习了一波~~


定义:

  • 组合范畴语法(Combinatory categorial grammar,CCG),是在AB演算基础上进行扩展而产生的范畴语法。从语法理论视角看,CCG是一种词汇形式化的方法;从计算语言学视角看,CCG属于一类适度上下文相关文法;从逻辑语义学视角看,CCG在句法与语义的接口方面非常融洽。无论是CCG语言的、计算的,还是逻辑的特征,都使得 CCG非常适用于自然语言信息处理,对于计算语言学具有很好的理论和实际价值。

  • 维基百科定义:Combinatory categorial grammar (CCG) is an efficiently parsable, yet linguistically expressive grammar formalism. It has a transparent interface between surface syntax and underlying semantic representation, including predicate-argument structure, quantification and information structure. The formalism generates constituency-based structures (as opposed to dependency-based ones) and is therefore a type of phrase structure grammar (as opposed to a dependency grammar).

  • 组合范畴文法,简称 CCG,是一种类型驱动的词汇化文法,通过词汇范畴显式地提供从句法到语义的接口,属于短语结构文法。CCG 的基本操作包括:1)原子范畴(Atomic Category),用于表达基本的词汇类别和句法功能; 2)组合范畴(Function Category),由原子范畴构成,通常用 X/Y 或 X\Y 来表示可以向左或者向右寻找变元 Y 来获得组合 X。


例子:

  • 在CCG中,句子没有单一的结构,就像在其他语法模型中一样。这里用一个维基百科的例子直观的感受一下。
    例子地址:https://en.wikipedia.org/wiki/Combinatory_categorial_grammar
    Given a sentence:the dog bit John
    在这里插入图片描述
  • 另外,看了一篇IJCAI2017的文章,这篇文章是做sentence representation的。文章指出大多数现有模型在学习sentence representation通常会平均对待句子中的每个单词。所以文章通过为组成单词的向量分配不同的权重来改进句子表示,这可以被视为单个句子上的注意机制。为此,文章提出了新颖的注意力模型,就包括使用CCG supertags来推导注意力权重。 换句话简单的说,文章提出不同的词性应该有不同的重要性,其中就提出了给不同词性不同CCG的词分配不同的权重。
    有兴趣的可以去看文章:Learning Sentence Representation with Guidance of Human Attention
    文章下载地址https://arxiv.org/pdf/1609.09189.pdf
    作者也开源了代码https://github.com/wangshaonan/Learning-sentence-representation-with-guidance-of-human-attention

一些工具:

猜你喜欢

转载自blog.csdn.net/m0_37306360/article/details/84719074