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

[BUG] GenerateSentencePair(...) always returns None positive and negative pairs #1068

Closed
caesar-one opened this issue Nov 22, 2024 · 2 comments · Fixed by #1096
Closed

[BUG] GenerateSentencePair(...) always returns None positive and negative pairs #1068

caesar-one opened this issue Nov 22, 2024 · 2 comments · Fixed by #1096
Assignees
Milestone

Comments

@caesar-one
Copy link

The GenerateSentencePair Task always (or very often) returns None positives. I have already investigated the issue, and found out that the regex uses .match(...) rather than .search(...) to find the pattern in the output:

match = POSITIVE_NEGATIVE_PAIR_REGEX.match(output)

As a context, re.match(...) tries to match the pattern only at the beginning of a string, while re.search(...) searches the first occurrence in the whole output (see search() vs. match() in the Python docs). In my case, for some reason the output using meta-llama/Llama-3.1-8B-Instruct was always something like:

---

Anchor: The rising cost of living in big cities is pushing more and more people towards the suburbs.

## Positive
The increasing availability of job opportunities and affordable housing in the suburbs is attracting many young professionals away from the high-stress, expensive urban lifestyle.

which is never matched using .match(...), while .search(...) does the job.

I'm not sure if this was expected or considered a feature, but I noticed that the same behavior might occur somewhere else in the code, as I have found multiple occurrences simply searching this: https://github.com/search?q=repo%3Aargilla-io%2Fdistilabel%20.match(&type=code

@davidberenstein1957
Copy link
Member

@sdiazlor perhaps you can have a look and explore this? We might include it in a minor release.

@davidberenstein1957
Copy link
Member

Hi @caesar-one, thanks for reporting this. We will have a look. Could you share your pipeline and perhaps some example?

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

Successfully merging a pull request may close this issue.

3 participants