Fix Doc init and missing metadata in Summarization tasks
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- python
- Domain
- machine-learning
Research direction
Start in lighteval/tasks/tasks/summarization.py with the cnn_dm_prompt and xsum_prompt functions, then reproduce the constructor error using the CNN/DM example from the issue. Check that both summarization documents satisfy the Doc API and preserve the source article in Doc.specific. Done means the prompts construct successfully and extractiveness and faithfulness can access the source text.
Written by the indexing model from the issue text.
Description
Describe the bug
The cnn_dm_prompt and xsum_prompt functions in the summarization task fail with a TypeError because they do not provide the required choices and gold_index arguments to the Doc constructor. Furthermore, metrics such as extractiveness and faithfulness fail because the source text is not passed in the Doc.specific field.
To Reproduce
from lighteval.tasks.tasks.summarization import cnn_dm_prompt
# Using a standard record from CNN/DM
# doc = cnn_dm_prompt({"article": "...", "highlights": "..."}, "cnn_dm")
# TypeError: Doc.__init__() missing 2 required positional arguments: 'choices' and 'gold_index'
Expected behavior
- The
Docobject should be initialized with placeholderchoices=[""]andgold_index=0to satisfy the API for generative tasks. - The
specificfield should include{"text": line["article"]}(or document) for metric internal access.
Version info
- OS: mac
- Lighteval version: main (local development)
- Dominant language
- Python
- Stars
- 2.5k
- Forks
- 557
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from huggingface/lighteval
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
huggingface/lighteval#1384 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
huggingface/lighteval#1375 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
huggingface/lighteval#1365 ·
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 88/100
huggingface/lighteval#1346 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
huggingface/lighteval#1330 · 1 comment ·
All issues in huggingface/lighteval
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100