PrithivirajDamodaran / Gramformer

A framework for detecting, highlighting and correcting grammatical errors on natural language text. Created by Prithiviraj Damodaran. Open to pull requests and other forms of collaboration.
MIT License
1.5k stars 175 forks source link

Output Issue with Gramformer - Script Long Strings vs. List #41

Open rut00 opened 10 months ago

rut00 commented 10 months ago

Hello @PrithivirajDamodaran,

I am reaching out to highlight an observed inconsistency while using the Gramformer library.

Issue Overview: When utilizing Gramformer with a script provided as a single string, the output appears to be incomplete. However, when the script is presented as a list of sentences, the output is both complete and accurate.

Code Reference:

# Original code with incomplete output
script = "We cleaned all the kitchen... If I’m stressed... and so on."
corrected_sentences = gf.correct(script, max_candidates=1)
print("[Input] ", script)
print("[Corre] ", corrected_sentence)

# Updated code with a list of sentences
script = ["We cleaned all the kitchen...", "If I’m stressed...", ...]
for script_sentence in script:
    corrected_sentences = gf.correct(script_sentence, max_candidates=1)
    print("[Input] ", script_sentence)
    for corrected_sentence in corrected_sentences:
        print("[Corre] ", corrected_sentence)
    print("-" * 100)

Expected Output: Consistency is expected in the output, irrespective of whether the input script is provided as a string or a list of sentences.

Additional Information:

I would appreciate your insights and guidance on resolving this matter.

Thank you for your time and assistance.

Best regards, Rutika.