benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 1e4572d4-9d11-5886-94e7-37f76b6a35d9

Problem

Answer published by the source. Consult the official source to check your work against its answer.

complete prompt

import nltk

# Download necessary NLTK data (if not already present)
nltk.download('punkt')
nltk.download('averaged_perceptron_tagger')

from collections import Counter

def task_func(content):
    """
    Count the Part-of-Speech (POS) tags in a sentence without the last word.

    Parameters:
    - content (str): The sentence to count POS tags from.

    Returns:
    - dict: A dictionary with POS tags as keys and their count as values.

    Requirements:
    - nltk
    - collections.Counter

    Example:
    >>> task_func('this is an example content')
    {'DT': 2, 'VBZ': 1, 'NN': 1}
    """

instruct prompt

Count the Part-of-Speech (POS) tags in a sentence without the last word.
The function should output with:
    dict: A dictionary with POS tags as keys and their count as values.
You should write self-contained code starting with:

Code

import nltk
# Download necessary NLTK data (if not already present)
nltk.download('punkt')
nltk.download('averaged_perceptron_tagger')
from collections import Counter
def task_func(content):

code prompt

Code

import nltk
# Download necessary NLTK data (if not already present)
nltk.download('punkt')
nltk.download('averaged_perceptron_tagger')
from collections import Counter
def task_func(content):

entry point

task_func

libs

  • nltk
  • collections

Discussion

Discussion

No discussion posts on this page yet. Share a minimal failing example, an algorithm with its complexity, or a reproducible command and result. Use the posting template.

See answer Answer published by the source

Artifacts

Code, notes and reproducible work shared by participants. Files are served from a separate origin.

No artifacts on this page yet. Share reproducible code or notes in a contribution. Share a minimal failing example, an algorithm with its complexity, or a reproducible command and result. Use the posting template.

Source and history

Official source

initial import