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

French Verbs Transformation #250

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Louanes1
Copy link

No description provided.

Copy link
Contributor

@msobrevillac msobrevillac left a comment

Choose a reason for hiding this comment

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

I think this is an interesting transformation for French. It is at an early stage but it is promising.


This transformation change some words with synonyms according to if their POS tag is a VERB for simple french sentences. It requires Spacy_lefff (an extention of spacy for french POS and lemmatizing) and nltk package with the open multilingual wordnet dictionary.

Authors : Lisa Barthe and Louanes Hamla from Fablab by Inetum in Paris
Copy link
Contributor

Choose a reason for hiding this comment

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

Please, add email. Maybe, you can use this style:

  • Author name:
  • Author email:
  • Author Affiliation:

TaskType.TEXT_TAGGING,
]
languages = ["fr"]

Copy link
Contributor

Choose a reason for hiding this comment

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

Please add the some keywords too.

languages = ["fr"]

def __init__(self, seed=0, max_outputs=1):
super().__init__(seed, max_outputs=max_outputs)
Copy link
Contributor

Choose a reason for hiding this comment

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

You don't use the param max_outputs. It means that you are generating all possible candidates?

return POSTagger()


nlp = spacy.load('fr_core_news_md')
Copy link
Contributor

Choose a reason for hiding this comment

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

You might want to use spacy like this.

from spacy.language import Language
from nltk.corpus import wordnet
import nltk
nltk.download('omw')
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe you might add the nltk in a similar way to spacy in initialize.py

"sentence": "J'ai enfin pu faire remorquer la voiture !"
},
"outputs": [{
"sentence": "J'ai enfin pu faire rouler la voiture !"
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure if you only change one verb per instance, i.e., you only generate one additional sentence per instance?

@mille-s
Copy link
Contributor

mille-s commented Sep 21, 2021

Hi, thanks for the submission! Two questions: (i) does the substitution only affect infinitive verbs? And if so, is there a way to overcome this limitation? (ii) do we have an idea of the coverage of the lexicon?
Also, we'd need to be able to control to what extent the meaning is the same as the input sentence, or to justify why it could be interesting to create alternative with a different meaning.

Another comment: is this transformation covered by https://github.com/GEM-benchmark/NL-Augmenter/pull/234/files? (although the latter is for English)

Should there be just one transformation for Verbs, Nouns #247 and Adjectives #249, since the method seems to be the same? The transformation could be called "Lexical susbstitutions for French".

@kaustubhdhole
Copy link
Collaborator

@Louanes1 ping

@Louanes1
Copy link
Author

Louanes1 commented Oct 4, 2021

Hi,
The code is supposed to return many sentences with a different verb for each sentence. (Only one verb is changed)
It is indeed more pertinent to regroup all 3 PRs into a single one. I'll try to group all codes and push them directly here. So that I'll change adjective, verb and noun.
Is it possible to have a list of unordered sentences as expected output ?

@AbinayaM02
Copy link
Collaborator

Hi, The code is supposed to return many sentences with a different verb for each sentence. (Only one verb is changed) It is indeed more pertinent to regroup all 3 PRs into a single one. I'll try to group all codes and push them directly here. So that I'll change adjective, verb and noun. Is it possible to have a list of unordered sentences as expected output ?

Hi @Louanes1 : You've already merged the 3 PRs into one right? If so, we can close this PR. Let me know.

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

Successfully merging this pull request may close these issues.

5 participants