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

代码 parser_dll.cpp 的 62 行是否有bug? #49

Closed
CNEYE opened this issue Dec 3, 2013 · 3 comments
Closed

代码 parser_dll.cpp 的 62 行是否有bug? #49

CNEYE opened this issue Dec 3, 2013 · 3 comments
Assignees
Labels

Comments

@CNEYE
Copy link

CNEYE commented Dec 3, 2013

我尝试用如下代码解密例句“我们都是中国人。”

    //依存句法分析接口
    //parse
    void * engine3 = parser_create_parser("/Users/iceet/Mine/Bill/tools/xls/ltp_data/parser.model");

    vector<int>            heads;
    vector<std::string>    deprels;
    vector< pair<int, string> > parse;

    parser_parse(engine3, words, postags, heads, deprels);
    for (int i = 0; i < heads.size(); ++ i) {
        //std::cout << words[i] << "\t" << tags[i] << "\t" 
        //    << heads[i] << "\t" << deprels[i] << std::endl;
        //parser[i].first = heads[i];
       // heads[i] = heads[i];
        cout << heads[i] << deprels[i] << endl;
//         int parentIdx = atoi( heads[i].c_str() );

        //parser[i].second = deprels[i];
        parse.push_back(make_pair(heads[i],deprels[i]));
    }

期望得到结果A:

我们/r    2 SBV
都/d   2 ADV
是/v   -1 HED
中国/ns   4 ATT
人/n   2 VOB
。/wp  2 WP

实际上得到的结果B:

我们/r    3 SBV
都/d   3 ADV
是/v   0 HED
中国/ns   5 ATT
人/n   3 VOB
。/wp  3 WP

发现在 parser_dll.cpp 的 62 行

 int len = inst->size();
        heads.resize(len - 1);
        deprels.resize(len - 1);
        for (int i = 1; i < len; ++ i) {
            heads[i - 1] = inst->predicted_heads[i];//这里是否应该减去1?
            deprels[i - 1] = ltp::parser::Parser::model->deprels.at(
                    inst->predicted_deprelsidx[i]);
        }
@Oneplus
Copy link
Member

Oneplus commented Dec 3, 2013

@CNEYE 谢谢报这个bug。这个问题似乎是为了适应线上服务导致输出结果的不一致。我们会想办法解决这个问题。

@ghost ghost assigned Oneplus Dec 3, 2013
@CNEYE
Copy link
Author

CNEYE commented Dec 3, 2013

能给下 语义角色标注的详细说明么,,
有提到:
核心的语义角色为 A0-5 六种,A0 通常表示动作的施事,A1通常表示动作的影响等,A2-5 根据谓语动词不同会有不同的语义含义。其余的15个语义角色为附加语义角色,如LOC 表示地点,TMP 表示时间等。附加语义角色列表如下:

具体的A2-5的不同含义能给下么,A0,A1的例外情况能给下么。。

谢谢?

在 2013年12月3日,上午11:44,Yijia Liu notifications@github.com 写道:

@CNEYE 谢谢报这个bug。这个问题似乎是为了适应线上服务导致输出结果的不一致。我们会想办法解决这个问题。


Reply to this email directly or view it on GitHub.

@Oneplus
Copy link
Member

Oneplus commented Dec 3, 2013

您好,

关于语义角色标注的包含A2-A5句子的例子以及A2-A5,您可以参考一下propbank的标注规范,
http://www.mitpressjournals.org/doi/pdf/10.1162/0891201053630264

2013/12/3 蜗眼 notifications@github.com

能给下 语义角色标注的详细说明么,,
有提到:
核心的语义角色为 A0-5 六种,A0 通常表示动作的施事,A1通常表示动作的影响等,A2-5
根据谓语动词不同会有不同的语义含义。其余的15个语义角色为附加语义角色,如LOC 表示地点,TMP 表示时间等。附加语义角色列表如下:

具体的A2-5的不同含义能给下么,A0,A1的例外情况能给下么。。

谢谢?

在 2013年12月3日,上午11:44,Yijia Liu notifications@github.com 写道:

@CNEYE 谢谢报这个bug。这个问题似乎是为了适应线上服务导致输出结果的不一致。我们会想办法解决这个问题。


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHubhttps://github.com//issues/49#issuecomment-29686730
.

Best regards!

@CNEYE CNEYE closed this as completed Dec 4, 2013
@Oneplus Oneplus added the bug label Mar 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants