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

请教几个关于特殊人名实体识别的问题 #1080

Closed
1 task done
HitomeRyuu opened this issue Jan 11, 2019 · 1 comment
Closed
1 task done

请教几个关于特殊人名实体识别的问题 #1080

HitomeRyuu opened this issue Jan 11, 2019 · 1 comment

Comments

@HitomeRyuu
Copy link

注意事项

请确认下列注意事项:

  • 我已仔细阅读下列文档,都没有找到答案:
  • 我已经通过Googleissue区检索功能搜索了我的问题,也没有找到答案。
  • 我明白开源社区是出于兴趣爱好聚集起来的自由社区,不承担任何责任或义务。我会礼貌发言,向每一个帮助我的人表示感谢。
  • 我在此括号内输入x打钩,代表上述事项确认完毕。

版本号

当前最新版本号是:1.7.0
我使用的版本是:1.7.0

我的问题

1、我搜索TranslatedPersonRecognition和JapenesePersonRecognition发现这两个java类只被维特比、最短路径、n最短路径分词所用到,CRF和感知机分词没有用到,那么如果我想让CRF和感知机分词能识别日本人名和翻译人名是否只能依靠训练新的相关语料?
2、如果我想识别新的人名类型(如少数民族人名),字典文件是否只需要准备一份带有人名关键字的nrx.txt呢?trie.dat和value.dat是自动生成的吗?
再次感谢您的时间和耐心!

触发代码

   public class DemoJapaneseNameRecognition
{
    public static void main(String[] args)
    {
        String[] testCase = new String[]{
                "北川景子参演了林诣彬导演的《速度与激情3》",
                "林志玲亮相网友:确定不是波多野结衣?",
                "龟山千广和近藤公园在龟山公园里喝酒赏花",
        };
        Segment segment = HanLP.newSegment("crf").enableJapaneseNameRecognize(true);
        for (String sentence : testCase)
        {
            List<Term> termList = segment.seg(sentence);
            System.out.println(termList);
        }

    }
}

期望输出

[北川景子/nrj, 参演/v, 了/ule, 林诣彬/nr, 导演/nnt, 的/ude1, 《/w, 速度/n, 与/cc, 激情/n, 3/m, 》/w]
[林志玲/nr, 亮相/vi, 网友/n, :/w, 确定/v, 不是/c, 波多野结衣/nrj, ?/w]
[龟山千广/nrj, 和/cc, 近藤公园/nrj, 在/p, 龟山/nz, 公园/n, 里/f, 喝酒/vi, 赏花/nz]

实际输出

[北川/ns, 景子/n, 参演/v, 了/u, 林诣彬/nr, 导演/n, 的/u, 《/w, 速度/n, 与/c, 激情/n, 3/m, 》/w]
[林志玲/nr, 亮相/v, 网友/n, :/w, 确定/v, 不/d, 是/v, 波多野/n, 结衣/n, ?/w]
[龟/v, 山/n, 千/m, 广/q, 和/c, 近藤/a, 公园/n, 在/p, 龟山公园/ns, 里/f, 喝/v, 酒/n, 赏/v, 花/n]

其他信息

@hankcs hankcs closed this as completed in ce949cd Jan 12, 2019
@hankcs
Copy link
Owner

hankcs commented Jan 12, 2019

你好,TranslatedPersonRecognition和JapenesePersonRecognition都是基于规则的,与感知机模型格格不入,所以没有调用这两个函数。虽然现在加入了对这两个模块的支持,但依然建议优先采用语料库来解决。

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