How to use the depccg.download.SEMANTIC_TEMPLATES function in depccg

To help you get started, we’ve selected a few depccg examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github masashi-y / depccg / depccg / tools / tagger.py View on Github external
'--format',
                        default='xml',
                        choices=['auto', 'xml', 'prolog', 'jigg_xml', 'jigg_xml_ccg2lambda', 'json'],
                        help='output format')
    parser.add_argument('--semantic-templates',
                        help='semantic templates used in "ccg2lambda" format output')
    args = parser.parse_args()

    annotate_fun = english_annotator[args.annotator]
    doc, trees = [], []
    for _, tokens, tree in read_trees_guess_extension(args.PATH):
        doc.append([token.word for token in tokens])
        trees.append([(tree, 0)])
    tagged_doc = annotate_fun(doc, tokenize=False)

    semantic_templates = args.semantic_templates or SEMANTIC_TEMPLATES[LANG]
    print_(trees,
           tagged_doc,
           format=args.format,
           lang=LANG,
           semantic_templates=semantic_templates)
github masashi-y / depccg / depccg / tools / ja / tagger.py View on Github external
parser.add_argument('-f',
                        '--format',
                        default='jigg_xml',
                        choices=['prolog', 'jigg_xml', 'jigg_xml_ccg2lambda', 'json', 'deriv'],
                        help='output format')
    parser.add_argument('--semantic-templates',
                        help='semantic templates used in "ccg2lambda" format output')
    args = parser.parse_args()

    annotate_fun = japanese_annotator[args.annotator]
    doc, trees = [], []
    for _, tokens, tree in read_trees_guess_extension(args.PATH, lang='ja'):
        doc.append(tokens)
        trees.append([(tree, 0)])

    semantic_templates = args.semantic_templates or SEMANTIC_TEMPLATES[LANG]
    print_(trees,
           doc,
           format=args.format,
           lang=LANG,
           semantic_templates=semantic_templates)