0

I have lot of text which has the counting in words as well in different languages (different datasets but one data has one language so no mixing of language).

like

I have one apple 
I have two kids

and I want it to convert as

I have 1 apple
I have 2 kids

Is it possible to change that to the numbers / integers using huggingface or any ? or any suggestion for such problem would help! English Dutch French German supporting.

ML85
  • 709
  • 7
  • 19

2 Answers2

1

you can use some external package to easly accomplish this. Please take a look at this one https://pypi.org/project/word2number/

dchoruzy
  • 249
  • 2
  • 8
  • That I assume is only in English and I am handling several other languages with different datasets. – ML85 Jul 05 '21 at 14:46
  • you didn't say what languages you need to support. Take a look at https://pypi.org/project/word2number-i18n/ It supports English, French, Portugues, Russian, Slovak, Spanish – dchoruzy Jul 05 '21 at 14:51
0

I have worked with different versions of different libraries. With my tests fo far, I found out this as working perfectly for most of the cases.

words to numerics

This is the better solution and covers English French German Spanish.

ML85
  • 709
  • 7
  • 19