Skip to content

GetCandidates shows candidates but FixFragment doesn't correct the sentence #113

Description

@axeligl

Hi everybody,

I trained a model for spanish spellchecking and I'm using it to correct some ocr's files (I'm making a full process digitalizing some very old typewriter documents and want to enhance the text result). The problem I have now is that the model show me some candidates when I use GetCandidates but it doesn't change it when using FixFragment. I wonder if it's something todo with context (n-grams and so) or perhaps with the symbols that are in the sentece.

Here is an example:
text = 'posee respectívámente en las localí&ades de Carlos M. Naón'
corrector.GetCandidates(['localí&ades'],0) -> ('localidades', 'localí&ades', 'localicades', 'localizades')
corrector.FixFragment(text) -> 'posee respectívamente en las local&ades de Carlos M. Naón'

It corrects "respectívámente" but it only erase the 'i' in "localí&ades". Maybe its about the tokens it uses to check when a word starts and ends.

Another example without special characters:
text='con anterioridad a la sanción de la ley'
corrector.FixFragment(text) -> 'con anterioridad la la canción de la ley'

It changes "sanción" with "canción" but if a GetCandidates, "sanción" is okey.
corrector.GetCandidates(['sanción'],0) -> ('sanción', 'canción', 'sanación', 'sanchón', 'sención', 'anción', 'sancion', 'sanión', 'kanción', 'sunción', 'sandión', 'sancián', 'sansión', 'sanció')

I think this issue is similar to #85

Thanks for the help!

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions