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

adding input language in definition assertion #678

Merged
merged 2 commits into from
Dec 12, 2021

Conversation

amirrezamirzaei
Copy link
Contributor

addressing #677
added the assertion @danyaljj and had to change a few tasks so the tests could pass. Although I don't know how useful this assertion could be.

@@ -169,6 +169,8 @@ def natural_keys(text):
assert type(data['Input_language']) == list, f'Input_language must be a list of strings.'
assert type(data['Output_language']) == list, f'Output_language must be a list of strings.'
assert type(data['Instruction_language']) == list, f'Output_language must be a list of strings.'
assert all((lan in data['Definition']) for lan in data['Input_language'] if
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonderful! Thanks!

@@ -22,7 +22,7 @@
"Instruction_language": [
"English"
],
"Definition": "A text is given in Malayalam. Translate it from the Malayalam language to the Tamil language. The translation must not omit or add information to the original sentence.",
"Definition": "A text is given in Tamil. Translate it from the Tamil language to the Malayalam language. The translation must not omit or add information to the original sentence.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@@ -17,7 +17,7 @@
"Instruction_language": [
"English"
],
"Definition": "You are given a sentence in Portugese. Your job is to translate the Portugese sentence into Spanish.",
"Definition": "You are given a sentence in Portuguese. Your job is to translate the Portuguese sentence into Spanish.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

@@ -14,7 +14,7 @@
"Output_language": [
"English"
],
"Definition": "The provided file includes inquiries about restaurants in Polsih, and we ask you to translate those to English language. Please bear in mind the following guidelines while doing the translation: 1) We are looking for the most naturally written and formal form of each sentence in your language. We are *NOT* looking for colloquial forms of the sentence. We are looking for formal form which is how you would type your queries in a text-based virtual assistant. 2) The words between quotation marks *SHOULD NOT* be translated. We expect you to keep those values intact and include the quotation marks around them as well. 3) The fully capitalized words like DATE_0, or DURATION_0 *SHOULD NOT* be translated. Please keep them as they are in the translations. 4) Please do not localize measurement units like miles to kilometers during your translation. miles should be translated to its equivalent in your language. 6) Note the input is all lowercased except for fully capitalized special placeholders (e.g. NUMBER, DATE, TIME). Please do the same in your translations.",
"Definition": "The provided file includes inquiries about restaurants in Polish, and we ask you to translate those to English language. Please bear in mind the following guidelines while doing the translation: 1) We are looking for the most naturally written and formal form of each sentence in your language. We are *NOT* looking for colloquial forms of the sentence. We are looking for formal form which is how you would type your queries in a text-based virtual assistant. 2) The words between quotation marks *SHOULD NOT* be translated. We expect you to keep those values intact and include the quotation marks around them as well. 3) The fully capitalized words like DATE_0, or DURATION_0 *SHOULD NOT* be translated. Please keep them as they are in the translations. 4) Please do not localize measurement units like miles to kilometers during your translation. miles should be translated to its equivalent in your language. 6) Note the input is all lowercased except for fully capitalized special placeholders (e.g. NUMBER, DATE, TIME). Please do the same in your translations.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

@danyaljj danyaljj merged commit 694d5a8 into allenai:master Dec 12, 2021
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

Successfully merging this pull request may close these issues.

2 participants