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

Dashes are removed from output #18

Open
bersace opened this issue Sep 5, 2023 · 1 comment
Open

Dashes are removed from output #18

bersace opened this issue Sep 5, 2023 · 1 comment

Comments

@bersace
Copy link

bersace commented Sep 5, 2023

Hi,

In French, we have dash is some situtation. recasepunc lost them. Here is a reproduction of the bug:

$ cat input.txt
salut toto comment vas-tu
y a-t-il quelqu'un ici
$ python recasepunc.py predict fr.22000 < input.txt
WARNING: reverting to cpu as cuda is not available
Some weights of the model checkpoint at flaubert/flaubert_base_uncased were not used when initializing FlaubertModel: ['pred_layer.proj.weight', 'pred_layer.proj.bias']
- This IS expected if you are initializing FlaubertModel from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining mode
l).
- This IS NOT expected if you are initializing FlaubertModel from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).
Salut Toto, Comment vastu ?
Y atil quelqu' un ici ?

The dashes in vas-tu and a-t-il are removed.

A space is added after guillemet in quelqu' un.

Can you confirm this ?

Regards,
Étienne

@benob
Copy link
Owner

benob commented Oct 11, 2023

This is a byproduct of how tokenization is performed in the Flaubert model. I am afraid the only way to handle it is to retrain a model with a different tokenizer (such as CamemBERT).

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

No branches or pull requests

2 participants