Skip to content

Symmetry and visualization for GIZA ++ word alignment resluts.

Notifications You must be signed in to change notification settings

Deep1994/align_sym_plot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

align_sym_plot

Symmetry and visualization for GIZA ++ word alignment resluts.

After we get the GIZA++ output file like xxx.A3.final (see my blog: 使用 GIZA++ 进行词对齐),we can symmetrize and visualize them via following script.

Symmetry

python align_sym.py a2b.A3.final b2a.A3.final > aligned.grow-diag-final-and

where a2b.A3.final and b2a.A3.final are your own xxx.A3.final files.

After this, you will obtain the symmetry file aligned.grow-diag-final-and, which looks like:

1-5 2-1 2-3 3-4 6-2 7-1 8-5
1-7 2-1 2-3 3-5 3-6 4-6 5-1 5-2 6-2 7-7

Visualization

Then, we can visualize the symmetry file via align_plot.py.

python align_plot.py text_a.txt text_b.txt aligned.grow-diag-final-and 0

"""
Get visualization picture for the first sentence pair 
"""

which may look like:

img

Reference

使用GIZA++进行词对齐

About

Symmetry and visualization for GIZA ++ word alignment resluts.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages