bitextor / bifixer

Tool to fix bitexts and tag near-duplicates for removal

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Detokenization introduce new error to the data and ignore_detokenization is not working

jgcb00 opened this issue · comments

Hi,
We noticed that when using bifixer, the detokenisation looks like it's broking some dates or ammount of money by removing some spaces that we want to keep !

Morover the --ignore_detokenization options is not working, now the command gives back empty files

Exemple :
raw sentence :

At 31 December 2016, the credit lines granted to members of the Board of Directors amounted to EUR 2.7 million (31 December 2015: EUR 1.2 million); the credit lines granted to key officers amounted to EUR 6.5 million (31 December 2015: EUR 2.3 million).	Au 31 décembre 2016, les lignes de crédits accordées aux membres du Conseil d’administration s’élèvent à 2,7 millions d’euros (au 31 décembre 2015 : 1,2 million d’euros) ; les lignes de crédits accordées aux dirigeants clés s’élèvent à 6,5 millions d’euros (au 31 décembre 2015 : 2,3 millions d’euros).

After bifixer with --ignore_segmentation becomes :

At 31 December 2016, the credit lines granted to members of the Board of Directors amounted to EUR2.7million (31December2015: EUR1.2million); the credit lines granted to key officers amounted to EUR6.5million (31December2015: EUR2.3million).	Au 31 décembre 2016, les lignes de crédits accordées aux membres du Conseil d’administration s’élèvent à 2,7 millions d’euros (au 31 décembre 2015: 1,2 million d’euros); les lignes de crédits accordées aux dirigeants clés s’élèvent à 6,5 millions d’euros (au 31 décembre 2015: 2,3 millions d’euros).	98cfb47e918f93b4	1

the command :

cat $file  | parallel -j 39 --pipe -k -l $line python3 /home/share/tools/cleaning/bifixer/bifixer/bifixer.py -q --scol=1 --tcol=2 --ignore_segmentation - - en fr  > $file.bifix

Others examples :

