benchmarks.wiki / Public workspace

BigCodeBench / BigCodeBench v0.1.0_hf 672b164e-7d44-552e-a458-61f8dd602a08

Problem

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

complete prompt

import pandas as pd
import seaborn as sns
from collections import Counter
from textblob import TextBlob
from matplotlib import pyplot as plt


def task_func(text, n, top_k):
    """
    Visualize the uppermost K n-grams in a given text string.

    Parameters:
    text (str): The text string.
    n (int): The value of n for the n-grams.
    top_k (int): The number of top n-grams to visualize.

    Returns:
    None

    Requirements:
    - re
    - pandas
    - seaborn
    - textblob
    - matplotlib

    Example:
    >>> type(task_func('This is a sample text for testing.', 2, 5))
    <class 'matplotlib.axes._axes.Axes'>
    """

instruct prompt

Visualize the uppermost K n-grams in a given text string.
The function should output with:
    None
You should write self-contained code starting with:

Code

import pandas as pd
import seaborn as sns
from collections import Counter
from textblob import TextBlob
from matplotlib import pyplot as plt
def task_func(text, n, top_k):

code prompt

Code

import pandas as pd
import seaborn as sns
from collections import Counter
from textblob import TextBlob
from matplotlib import pyplot as plt
def task_func(text, n, top_k):

entry point

task_func

libs

  • pandas
  • collections
  • matplotlib
  • textblob
  • seaborn

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