コード例 #1
0
ファイル: tag_noun_heads.py プロジェクト: viksit/ucca
def get_noun_heads(passage):
    fnodes = scenes.extract_non_scenes_AGCE(passage)
    heads = [scenes.extract_head(fnode) for fnode in fnodes]
    noun_heads = [
        head for head in heads if head is not None and scenes.is_noun(head)
    ]
    return noun_heads
コード例 #2
0
ファイル: verify_noun_scenes.py プロジェクト: viksit/ucca
def get_noun_scene_heads(passage):
    fnodes = [
        x for x in passage.layer(layer1.LAYER_ID).all
        if x.tag == layer1.NodeTags.Foundational and x.is_scene()
    ]
    heads = [scenes.extract_head(x) for x in fnodes]
    noun_heads = [x for x in heads if x is not None and scenes.is_noun(x)]
    return noun_heads
コード例 #3
0
ファイル: verify_noun_scenes.py プロジェクト: borgr/ucca
def get_noun_scene_heads(passage):
    fnodes = [x for x in passage.layer(layer1.LAYER_ID).all
              if x.tag == layer1.NodeTags.Foundational and x.is_scene()]
    heads = [scenes.extract_head(x) for x in fnodes]
    noun_heads = [x for x in heads if x is not None and scenes.is_noun(x)]
    return noun_heads