GL-BNP-Paribas_fr-FR_en-GB_RV.tmx.utf8.tmx.en-gbfr-fr.San:At 31 December 2016, the credit lines granted to members of the Board of Directors amounted to EUR2.7million (31December2015: EUR1.2million); the credit lines granted to key officers amounted to EUR6.5million (31December2015: EUR2.3million).	Au 31 décembre 2016, les lignes de crédits accordées aux membres du Conseil d’administration s’élèvent à 2,7 millions d’euros (au 31 décembre 2015: 1,2 million d’euros); les lignes de crédits accordées aux dirigeants clés s’élèvent à 6,5 millions d’euros (au 31 décembre 2015: 2,3 millions d’euros).	98cfb47e918f93b4	1
BGL-BNP-Paribas_fr-FR_en-GB_RV.tmx.utf8.tmx.en-gbfr-fr.San:As at 31 December 2016, the subscribed and paid-up capital amounted to EUR713.1million, represented by 27,976,574 shares (compared with EUR713.1million and 27,979,135 shares as at 31December2015.	Au 31 décembre 2016, le capital souscrit et libéré s’établit à 713,1 millions d’euros représenté par 27.976.574 actions (contre 713,1 millions d’euros et 27.979.135 actions au 31 décembre 2015).	3c3e86ac66878fef	1
BGL-BNP-Paribas_fr-FR_en-GB_RV.tmx.utf8.tmx.en-gbfr-fr.San:As at 31December 2016, just as at 31December 2015, guarantees given included EUR100 million in guarantees given to Cardif Lux Vie S.A., following the merger of Fortis Luxembourg Vie S.A. and Cardif Lux International S.A.. As at 31 December 2016, a provision of EUR4.2million for this guarantee was recorded in the accounts (compared with EUR5.5million as at the end of 2015).	Au 31 décembre 2016 comme au 31 décembre 2015, les engagements de garantie donnés comprennent un montant de 100 millions d’euros de garanties données à Cardif Lux Vie S.A. dans le cadre de la fusion entre Fortis Luxembourg Vie S.A. et Cardif Lux International S.A. Au 31 décembre 2016, cette garantie est provisionnée à hauteur de 4,2 millions d’euros (contre 5,5 millions d’euros à fin 2015).	840336c61eee81c8	1
BGL-BNP-Paribas_fr-FR_en-GB_RV.tmx.utf8.tmx.en-gbfr-fr.San:With phased Common Equity Tier 1 (CET1) & Tier 1 ratios of 23.1% and of total equity of 23.2% as at 31 December 2016 (following application of CSSF circular – 14/599 of 19December2014), the Group largely meets the regulatory requirements.	Avec des ratios phasés CET1 & Tier 1 de 23,1% et de fonds propres total de 23,2% au 31 décembre 2016 (après application de la circulaire CSSF – 14/599 du 19 décembre 2014), le Groupe respecte largement les exigences fixées.	1f6324d9edcdf808	1
BGL-BNP-Paribas_fr-FR_en-GB_RV.tmx.utf8.tmx.en-gbfr-fr.San:With phased Common Equity Tier 1 (CET1) & Tier 1 ratios of 23.2% as at 31 December 2017 (following application of CSSF circular – 14/599 of 19December2014), the Group largely meets the regulatory requirements.	Avec des ratios phasés CET1 & Tier 1 de 23,2% au 31 décembre 2017 (après application de la circulaire CSSF – 14/599 du 19 décembre 2014), le Groupe respecte largement les exigences fixées.	91cc1ee32fa9812b	1
BGL-BNP-Paribas_fr-FR_en-GB_RV.tmx.utf8.tmx.en-gbfr-fr.San:As at 31December 2017, just as at 31December 2016, guarantees given included EUR100 million in guarantees given to Cardif Lux Vie S.A., following the merger of Fortis Luxembourg Vie S.A. and Cardif Lux International S.A.. As at 31 December 2017, a provision of EUR3.8million for this guarantee was recorded in the accounts (compared with EUR4.2million as at the end of 2016).	Au 31 décembre 2017 comme au 31 décembre 2016, les engagements de garantie donnés comprennent un montant de 100 millions d’euros de garanties données à Cardif Lux Vie S.A. dans le cadre de la fusion entre Fortis Luxembourg Vie S.A. et Cardif Lux International S.A. Au 31 décembre 2017, cette garantie est provisionnée à hauteur de 3,8 millions d’euros (contre 4,2 millions d’euros à fin 2016).	37424b5b374f9fab	1
BGL-BNP-Paribas_fr-FR_en-GB_RV.tmx.utf8.tmx.en-gbfr-fr.San:The change in fair value of derivatives recorded in liabilities in respect of own credit risk instruments was not significant as at 31December2017 or 31 December 2016.	La variation de la juste valeur des instruments dérivés au passif du bilan au titre du risque de crédit propre est non significative au 31 décembre 2017 et au 31 décembre 2016.	1c5207c48e9c2aa3	1
BGL-BNP-Paribas_fr-FR_en-GB_RV.tmx.utf8.tmx.en-gbfr-fr.San:As at 31December 2017, the additional paid-in capital was EUR2,761.6 million, unchanged versus 31 December 2016.	Au 31 décembre 2017 et au 31 décembre 2016, les primes d’émission s’élèvent à 2.761,6 millions d’euros.	690ec271ae8a1341	1
BGL-BNP-Paribas_fr-FR_en-GB_RV.tmx.utf8.tmx.en-gbfr-fr.San:At 31 December 2017, the credit lines granted to members of the Board of Directors amounted to EUR3.8million (31December2016: EUR2.7million); the credit lines granted to key officers amounted to EUR11.7million (31December2016: EUR6.5million).	Au 31 décembre 2017, les lignes de crédits accordées aux membres du Conseil d’administration s’élèvent à 3,8 millions d’euros (au 31 décembre 2016: 2,7 millions d’euros); les lignes de crédits accordées aux dirigeants clés s’élèvent à 11,7 millions d’euros (au 31 décembre 2016: 6,5 millions d’euros).	78d6f4e50fc4c6f7	1
StateStreet_UBS_en-GB_fr-FR_RV.tmx.utf8.tmx.en-gbfr-fr.San:The notarial deed containing the minutes of the extraordinary general meeting held on 29 November 2004 deciding the change of the denomination of the company into has been published in the Mémorial dated 23December 2004, and the notarial deed containing the minutes of the extraordinary general meeting held on 27 December 2005 deciding amendments to the Articles related to the compliance by the Company with the rules of the amended directive 2009/65/EC has been published in the Mémorial dated 30 January 2006.	L’acte notarié comprenant le procès-verbal de l’assemblée générale extraordinaire du 29 novembre 2004 portant sur le changement de dénomination de la société a été publié dans le Mémorial du 23 décembre 2004 et l’acte notarié contenant le procès-verbal de l’assemblée générale extraordinaire du 27 décembre 2005 portant modification des Statuts relativement au respect par la Société des dispositions de la directive 2009/65/CE modifiée a été publié dans le Mémorial daté du 30 janvier 2006.	254f429484feb94f	1

Hi there,
we will take a look into this asap.
In the meanwhile, I think the flag you need to use is --ignore_normalization

Hi, indeed --ignore_normalization prevent the issue !
Thanks !

Hi @jgcb00 ,
apparently, the spaces that are being removed from your text are not "regular" space characters, as seen in this hexdump:
hexdump

Anyway, they should not be removed, but replaced by regular space characters. We fixed it in edc0dc5

Cheers,
-Marta