utils.py
def word_aligner(sent1, sent2):
    """ wrapper which calls the monolingual
    word aligner and gives the alignment scores between
    sent1 and sent2
    """
    ## tokenize
    sent1_tok = " ".join(list(nlp_parser.tokenize(sent1)))
    sent2_tok = " ".join(list(nlp_parser.tokenize(sent2)))

    ## create a subprocess to call the word aligner
    process = subprocess.Popen(['python2', 'predict_align.py', '--s1', sent1_tok,
                                '--s2', sent2_tok], stdout=subprocess.PIPE,
                               cwd='/ssd-playpen/home/ram/monolingual-word-aligner')
    output, error = process.communicate()
    ## parse the output
    output = output.decode('utf-8')
    output = output.split('\n')
    return ast.literal_eval(output[0]), ast.literal_eval(output[1]), sent1_tok, sent2_tok
 wrapper which calls the monolingual
    word aligner and gives the alignment scores between
    sent1 and sent2
    
wrapper which calls the monolingual
word aligner and gives the alignment scores between
sent1 and sent2
wrapper which calls the monolingual word aligner and gives the alignment scores between sent1 and sent2
def word_aligner(sent1, sent2):
    sent1_tok = " ".join(list(nlp_parser.tokenize(sent1)))
    sent2_tok = " ".join(list(nlp_parser.tokenize(sent2)))
    process = subprocess.Popen(['python2', 'predict_align.py', '--s1', sent1_tok,
                                '--s2', sent2_tok], stdout=subprocess.PIPE,
                               cwd='/ssd-playpen/home/ram/monolingual-word-aligner')
    output, error = process.communicate()
    output = output.decode('utf-8')
    output = output.split('\n')
    return ast.literal_eval(output[0]), ast.literal_eval(output[1]), sent1_tok, sent2_tok
def word_aligner ( sent1 , sent2 ) : sent1_tok = " " . join ( list ( nlp_parser . tokenize ( sent1 ) ) ) sent2_tok = " " . join ( list ( nlp_parser . tokenize ( sent2 ) ) ) process = subprocess . Popen ( [ 'python2' , 'predict_align.py' , '--s1' , sent1_tok , '--s2' , sent2_tok ] , stdout = subprocess . PIPE , cwd = '/ssd-playpen/home/ram/monolingual-word-aligner' ) output , error = process . communicate ( ) output = output . decode ( 'utf-8' ) output = output . split ( '\n' ) return ast . literal_eval ( output [ 0 ] ) , ast . literal_eval ( output [ 1 ] ) , sent1_tok , sent2_tok
wrapper which calls the monolingual
word aligner and gives the alignment scores between
sent1 and sent2
wrapper which calls the monolingual word aligner and gives the alignment scores between sent1 and sent2
""" wrapper which calls the monolingual
    word aligner and gives the alignment scores between
    sent1 and sent2
    """ ## tokenize ## create a subprocess to call the word aligner ## parse the output
sent1
sent2