语句的向量表示方法——单词向量组合…

目标:本文讨论单词向量的组合方式(composition of word vectors),一般指两个单词向量的组合方式,使得输出的新的向量能够表达组合后的短语的语义。

本文使用符号
u,v:普通的单词向量(u_1,u_2,u_3)和(v_1,v_2,v_3);
p:需要求出的目标短语的向量;
R:一个表征语法关系的矩阵;
K:世界知识等其他非单词语义、语法关系构成的信息;

词语组合的一些假想
1、整体的含义是一个以部分作为自变量的函数的输出(The meaning of a whole is a function of the meaning of the parts. )
语句的向量表示方法——单词向量组合(composition <wbr>of <wbr>word <wbr>vectors)方式探讨
2、整体的含义是一个以部分、以及相应的语法规则作为输入的函数(The meaning of a whole is a function of the meaning of the parts and of the way they are syntactically combined.)
语句的向量表示方法——单词向量组合(composition <wbr>of <wbr>word <wbr>vectors)方式探讨
3、除了上述输入之外,还应添加其他而外的信息作为输入
语句的向量表示方法——单词向量组合(composition <wbr>of <wbr>word <wbr>vectors)方式探讨
实现上述论断的主要困难是对于一个具体的短语,很难判断使用什么方程来进行组合(There is the fundamental difficulty of specifying what sort "function of the meanings of the parts" is involved in semantic composition.)。
为了降低困难,可以认为组成短语的单词保持了独立性,适用于这些单词的规则在这些单词出现在其他短语中时也适用。( systematicity: The ability to understand some sentences is intrinsically connected to the ability to understand certain others. In other words, if one understands some sentence and the rules that govern its construction, one can understand a different sentence made up of the same elements according to the same set of rules. In combing parts to form a whole, the parts remain independent and maintain their identities.)当然这种假设和上文提到的Frege (1884)的论断是矛盾的。

论断三是目前普遍接受的假设,但也并不是无懈可击的。像固定搭配、成语等,是不能从单个词语的含义推断出整体的含义的,这和论断1是完全矛盾的(The difficulty in defining compositionality is highlighted by Frege (1884) himself who cautions never to ask for the meaning of a word in isolation but only in the context of a statement. In other words, it seems that the meaning of the whole is constructed from its parts, and the meaning of the parts is derived from the whole.  Linguistic structures range from fully compositional (e.g., black hair), to partly compositional syntactically f
  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Word2Vec.Net 是词转换成向量形式工具Word2Vec .NET版本。使用示例代码:            var builder = Word2VecBuilder.Create();             if ((i = ArgPos("-train",  args)) > -1)                 builder.WithTrainFile&#40;args[i   1]&#41;;             if ((i = ArgPos("-output", args)) > -1)                 builder.WithOutputFile&#40;args[i   1]&#41;;             //to all other parameters will be set default values             var word2Vec = builder.Build();             word2Vec.TrainModel();             var distance = new Distance(args[i   1]);             BestWord[] bestwords = distance.Search("some_word");或者//more explicit option         string trainfile="C:/data.txt";         string outputFileName = "C:/output.bin";         var word2Vec = Word2VecBuilder.Create()             .WithTrainFile&#40;trainfile&#41;// Use text data to train the model;             .WithOutputFile&#40;outputFileName&#41;//Use to save the resulting word vectors / word clusters             .WithSize(200)//Set size of word vectors; default is 100             .WithSaveVocubFile&#40;&#41;//The vocabulary will be saved to <file>             .WithDebug(2)//Set the debug mode (default = 2 = more info during training)             .WithBinary(1)//Save the resulting vectors in binary moded; default is 0 (off)             .WithCBow(1)//Use the continuous bag of words model; default is 1 (use 0 for skip-gram model)             .WithAlpha(0.05)//Set the starting learning rate; default is 0.025 for skip-gram and 0.05 for CBOW             .WithWindow(7)//Set max skip length between words; default is 5             .WithSample((float) 1e-3)//Set threshold for occurrence of words. Those that appear with higher frequency in the training data twill be randomly down-sampled; default is 1e-3, useful range is (0, 1e-5)             .WithHs(0)//Use Hierarchical Softmax; default is 0 (not used)             .WithNegative(5)//Number of negative examples; default is 5, common values are 3 - 10 (0 = not used)             .WithThreads(5)//Use <int

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值