Past few months, I've been trying several methods of directly predicting a what word belongs in a given syntactic context. For example, if we have:
dog X man with teeth,
then the syntactic context [1] of the X token is:
nsubj(dog)
dobj(man)
| ======================================================================= | |
| Activating fairseq-fp16-20190211 | |
| ======================================================================= | |
| Running mode=single | |
| ------------------------------------------------------------ | |
| Conda PREFIX: /private/home/roller/.conda/envs/fairseq-fp16-20190211 | |
| Torch version: 1.0.0.dev20190211 | |
| CUDA version: 10.0.130 | |
| Using a single GPU | |
| Step bs= 8192 |
| Input: | |
| I don't mean to go all language nerd on you, but I just legit adverbed "legit," verbed "adverb," and adjectived "language nerd." | |
| Output: | |
| (ROOT | |
| (S | |
| (S | |
| (NP (PRP I)) | |
| (VP |
| #!/usr/bin/env python2.7 | |
| import argparse | |
| import struct | |
| import pickle | |
| import numpy as np | |
| from composes.semantic_space.space import Space | |
| from composes.matrix.dense_matrix import DenseMatrix | |
| FLOAT_SIZE = 4 |
| #!/usr/bin/env python | |
| import os, errno, os.path | |
| import argparse | |
| JOB_TEMPLATE = """ | |
| #!/bin/sh | |
| #----------------------------------------------------------------------------- | |
| #$ -V | |
| #$ -cwd |
| set nocompatible | |
| set nohls | |
| " allow backspacing over everything in insert mode | |
| set backspace=indent,eol,start | |
| set nobackup | |
| set history=50 " keep 50 lines of command line history | |
| set ruler " show the cursor position all the time | |
| set showcmd " display incomplete commands | |
| set incsearch " do incremental searching |
| #!/usr/bin/env python | |
| import curses, sys, re | |
| from time import sleep | |
| from random import randint | |
| OFFSET_X, OFFSET_Y = 2, 1 | |
| BOARD_SIZE = 7 | |
| ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" |
| from __future__ import with_statement | |
| # +-----+ | |
| # | | | |
| # | O | |
| # | -|- | |
| # | / \ | |
| # | | |
| # ----- | |
| # |
| % | |
| % TIC-TAC-TOE | |
| % | |
| % a | b | c | |
| % --+---+--- | |
| % d | e | f | |
| % --+---+--- | |
| % g | h | i | |
| % |
| #!/usr/bin/ruby | |
| # example usage: | |
| # $ leo büch* | |
| # book das Buch - Pl. die Bücher | |
| # accounts die Bücher | |
| # stock of books der Bücherbestand | |
| # bookshelf - pl. bookshelves das Bücherbord - Pl. die Bücherborde | |
| # shelf pl.: shelves das Bücherbord | |
| # bookshelf - pl. bookshelves das Bücherbrett |