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

get_replacement_mapper_ in seq_aligner.py #53

Open
yuhaoliu7456 opened this issue May 15, 2023 · 6 comments
Open

get_replacement_mapper_ in seq_aligner.py #53

yuhaoliu7456 opened this issue May 15, 2023 · 6 comments

Comments

@yuhaoliu7456
Copy link

Thanks for this amazing work. I tested many times on this func, and this func always returns a diagonal matrix with 1s on the diagonal. Why don't you use the built-in func in the torch directly if this is right? If this needs to be corrected, can you help explain this issue?

@HyelinNAM
Copy link

I also have same question. Can anyone answer for us? :)

@Kenneth-Wong
Copy link

I think this is because your source prompt and target prompt are almost the same, and the processed results of the tokenizer are so similar to the space-splited ones. For these cases, it will return the diagonal matrix. However, If the source text is "a lion is eating an apple", and the edited text is "a lovely-dog is eating an apple", the "lion" will be mapped to "lovely", "-", and "dog", because the tokenizer will tokenized the "lovely-dog" into "lovely", "-", "dog".

@sucongCJS
Copy link

I have the same question...

@sucongCJS
Copy link

I think this is because your source prompt and target prompt are almost the same, and the processed results of the tokenizer are so similar to the space-splited ones. For these cases, it will return the diagonal matrix. However, If the source text is "a lion is eating an apple", and the edited text is "a lovely-dog is eating an apple", the "lion" will be mapped to "lovely", "-", and "dog", because the tokenizer will tokenized the "lovely-dog" into "lovely", "-", "dog".

you are right bro!

@ybx193670
Copy link

I have the same question,too.

@ybx193670
Copy link

I have the same question,too.
Reason: seq_aligner file is not being imported
Action: Create a new unit folder, create an empty init.py in it, and move the seq_aligner.py into this folder, and remember to modify the path when importing at the end

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

5 participants