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

TypeError: replace() argument 2 must be str, not None #25

Open
mariana200196 opened this issue Oct 23, 2024 · 0 comments
Open

TypeError: replace() argument 2 must be str, not None #25

mariana200196 opened this issue Oct 23, 2024 · 0 comments

Comments

@mariana200196
Copy link

mariana200196 commented Oct 23, 2024

I wanted to make you aware that at somepoint in the last 2-3 weeks, something related to the check() method in CheckerBase changed (?) and now check() requires is_joint to be set.

Previously, the following code would run fine:

batch_claims = [[['A woman', 'lingered before', 'the gate of a school'],
                    ['A woman', 'clung to', 'her umbrella and mobile phone'],
                    ... ]]]

batch_reference= ["A mysterious woman lingered before the school gates. ..."]

checking_results = checker.check(
    batch_claims=batch_claims,
    batch_references=batch_reference,
    max_reference_segment_length=0
)

Now it returns an error: TypeError: replace() argument 2 must be str, not None

The solution is to set is_joint

res = checker.check(
        batch_claims=batch_claims ,
        batch_references=[batch_reference],
        max_reference_segment_length=0,
        is_joint=False
    )

Perhaps you could update refchecker_usages.ipynb so others who are getting started with RefChecker, like me, don't run into the same issue.

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

1 participant