I am currently working on a Python project using text semantic to match similarities. At the end, my goal is to have a dataset column where all my interesting words are in order to be searched in by a dumb searchbar.
Currently I have in a column my original text and my normalized text. Is there a way to create all denormalized forms of each word (or at least for each noun) ?
I understand that you mean to generate all possible inflexions of an English word. For that, you may use LemmInflect as follows:
from lemminflect import getAllInflections
> getInflection('watch', tag='VBD')
('watched',)
> getAllInflections('watch')
{'NN': ('watch',), 'NNS': ('watches', 'watch'), 'VB': ('watch',), 'VBD': ('watched',), 'VBG': ('watching',), 'VBZ': ('watches',), 'VBP': ('watch',)}
Update: for French, you can use inflecteur:
from inflecteur import inflecteur
inflecteur = inflecteur()
inflecteur.load_dict()
inflecteur.get_word_form('pris')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With