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

fixbug: Expand sentence-ending punctuation check in _create_statements method #1523

Merged

Conversation

Jeff-67
Copy link
Contributor

@Jeff-67 Jeff-67 commented Oct 17, 2024

Description

This pull request addresses an issue where non-English punctuation (e.g., "。", "!") was not properly handled in the _create_statements function, causing sentences in languages like Chinese to be ignored and potentially leading to incorrect faithfulness scores.

Changes Made

Updated the condition:

if sentence.strip().endswith("."):

to

if sentence.strip().endswith(('.', '。', '!', '!')):

This ensures that sentences with non-English punctuation are included in the processing.

Impact

This change allows the system to correctly process sentences in languages like Chinese, preventing empty sentences_with_index variables and ensuring accurate faithfulness scores.


Let me know if this works or if you need further edits! Thanks!

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Oct 17, 2024
@Jeff-67 Jeff-67 changed the title Expand sentence-ending punctuation check in _create_statements method fixbug: Expand sentence-ending punctuation check in _create_statements method Oct 17, 2024
@shahules786 shahules786 self-requested a review October 17, 2024 07:14
Copy link
Member

@shahules786 shahules786 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks a lot :)

@shahules786 shahules786 merged commit 685347d into explodinggradients:main Oct 17, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants