Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

词性和权重的分割 #58

Closed
willin opened this issue Jun 10, 2016 · 6 comments
Closed

词性和权重的分割 #58

willin opened this issue Jun 10, 2016 · 6 comments

Comments

@willin
Copy link

willin commented Jun 10, 2016

[ '我:r',
  '是:v',
  '拖拉机:n',
  '学院:n',
  '手扶拖拉机:n',
  '专业:n',
  '的:uj',
  '。:x',
  '不用:v',
  '多久:m',
  ',:x',
  '我:r',
  '就:d',
  '会:v',
  '升职:v',
  '加薪:nr',
  ',:x',
  '当上:t',
  'CEO:eng',
  ',:x',
  '走上:v',
  '人生:n',
  '巅峰:n',
  '。:x' ]
[ 'CEO:11.7392',
  '升职:10.8562',
  '加薪:10.6426',
  '手扶拖拉机:10.0089',
  '巅峰:9.49396' ]

结果是数组,那么每一条拿出来之后还要 split,或者正则匹配出对应的数据,这样很麻烦。

为什么不直接放对象?

{
  'CEO': 11.7392,
  '升职': 10.8562
}

像这样。

还是说有什么更好的实践?

yanyiwu added a commit that referenced this issue Jun 10, 2016
@yanyiwu
Copy link
Owner

yanyiwu commented Jun 10, 2016

谢谢提醒!
nodejieba@2.1.0 需要 split 的这个设计确实很二,已经修复该问题。

@yanyiwu yanyiwu closed this as completed Jun 10, 2016
@willin
Copy link
Author

willin commented Jun 10, 2016

词性标注 具体 有哪些词性?
uj ul n v 总表有吗

@yanyiwu

@yanyiwu
Copy link
Owner

yanyiwu commented Jun 10, 2016

@willin 参考一下这个 https://gist.github.com/luw2007/6016931

@willin
Copy link
Author

willin commented Jun 11, 2016

thx

@yanyiwu 不过jieba部分没有中文注解 如 df mg

a 形容词
    ad 副形词
    an 名形词
    ag 形容词性语素
b 区别词
c 连词
d 副词
    df      *********************
    dg 副语素
e 叹词
f 方位词
g 语素
h 前接成分
i 成语
j 简称略语
k 后接成分
l 习用语
m 数词
    mg      *********************
    mq 数量词
n 名词
    ng 名词性语素
    nr 人名
    nrfg     *********************
    nrt      *********************
    ns 地名
    nt 机构团体名
    nz 其它专名
o 拟声词
p 介词
q 量词
r 代词
    rg 代词性语素
    rr 人称代词
    rz 指示代词
s 处所词
t 时间词
    tg 时间词性语素
u 助词
    ud      *********************
    ug      *********************
    uj      *********************
    ul      *********************
    uv      *********************
    uz      *********************
v 动词
    vd 副动词
    vg 动词性语素
    vi 不及物动词(内动词)
    vn 名动词
    vq      *********************
x 非语素字
y 语气词
z 状态词
    zg      *********************

@willin
Copy link
Author

willin commented Jun 11, 2016

最近有个需求要做智能控制,所以分词上有很多问题会需要请教,能给个联系方式吗,比如微信什么的

{ cut: [ '把', '卧室', '所有', '的', '灯', '都', '关', '了' ],
  tag:
   [ { word: '把', tag: 'p' },
     { word: '卧室', tag: 'n' },
     { word: '所有', tag: 'b' },
     { word: '的', tag: 'uj' },
     { word: '灯', tag: 'n' },
     { word: '都', tag: 'd' },
     { word: '关', tag: 'v' },
     { word: '了', tag: 'ul' } ],
  extract: [ { word: '卧室', weight: 8.20023407859 } ] }
{ cut: [ '把', '卧室', '全部', '的', '灯', '都', '关', '了' ],
  tag:
   [ { word: '把', tag: 'p' },
     { word: '卧室', tag: 'n' },
     { word: '全部', tag: 'n' },
     { word: '的', tag: 'uj' },
     { word: '灯', tag: 'n' },
     { word: '都', tag: 'd' },
     { word: '关', tag: 'v' },
     { word: '了', tag: 'ul' } ],
  extract: [ { word: '卧室', weight: 8.20023407859 } ] }
  { cut: [ '把', '卧室', '全部', '的', '灯关', '了' ],
  tag:
   [ { word: '把', tag: 'p' },
     { word: '卧室', tag: 'n' },
     { word: '全部', tag: 'n' },
     { word: '的', tag: 'uj' },
     { word: '灯关', tag: 'x' },
     { word: '了', tag: 'ul' } ],
  extract:
   [ { word: '灯关', weight: 11.739204307083542 },
     { word: '卧室', weight: 8.20023407859 } ] }

三个句子是差不多的。分别是把卧室全部的灯关了把卧室全部的灯都关了把卧室所有的灯都关了,结果全部算名词,所有算区别词。这样的结果跟我设想的很不一样啊。。。。

  1. 灯关 x =_=!!!
  2. 全部 n | 所有 b

@yanyiwu
Copy link
Owner

yanyiwu commented Jun 12, 2016

微信联系方式在README.md 最下面就有啊。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants