Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using fast_align to train save the model in infer. #33

Closed
sugeeth14 opened this issue Sep 6, 2018 · 10 comments
Closed

Using fast_align to train save the model in infer. #33

sugeeth14 opened this issue Sep 6, 2018 · 10 comments

Comments

@sugeeth14
Copy link

Hello I have a large parallel corpus on which I used fast-align to get alignments but I have a few other sentences which are different from the original corpus for which I need to get alignment info. Is there a way so that I can use the knowledge learnt from large parallel corpus to directly get alignments for the smaller set of sentences.(Similar to saving checkpoint so that I can load checkpoint and get alignments).
Thanks in advance.

@Ru7z
Copy link

Ru7z commented Nov 13, 2018

Hi, there. I am facing the same situation. Did you have an answer?

@liesun1994
Copy link

Of course, you can use force_align.py !

@liesun1994
Copy link

First step, run:
fast_align -i corpus.f-e -d -v -o -p fwd_params >fwd_align 2>fwd_err
fast_align -i corpus.f-e -r -d -v -o -p rev_params >rev_align 2>rev_err
where corpus.f-e is training corpus, fwd_prarams, fwd_err, rev_params, rev_err are the saved models. Do not remove fwd_error and rev_error!

Second step:
run:
force_align.py fwd_params fwd_err rev_params rev_err [heuristic] <in.f-e >out.f-e.gdfa

where heuristic is one of: (intersect union grow-diag grow-diag-final grow-diag-final-and) default=grow-diag-final-and , in.f-e is the file which you want to get alignment.

@liesun1994
Copy link

@ru1996

@liesun1994
Copy link

@raghava14

@tomsbergmanis
Copy link

Thanks! Got it now!

@sugeeth14
Copy link
Author

Thanks @liesun1994 closing this for now !

@genbei
Copy link

genbei commented Apr 2, 2021

First step, run:
fast_align -i corpus.f-e -d -v -o -p fwd_params >fwd_align 2>fwd_err
fast_align -i corpus.f-e -r -d -v -o -p rev_params >rev_align 2>rev_err
where corpus.f-e is training corpus, fwd_prarams, fwd_err, rev_params, rev_err are the saved models. Do not remove fwd_error and rev_error!

Second step:
run:
force_align.py fwd_params fwd_err rev_params rev_err [heuristic] <in.f-e >out.f-e.gdfa

where heuristic is one of: (intersect union grow-diag grow-diag-final grow-diag-final-and) default=grow-diag-final-and , in.f-e is the file which you want to get alignment.

my script is fast_align -i train.en-zh -d -o -v > forward.align
Error is
fast_align:Command not found

why

@sugeeth14
Copy link
Author

sugeeth14 commented Apr 7, 2021

@genbei Follow the steps to install fast_align first available here

@zolastro
Copy link

zolastro commented May 25, 2022

I would like to point out that if you want to run this using python 3.x, you should check ttwelve12's solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants